I am trying to setup OpenVPN server on FreeBSD 11 but I am not able to access Internet from Linux client. Ping an SSH connection to VPN server works.
I am using the same config with different OpenVPN server running on CentOS without any problems.
No firewall yet on either side.
Error log on client side:
Server:
Server OpenVPN version:
Server interface:
Server routing:
Server OpenVPN config file:
Client OpenVPN version:
Client config:
Client inteface:
Client routing:
I am using the same config with different OpenVPN server running on CentOS without any problems.
No firewall yet on either side.
Error log on client side:
Code:
Sat Jan 7 16:04:49 2017 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Feb 2 2016
Sat Jan 7 16:04:49 2017 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Sat Jan 7 16:04:49 2017 Control Channel Authentication: using '/etc/openvpn/ta.key' as a OpenVPN static key file
Sat Jan 7 16:04:49 2017 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 7 16:04:49 2017 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 7 16:04:49 2017 Socket Buffers: R=[212992->212992] S=[212992->212992]
Sat Jan 7 16:04:49 2017 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sat Jan 7 16:04:49 2017 UDPv4 link local: [undef]
Sat Jan 7 16:04:49 2017 UDPv4 link remote: [AF_INET]46.36.37.184:1196
Sat Jan 7 16:04:49 2017 TLS: Initial packet from [AF_INET]46.36.37.184:1196, sid=46bf2bb2 959f8b29
Sat Jan 7 16:04:49 2017 VERIFY OK: depth=1, CN=ChangeMe
Sat Jan 7 16:04:49 2017 Validating certificate key usage
Sat Jan 7 16:04:49 2017 ++ Certificate has key usage 00a0, expects 00a0
Sat Jan 7 16:04:49 2017 VERIFY KU OK
Sat Jan 7 16:04:49 2017 Validating certificate extended key usage
Sat Jan 7 16:04:49 2017 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
Sat Jan 7 16:04:49 2017 VERIFY EKU OK
Sat Jan 7 16:04:49 2017 VERIFY OK: depth=0, CN=server
Sat Jan 7 16:04:49 2017 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Sat Jan 7 16:04:49 2017 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 7 16:04:49 2017 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Sat Jan 7 16:04:49 2017 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jan 7 16:04:49 2017 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 2048 bit RSA
Sat Jan 7 16:04:49 2017 [server] Peer Connection Initiated with [AF_INET]46.36.37.184:1196
Sat Jan 7 16:04:51 2017 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Sat Jan 7 16:04:51 2017 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 8.8.8.8,dhcp-option DNS 8.8.4.4,
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: route options modified
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: route-related options modified
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: peer-id set
Sat Jan 7 16:04:51 2017 OPTIONS IMPORT: adjusting link_mtu to 1561
Sat Jan 7 16:04:51 2017 ROUTE_GATEWAY 192.168.0.1/255.255.255.0 IFACE=eth0 HWADDR=40:16:7e:25:a3:a4
Sat Jan 7 16:04:51 2017 TUN/TAP device tun0 opened
Sat Jan 7 16:04:51 2017 TUN/TAP TX queue length set to 100
Sat Jan 7 16:04:51 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Jan 7 16:04:51 2017 /sbin/ip link set dev tun0 up mtu 1500
Sat Jan 7 16:04:51 2017 /sbin/ip addr add dev tun0 10.0.24.2/24 broadcast 10.0.24.255
Sat Jan 7 16:04:51 2017 /sbin/ip route add 46.36.37.184/32 via 192.168.0.1
RTNETLINK answers: File exists
Sat Jan 7 16:04:51 2017 ERROR: Linux route add command failed: external program exited with error status: 2
Sat Jan 7 16:04:51 2017 /sbin/ip route add 0.0.0.0/1 via 10.0.24.1
Sat Jan 7 16:04:51 2017 /sbin/ip route add 128.0.0.0/1 via 10.0.24.1
Sat Jan 7 16:04:51 2017 UID set to nobody
Sat Jan 7 16:04:51 2017 Initialization Sequence Completed
Code:
root@vpn:/var/log # uname -a
FreeBSD vpn 11.0-RELEASE-p2 FreeBSD 11.0-RELEASE-p2 #0: Mon Oct 24 06:55:27 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Code:
root@vpn:/var/log # openvpn --version
OpenVPN 2.4.0 amd64-portbld-freebsd11.0 [SSL (OpenSSL)] [LZO] [LZ4] [MH/RECVDA] [AEAD] built on Jan 7 2017
library versions: OpenSSL 1.0.2j-freebsd 26 Sep 2016, LZO 2.09
Originally developed by James Yonan
Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
Compile time defines: enable_async_push=no enable_comp_stub=no enable_crypto=yes enable_crypto_ofb_cfb=yes enable_debug=yes enable_def_auth=yes enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=needless enable_fragment=yes enable_iproute2=no enable_libtool_lock=yes enable_lz4=yes enable_lzo=yes enable_management=yes enable_multi=yes enable_multihome=yes enable_pam_dlopen=no enable_pedantic=no enable_pf=yes enable_pkcs11=no enable_plugin_auth_pam=yes enable_plugin_down_root=yes enable_plugins=yes enable_port_share=yes enable_selinux=no enable_server=yes enable_shared=yes enable_shared_with_static_runtimes=no enable_silent_rules=no enable_small=no enable_static=yes enable_strict=yes enable_strict_options=no enable_systemd=no enable_werror=no enable_win32_dll=yes enable_x509_alt_username=no with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_plugindir='$(libdir)/openvpn/plugins' with_sysroot=no
Code:
root@vpn:/var/log # ifconfig tun0
tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet 10.0.24.1 --> 10.0.24.2 netmask 0xffffff00
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
groups: tun
Opened by PID 856
Code:
root@vpn:/var/log # netstat -nr4
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 46.36.37.1 UGS re0
10.0.24.0/24 10.0.24.2 UGS tun0
10.0.24.1 link#3 UHS lo0
10.0.24.2 link#3 UH tun0
46.36.37.0/24 link#1 U re0
46.36.37.184 link#1 UHS lo0
127.0.0.1 link#2 UH lo0
Code:
port 1196
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
tls-auth ta.key 0
topology subnet
server 10.0.24.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
cipher AES-256-CBC
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
crl-verify crl.pem
log-append /var/log/openvpn/openvpn.log
Code:
root@riba:/etc/openvpn# openvpn --version
OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Feb 2 2016
library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Originally developed by James Yonan
Copyright (C) 2002-2010 OpenVPN Technologies, Inc. <sales@openvpn.net>
Compile time defines: enable_crypto=yes enable_crypto_ofb_cfb=yes enable_debug=yes enable_def_auth=yes enable_dependency_tracking=no enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown enable_fast_install=yes enable_fragment=yes enable_http_proxy=yes enable_iproute2=yes enable_libtool_lock=yes enable_lzo=yes enable_lzo_stub=no enable_maintainer_mode=no enable_management=yes enable_multi=yes enable_multihome=yes enable_pam_dlopen=no enable_password_save=yes enable_pedantic=no enable_pf=yes enable_pkcs11=yes enable_plugin_auth_pam=yes enable_plugin_down_root=yes enable_plugins=yes enable_port_share=yes enable_selinux=no enable_server=yes enable_shared=yes enable_shared_with_static_runtimes=no enable_silent_rules=no enable_small=no enable_socks=yes enable_ssl=yes enable_static=yes enable_strict=no enable_strict_options=no enable_systemd=yes enable_win32_dll=yes enable_x509_alt_username=yes with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no with_plugindir='${prefix}/lib/openvpn' with_sysroot=no
Code:
client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote 46.36.37.184 1196
resolv-retry infinite
nobind
user nobody
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
comp-lzo
key-direction 1
verb 3
log-append /var/log/openvpn/openvpn.log
ca /etc/openvpn/ca.crt
cert /etc/openvpn/riba.crt
key /etc/openvpn/riba.key
tls-auth /etc/openvpn/ta.key 1
Code:
root@riba:/etc/openvpn# ifconfig tun0
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.0.24.2 P-t-P:10.0.24.2 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:260 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:18107 (18.1 KB)
Code:
root@riba:/etc/openvpn# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.24.1 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 eth0
10.0.24.0 0.0.0.0 255.255.255.0 U 0 0 0 tun0
46.36.37.184 192.168.0.1 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 10.0.24.1 128.0.0.0 UG 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 100 0 0 eth0
Last edited: