Hello, i'm setting up openvpn and there seems to be a problem with the configuration i have made. I'm following the Excellent "concise" OpenVPN setup steps posted earlier this year by SpaceTeddy.
Everything connects up ok, but the server is pushing the wrong route to the client when it connects. The server gets IP address 10.20.30.1 and it assigns 10.20.30.6 to the client when it connects, but it pushes a point-to-point connection for the client to 10.20.30.5 and also pushes a route to that .5 address for the default gateway. There is no such .5 ip address though, and so the routing of traffic is not performed correctly.
Any advice greatly appreciated!
Here is my server config file:
My client config file:Code:daemon port 2607 proto tcp dev tun0 ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt cert /etc/openvpn/easy-rsa/2.0/keys/lixxxxxx.crt key /etc/openvpn/easy-rsa/2.0/keys/lixxxxxx.key dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem server 10.20.30.0 255.255.255.0 ifconfig-pool-persist openvpn.dhcp keepalive 10 120 comp-lzo user nobody group nogroup persist-key persist-tun status /var/log/openvpn/openvpn-status.log log-append /var/log/openvpn/openvpn.log verb 4 mute 20 client-to-client plugin /usr/lib/openvpn/openvpn-auth-pam.so common-auth client-cert-not-required username-as-common-name
And here is an excerpt from the logfile:Code:float client dev tun proto tcp port 2607 remote xxxx.server.com redirect-gateway def1 resolv-retry infinite nobind persist-key persist-tun ca ca.crt ns-cert-type server comp-lzo verb 3 auth-user-pass http-proxy 192.168.1.5 8080 stdin ntlm
Code:Mon Nov 24 17:04:47 2008 us=49529 OpenVPN 2.1_rc11 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Oct 15 2008 Mon Nov 24 17:04:47 2008 us=565373 TUN/TAP device tun0 opened Mon Nov 24 17:04:47 2008 us=565395 TUN/TAP TX queue length set to 100 Mon Nov 24 17:04:47 2008 us=565433 /sbin/ifconfig tun0 10.20.30.1 pointopoint 10.20.30.2 mtu 1500 Mon Nov 24 17:04:47 2008 us=567498 /sbin/route add -net 10.20.30.0 netmask 255.255.255.0 gw 10.20.30.2 Mon Nov 24 17:04:47 2008 us=569828 TCPv4_SERVER link local (bound): [undef]:2607 Mon Nov 24 17:04:47 2008 us=569840 TCPv4_SERVER link remote: [undef] Mon Nov 24 17:04:47 2008 us=569945 IFCONFIG POOL: base=10.20.30.4 size=62 Mon Nov 24 17:34:36 2008 us=308465 Re-using SSL/TLS context Mon Nov 24 17:34:36 2008 us=308529 LZO compression initialized Mon Nov 24 17:34:36 2008 us=308891 Local Options String: 'V4,dev-type tun,link-mtu 1544,tun-mtu 1500,proto TCPv4_SERVER,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-server' Mon Nov 24 17:34:36 2008 us=308904 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1544,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,cipher BF-CBC,auth SHA1,keysize 128,key-method 2,tls-client' Mon Nov 24 17:34:40 2008 us=192702 david/w.x.y.z:53395 MULTI: Learn: 10.20.30.6 -> david/w.x.y.z:53395 Mon Nov 24 17:34:40 2008 us=192717 david/w.x.y.z:53395 MULTI: primary virtual IP for david/w.x.y.z:53395: 10.20.30.6 Mon Nov 24 17:34:41 2008 us=125986 david/w.x.y.z:53395 PUSH: Received control message: 'PUSH_REQUEST' Mon Nov 24 17:34:41 2008 us=126121 david/w.x.y.z:53395 SENT CONTROL [david]: 'PUSH_REPLY,route 10.20.30.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.20.30.6 10.20.30.5' (status=1) Mon Nov 24 17:34:41 2008 us=453138 david/w.x.y.z:53395 Connection reset, restarting [0] Mon Nov 24 17:34:41 2008 us=453177 david/w.x.y.z:53395 SIGUSR1[soft,connection-reset] received, client-instance restarting Mon Nov 24 17:34:41 2008 us=453504 TCP/UDP: Closing socket
EDIT Update:
I added this line to my client config files
route-gateway 10.20.30.1
and this error message appeared in the connection output
hmm? Why does that command fail? it looks fine to me.Code:Mon Nov 24 14:32:45 2008 /sbin/route add -net 0.0.0.0 netmask 128.0.0.0 gw 10.20.30.1 SIOCADDRT: No such process Mon Nov 24 14:32:45 2008 ERROR: Linux route add command failed: external program exited with error status: 7 Mon Nov 24 14:32:45 2008 /sbin/route add -net 128.0.0.0 netmask 128.0.0.0 gw 10.20.30.1 SIOCADDRT: No such process Mon Nov 24 14:32:45 2008 ERROR: Linux route add command failed: external program exited with error status: 7 Mon Nov 24 14:32:45 2008 /sbin/route add -net 10.20.30.0 netmask 255.255.255.0 gw 10.20.30.1 SIOCADDRT: No such process Mon Nov 24 14:32:45 2008 ERROR: Linux route add command failed: external program exited with error status: 7 Mon Nov 24 14:32:45 2008 Initialization Sequence Completed



Adv Reply

Bookmarks