OpenWrt Forum Archive

Topic: OpenWRT Noob needs serious help with OpenVPN

The content of this topic has been archived between 22 Apr 2018 and 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Inf1n1nty wrote:

Is there a complete tutorial how I should configure OpenVPN with your config? (With Creating RSA Key's etc.).

No. Mainly because:

  • My configuration is a combination of long-forgotten tutorials and experimentation, and;

  • I'm too lazy to write a new one


Inf1n1nty wrote:

Or should i start with this guide?

https://wiki.openwrt.org/doc/howto/open … rver-setup

Thank you!

It's a good place to start. Also, the wiki is open to anyone who registers. If you can build a better mousetrap...

To add to the above, encryption and routing/firewalling are two separate things. Encryption merely governs whether you can make a connection to the VPN. Routing and firewalling govern whether you can make connections beyond the VPN.

(Last edited by 600cc on 27 Mar 2018, 23:55)

I know now what my Problem is:

root@WRT32X:~# openvpn --config /tmp/etc/openvpn-openvpn.conf
Wed Mar 28 16:11:57 2018 OpenVPN 2.3.11 arm-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH] [IPv6]
Wed Mar 28 16:11:57 2018 library versions: PolarSSL 1.3.17, LZO 2.09
Wed Mar 28 16:11:57 2018 tls_ctx_load_cert_file:287: X509 - The CRT/CRL/CSR format is invalid, e.g. different type expected
Wed Mar 28 16:11:57 2018 Cannot load certificate file /etc/openvpn/my-server.crt
Wed Mar 28 16:11:57 2018 Exiting due to fatal error

Looks like my my-server.crt File from my config is empty (0KB).


I get this error when I start the script of this page :


#!/bin/sh
 
printf "\n\n  # Creating Directory Structure #\n\n"
printf %b "------------------------------------------------------------\n"
 
  PKI_DIR="/etc/openvpn/ssl"
 
    [ -d ${PKI_DIR} ] && rm -rf ${PKI_DIR}
      mkdir -p ${PKI_DIR} && chmod -R 0600 ${PKI_DIR}
      cd ${PKI_DIR}
 
    touch index.txt && touch index && echo 1000 > serial
    cp /etc/ssl/openssl.cnf ${PKI_DIR}
 
printf "\n\n  # Customizing openssl.cnf #\n\n"
printf %b "------------------------------------------------------------\n\n"
 
  PKI_CNF=${PKI_DIR}/openssl.cnf
 
    sed -i '/^dir/   s:=.*:= /etc/openvpn/ssl:'                ${PKI_CNF}
    sed -i '/^new_certs_dir/   s:=.*:= /etc/openvpn/ssl:'      ${PKI_CNF}
    sed -i '/.*Name/ s:= match:= optional:'                    ${PKI_CNF}
    sed -i '/organizationName_default/    s:= .*:= WWW Ltd.:'  ${PKI_CNF}
    sed -i '/stateOrProvinceName_default/ s:= .*:= London:'    ${PKI_CNF}
    sed -i '/countryName_default/         s:= .*:= GB:'        ${PKI_CNF}
    sed -i '/default_days/   s:=.*:= 3650:'                    ${PKI_CNF}
    sed -i '/default_bits/   s:=.*:= 4096:'                    ${PKI_CNF}
 
    cat >> ${PKI_CNF} <<"EOF"
[ my-server ] 
  keyUsage = digitalSignature, keyEncipherment
  extendedKeyUsage = serverAuth
 
[ my-client ] 
  keyUsage = digitalSignature
  extendedKeyUsage = clientAuth
EOF
 
printf "\n\n  # Generating Server PSK and CA, Server, & Client Certs #\n\n"
printf %b "------------------------------------------------------------\n"
 
  printf "\n\n  ...Generating Certifcate Authority Cert & Key...\n"
  printf %b "------------------------------------------------------------\n\n"
    openssl req -batch -nodes -new -keyout "ca.key" -out "ca.crt" -x509 -config ${PKI_CNF} -days 3650
 
  printf "\n\n  ...Generating Server Cert & Key...\n"
  printf %b "------------------------------------------------------------\n\n"
    openssl req -batch -nodes -new -keyout "my-server.key" -out "my-server.csr" -subj "/CN=my-server" -config ${PKI_CNF}
 
  printf "\n\n  ...Signing Server Cert...\n\n"
    openssl ca  -batch -keyfile "ca.key" -cert "ca.crt" -in "my-server.csr" -out "my-server.crt" -config ${PKI_CNF} -extensions my-server
 
  printf "\n\n  ...Generating Client Cert & Key...\n"
  printf %b "------------------------------------------------------------\n\n"
    openssl req -batch -nodes -new -keyout "my-client.key" -out "my-client.csr" -subj "/CN=my-client" -config ${PKI_CNF}
 
  printf "\n\n  ...Signing Client Cert...\n"
  printf %b "------------------------------------------------------------\n\n"
    openssl ca  -batch -keyfile "ca.key" -cert "ca.crt" -in "my-client.csr" -out "my-client.crt" -config ${PKI_CNF} -extensions my-client     
 
  printf "\n\n  ...Generating OpenVPN TLS PSK...\n"
  printf %b "------------------------------------------------------------\n\n"
    openvpn --genkey --secret tls-auth.key
 
  printf "\n  ...Generating Diffie-Hellman Cert...\n"
  printf %b "------------------------------------------------------------\n\n"
    printf "    # May take a while to complete (~25m on WRT3200ACM) #\n\n\n"
    openssl dhparam -out dh2048.pem 2048
 
printf "\n\n  ...Correcting Permissions...\n"
printf %b "------------------------------------------------------------\n"
  chmod 0600 ca.key dh2048.pem my-server.key my-client.key tls-auth.key
 
printf "\n\n  # Copying Certs & Keys to /etc/openvpn/ #\n"
printf %b "------------------------------------------------------------\n"
  cp ca.crt my-server.* my-client.* dh2048.pem tls-auth.key /etc/openvpn
 
printf "\n\n  . . .  DONE  . . .  \n\n\n"


Error:

root@WRT32X:/etc/openvpn/ssl#     openssl ca  -batch -keyfile "ca.key" -cert "ca
.crt" -in "my-server.csr" -out "my-server.crt" -config ${PKI_CNF} -extensions my
-server
Using configuration from /etc/openvpn/ssl/openssl.cnf
Error Loading extension section my-server
3069793500:error:02001002:lib(2):func(1):reason(2):NA:0:fopen('/etc/openvpn/ssl/index.txt.attr','rb')
3069793500:error:2006D080:lib(32):func(109):reason(128):NA:0:
3069793500:error:0E078072:lib(14):func(120):reason(114):NA:0:
3069793500:error:0E06D06C:lib(14):func(109):reason(108):NA:0:group=CA_default name=email_in_dn
root@WRT32X:/etc/openvpn/ssl#
root@WRT32X:/etc/openvpn/ssl#   printf "\n\n  ...Generating Client Cert & Key...
\n"

This is the content of the openssl.cnf File:

#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#

# Note that you can include other files from the main configuration
# file using the .include directive.
#.include filename

# This definition stops the following lines choking if HOME isn't
# defined.
HOME            = .
RANDFILE        = $ENV::HOME/.rnd

# Extra OBJECT IDENTIFIER info:
#oid_file        = $ENV::HOME/.oid
oid_section        = new_oids

# To use this configuration file with the "-extfile" option of the
# "openssl x509" utility, name here the section containing the
# X.509v3 extensions to use:
# extensions        = 
# (Alternatively, use a configuration file that has only
# X.509v3 extensions in its main [= default] section.)

[ new_oids ]

# We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6

# Policies used by the TSA examples.
tsa_policy1 = 1.2.3.4.1
tsa_policy2 = 1.2.3.4.5.6
tsa_policy3 = 1.2.3.4.5.7

####################################################################
[ ca ]
default_ca    = CA_default        # The default ca section

####################################################################
[ CA_default ]

dir        = /etc/openvpn/ssl
certs        = $dir/certs        # Where the issued certs are kept
crl_dir        = $dir/crl        # Where the issued crl are kept
database    = $dir/index.txt    # database index file.
#unique_subject    = no            # Set to 'no' to allow creation of
                    # several certs with same subject.
new_certs_dir    = /etc/openvpn/ssl

certificate    = $dir/cacert.pem     # The CA certificate
serial        = $dir/serial         # The current serial number
crlnumber    = $dir/crlnumber    # the current crl number
                    # must be commented out to leave a V1 CRL
crl        = $dir/crl.pem         # The current CRL
private_key    = $dir/private/cakey.pem# The private key
RANDFILE    = $dir/private/.rand    # private random number file

x509_extensions    = usr_cert        # The extensions to add to the cert

# Comment out the following two lines for the "traditional"
# (and highly broken) format.
name_opt     = ca_default        # Subject Name options
cert_opt     = ca_default        # Certificate field options

# Extension copying option: use with caution.
# copy_extensions = copy

# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs
# so this is commented out by default to leave a V1 CRL.
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions    = crl_ext

default_days    = 3650
default_crl_days= 30            # how long before next CRL
default_md    = default        # use public key default MD
preserve    = no            # keep passed DN ordering

# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
policy        = policy_match

# For the CA policy
[ policy_match ]
countryName        = optional
stateOrProvinceName    = optional
organizationName    = optional
organizationalUnitName    = optional
commonName        = supplied
emailAddress        = optional

# For the 'anything' policy
# At this point in time, you must list all acceptable 'object'
# types.
[ policy_anything ]
countryName        = optional
stateOrProvinceName    = optional
localityName        = optional
organizationName    = optional
organizationalUnitName    = optional
commonName        = supplied
emailAddress        = optional

####################################################################
[ req ]
default_bits        = 4096
default_keyfile     = privkey.pem
distinguished_name    = req_distinguished_name
attributes        = req_attributes
x509_extensions    = v3_ca    # The extensions to add to the self signed cert

# Passwords for private keys if not present they will be prompted for
# input_password = secret
# output_password = secret

# This sets a mask for permitted string types. There are several options. 
# default: PrintableString, T61String, BMPString.
# pkix     : PrintableString, BMPString (PKIX recommendation before 2004)
# utf8only: only UTF8Strings (PKIX recommendation after 2004).
# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings).
# MASK:XXXX a literal mask value.
# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings.
string_mask = utf8only

# req_extensions = v3_req # The extensions to add to a certificate request

[ req_distinguished_name ]
countryName            = Country Name (2 letter code)
countryName_default        = GB
countryName_min            = 2
countryName_max            = 2

stateOrProvinceName        = State or Province Name (full name)
stateOrProvinceName_default    = London

localityName            = Locality Name (eg, city)

0.organizationName        = Organization Name (eg, company)
0.organizationName_default    = WWW Ltd.

# we can do this but it is not needed normally :-)
#1.organizationName        = Second Organization Name (eg, company)
#1.organizationName_default    = WWW Ltd.

organizationalUnitName        = Organizational Unit Name (eg, section)
#organizationalUnitName_default    =

commonName            = Common Name (e.g. server FQDN or YOUR name)
commonName_max            = 64

emailAddress            = Email Address
emailAddress_max        = 64

# SET-ex3            = SET extension number 3

[ req_attributes ]
challengePassword        = A challenge password
challengePassword_min        = 4
challengePassword_max        = 20

unstructuredName        = An optional company name

[ usr_cert ]

# These extensions are added when 'ca' signs a request.

# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.

basicConstraints=CA:FALSE

# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.

# This is OK for an SSL server.
# nsCertType            = server

# For an object signing certificate this would be used.
# nsCertType = objsign

# For normal client use this is typical
# nsCertType = client, email

# and for everything including object signing:
# nsCertType = client, email, objsign

# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment

# This will be displayed in Netscape's comment listbox.
nsComment            = "OpenSSL Generated Certificate"

# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer

# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move

# Copy subject details
# issuerAltName=issuer:copy

#nsCaRevocationUrl        = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName

# This is required for TSA certificates.
# extendedKeyUsage = critical,timeStamping

[ v3_req ]

# Extensions to add to a certificate request

basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment

[ v3_ca ]


# Extensions for a typical CA


# PKIX recommendation.

subjectKeyIdentifier=hash

authorityKeyIdentifier=keyid:always,issuer

basicConstraints = critical,CA:true

# Key usage: this is typical for a CA certificate. However since it will
# prevent it being used as an test self-signed certificate it is best
# left out by default.
# keyUsage = cRLSign, keyCertSign

# Some might want this also
# nsCertType = sslCA, emailCA

# Include email address in subject alt name: another PKIX recommendation
# subjectAltName=email:copy
# Copy issuer details
# issuerAltName=issuer:copy

# DER hex encoding of an extension: beware experts only!
# obj=DER:02:03
# Where 'obj' is a standard or added object
# You can even override a supported extension:
# basicConstraints= critical, DER:30:03:01:01:FF

[ crl_ext ]

# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.

# issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always

[ proxy_cert_ext ]
# These extensions should be added when creating a proxy certificate

# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.

basicConstraints=CA:FALSE

# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.

# This is OK for an SSL server.
# nsCertType            = server

# For an object signing certificate this would be used.
# nsCertType = objsign

# For normal client use this is typical
# nsCertType = client, email

# and for everything including object signing:
# nsCertType = client, email, objsign

# This is typical in keyUsage for a client certificate.
# keyUsage = nonRepudiation, digitalSignature, keyEncipherment

# This will be displayed in Netscape's comment listbox.
nsComment            = "OpenSSL Generated Certificate"

# PKIX recommendations harmless if included in all certificates.
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer

# This stuff is for subjectAltName and issuerAltname.
# Import the email address.
# subjectAltName=email:copy
# An alternative to produce certificates that aren't
# deprecated according to PKIX.
# subjectAltName=email:move

# Copy subject details
# issuerAltName=issuer:copy

#nsCaRevocationUrl        = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName

# This really needs to be in place for it to be a proxy certificate.
proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo

####################################################################
[ tsa ]

default_tsa = tsa_config1    # the default TSA section

[ tsa_config1 ]

# These are used by the TSA reply generation only.
dir        = /etc/openvpn/ssl
serial        = $dir/tsaserial    # The current serial number (mandatory)
crypto_device    = builtin        # OpenSSL engine to use for signing
signer_cert    = $dir/tsacert.pem     # The TSA signing certificate
                    # (optional)
certs        = $dir/cacert.pem    # Certificate chain to include in reply
                    # (optional)
signer_key    = $dir/private/tsakey.pem # The TSA private key (optional)
signer_digest  = sha256            # Signing digest to use. (Optional)
default_policy    = tsa_policy1        # Policy if request did not specify it
                    # (optional)
other_policies    = tsa_policy2, tsa_policy3    # acceptable policies (optional)
digests     = sha1, sha256, sha384, sha512  # Acceptable message digests (mandatory)
accuracy    = secs:1, millisecs:500, microsecs:100    # (optional)
clock_precision_digits  = 0    # number of digits after dot. (optional)
ordering        = yes    # Is ordering defined for timestamps?
                # (optional, default: no)
tsa_name        = yes    # Must the TSA name be included in the reply?
                # (optional, default: no)
ess_cert_id_chain    = no    # Must the ESS cert id chain be included?
                # (optional, default: no)
ess_cert_id_alg        = sha1    # algorithm to compute certificate
                # identifier (optional, default: sha1)[ my-server ] 
  keyUsage = digitalSignature, keyEncipherment
  extendedKeyUsage = serverAuth
 
[ my-client ] 
  keyUsage = digitalSignature
  extendedKeyUsage = clientAuth

Any Ideas?

Thank you!

I have found the error in the script.

How can I report that the the creator of this topic in Wiki?

But now I get this error?

root@WRT32X:/etc/openvpn/ssl# openvpn --config /tmp/etc/openvpn-vpnserver.conf
Segmentation fault

Have you seen this before?

I have tried your configuration and got the same error.

In other forums I have read that this could be an error with compiling OpenVPN Package.

The Openvpn Version on this router is also very old I think:

OpenVPN 2.3.11 arm-openwrt-linux-gnu [SSL (PolarSSL)] [LZO] [EPOLL] [MH] [IPv6]
library versions: PolarSSL 1.3.17, LZO 2.09
Originally developed by James Yonan
Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>

It is not so easy to upgrade to a newer version I think, or am I wrong?

When I try to upgrade with opkg I get this output:

root@WRT32X:(unknown)# opkg update openvpn
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/base/Packages.gz.
# custom headers to add: 0
Updated list of available packages in /var/opkg-lists/designated_driver_base.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/base/Packages.sig.
# custom headers to add: 0
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/kernel/Packages.gz.
# custom headers to add: 0
Updated list of available packages in /var/opkg-lists/designated_driver_kernel.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/kernel/Packages.sig.
# custom headers to add: 0
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/linksys/Packages.gz.
# custom headers to add: 0
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/linksys/Packages.sig.
# custom headers to add: 0
Signature check failed.
Remove wrong Signature file.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/packages/Packages.gz.
# custom headers to add: 0
Updated list of available packages in /var/opkg-lists/designated_driver_packages.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/packages/Packages.sig.
# custom headers to add: 0
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/routing/Packages.gz.
# custom headers to add: 0
Updated list of available packages in /var/opkg-lists/designated_driver_routing.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/routing/Packages.sig.
# custom headers to add: 0
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/telephony/Packages.gz.
# custom headers to add: 0
Updated list of available packages in /var/opkg-lists/designated_driver_telephony.
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/telephony/Packages.sig.
# custom headers to add: 0
Signature check passed.
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/linksys/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/linksys/Packages.sig, wget returned 8.
ash: getcwd: No such file or directory

Thank you!

Sorry for giving eventually too much Information but I am a step closer for maybe solving the Problem:

With this Config I got no error,

it means the TLS Server is the Problem.

Once again, any Ideas?

Thank you!

client-to-client
persist-key
persist-tun
#tls-server
ca /etc/openvpn/ca.crt
cert /etc/openvpn/my-server.crt
comp-lzo yes
dev tun0
dev-type tun
dh /etc/openvpn/dh2048.pem
keepalive 10 120
key /etc/openvpn/my-server.key
log-append /tmp/openvpn.log
mode server
port 1194
proto udp
route-gateway dhcp
#server 192.168.200.0 255.255.255.0
tls-auth /etc/openvpn/tls-auth.key 0
topology subnet
verb 11
push comp-lzo yes
push persist-key
push persist-tun
push topology subnet
push route-gateway dhcp
push redirect-gateway def1
push route 192.168.200.0 255.255.255.0
push dhcp-option DNS 192.168.4.1

Apologies for the delay in responding; I've been away from my computer for a couple of days.

As you've discovered, certificate and key files must have valid data in them. Empty files will cause problems.

With regard to the Wiki, if there's an error in the document, then you can fix the error yourself. The Wiki is open to anyone who registers. You don't need to spend time tracking down the author.

These days I only use release builds. It's easier. I gave up using trunk and snapshot builds a long time ago, so I can't offer advice on upgrading packages on those builds. You might have to compile a suitable package yourself, if there isn't a package which opkg can upgrade.

Lastly, I would suggest reading the OpenVPN manual specific to your version of OpenVPN. If it's v2.3.11 then https://community.openvpn.net/openvpn/w … n23ManPage should be useful. There are some options which exist in older versions of OpenVPN and which have been removed in newer versions. Similarly, there are options for the latest versions of OpenVPN which don't exist in the older versions.

Hi,

a great guy from Linksys Forum helped me to solve the Problem with the faulty OpenVPN - PolarSSL Problem:

#Update WRT32X OpenWRT Packages and install wget
opkg update
opkg install wget

#Remove openvpn-polarssl conflicting files with openvpn-openssl installation
rm /etc/init.d/openvpn
rm /lib/upgrade/keep.d/openvpn
rm /usr/sbin/openvpn

#Install two openvpn packages
opkg install openvpn-openssl openssl-util 

#Create CA certificates
cd /tmp
wget --no-check-certificate https://openwrt.org/_export/code/docs/guide-user/services/vpn/openvpn/server.setup?codeblock=3
mv server.setup?codeblock=3 create-certs.sh
chmod +x ./create-certs.sh
./create-certs.sh

#Configure WRT32x network, firewall and openvpn server
wget --no-check-certificate https://openwrt.org/_export/code/docs/guide-user/services/vpn/openvpn/server.setup?codeblock=4
mv server.setup?codeblock=4 create-configs.sh
chmod +x create-configs.sh
./create-configs.sh

#Enable and Start OpenVPN
/etc/init.d/openvpn enable
/etc/init.d/openvpn start

#Download ovpn file creation script
wget --no-check-certificate https://openwrt.org/_export/code/docs/guide-user/services/vpn/openvpn/server.setup?codeblock=10
mv server.setup?codeblock=10 create-ovpn.sh
chmod +x create-ovpn.sh

#Edit WAN IP Address in script
vim create-ovpn.sh

#Create OpenVPN client ovpn file
./create-ovpn.sh

Now OpenVPN can connect!

But I get this Security Information in the Log File:

Sun Apr 01 11:24:54 2018 Outgoing Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Sun Apr 01 11:24:54 2018 WARNING: INSECURE cipher with block size less than 128 bit (64 bit).  This allows attacks like SWEET32.  Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Sun Apr 01 11:24:54 2018 Outgoing Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Apr 01 11:24:54 2018 Incoming Data Channel: Cipher 'BF-CBC' initialized with 128 bit key
Sun Apr 01 11:24:54 2018 WARNING: INSECURE cipher with block size less than 128 bit (64 bit).  This allows attacks like SWEET32.  Mitigate by using a --cipher with a larger block size (e.g. AES-256-CBC).
Sun Apr 01 11:24:54 2018 Incoming Data Channel: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Apr 01 11:24:54 2018 WARNING: cipher with small block size in use, reducing reneg-bytes to 64MB to mitigate SWEET32 attacks.

I have googled and found this OpenVPN Tutorial:

https://docs.openvpn.net/command-line/a … and_client

But this does not work for me.

How can I change Cipher (or whatever helps to solve this Problem)?



My second question is how to activate Split Tunneling with this Config? I want that just my Subnet 192.168.4.0/24 is routed with OpenVPN. The other Internet Traffic should be routed over the default gateway on the Open VPN Client.


Thank you for your help!!!

Hi again,

I just want to tell you my OpenVPN Config is running wink


Split Tunneling also is running with adding/modifiying the config File (adding a Route to 192.168.4.0):


config openvpn 'vpnserver'
    option enabled '1'
    option dev_type 'tun'
    option dev 'ovpns0'
    option port '1194'
    option proto 'udp'
    option comp_lzo 'yes'
    option keepalive '10 120'
    option persist_key '1'
    option persist_tun '1'
    option ca '/etc/openvpn/ca.crt'
    option cert '/etc/openvpn/my-server.crt'
    option key '/etc/openvpn/my-server.key'
    option dh '/etc/openvpn/dh2048.pem'
    option tls_auth '/etc/openvpn/tls-auth.key 0'
    option mode 'server'
    option tls_server '1'
    option server '192.168.40.0 255.255.255.0'
    option topology 'subnet'
    #option route_gateway 'dhcp'
    option client_to_client '1'
    list push 'comp-lzo yes'
    list push 'persist-key'
    list push 'persist-tun'
    list push 'topology subnet'
    #list push 'route-gateway dhcp'
    #list push 'redirect-gateway def1 bypass-dhcp'
    list push 'route 192.168.4.0 255.255.255.0'
    #list push 'dhcp-option DNS 192.168.1.1'
    option cipher 'AES-256-CBC'

Thank you!

Glad it's working. Got there in the end!

The discussion might have continued from here.