ESC Hello, Just started using OpenVPN and got stuck with routingSetup is as follows: 1st VPN server (10.8.1.0/24 - pushing routes to 172.20.1.0/24 and 172.20.2.0/24) 2nd VPN server (10.8.3.0/24 - pushing route to 172.20.3.0/24) Client connects to both servers using 2 conf files (dev tun0 and dev tun1 respectively) Issue is that second connection tries to route through 1st server's tun0 instead of tun1 (more definitely in route output below): tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.8.1.10 P-t-P:255.255.255.0 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:12299 errors:0 dropped:0 overruns:0 frame:0 TX packets:13501 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:1297249 (1.2 MiB) TX bytes:832155 (812.6 KiB) tun1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.8.3.10 P-t-P:255.255.255.0 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 255.255.255.0 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 255.255.255.0 0.0.0.0 255.255.255.255 UH 0 0 0 tun1 10.8.3.1 255.255.255.0 255.255.255.255 UGH 0 0 0 tun0 10.8.1.1 255.255.255.0 255.255.255.255 UGH 0 0 0 tun0 193.46.86.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.20.3.0 255.255.255.0 255.255.255.0 UG 0 0 0 tun0 172.20.2.0 255.255.255.0 255.255.255.0 UG 0 0 0 tun0 172.20.1.0 255.255.255.0 255.255.255.0 UG 0 0 0 tun0 192.168.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1 0.0.0.0 193.46.86.250 0.0.0.0 UG 0 0 0 eth0 The way it can be fixed manually: route del -net 172.20.3.0/24 route add -net 172.20.3.0/24 tun1 Is there any way to get proper routes without manual intrusion? I was googling around but did not find an appropriate solution. Thank you
ESC Server 1: port 443 proto tcp dev tun ca ca.crt cert ovpn.crt key ovpn.key # This file should be kept secret dh dh.pem server 10.8.1.0 255.255.255.0 client-config-dir /etc/openvpn/static ifconfig-pool-persist ipp.txt keepalive 10 120 comp-lzo persist-key persist-tun status openvpn-status.log log openvpn.log log-append openvpn.log verb 2 push "route 172.20.1.0 255.255.255.0" push "dhcp-option DNS 8.8.8.8" Server2: port 443 proto tcp dev tun2 ca ca.crt cert ovpn.crt key ovpn.key # This file should be kept secret dh dh.pem server 10.8.3.0 255.255.255.0 client-config-dir /etc/openvpn/static ifconfig-pool-persist ipp.txt keepalive 10 120 comp-lzo persist-key persist-tun status openvpn-status.log log openvpn.log log-append openvpn.log verb 2 push "route 172.20.3.0 255.255.255.0" push "dhcp-option DNS 8.8.8.8" Client's conf1: client dev tun0 proto tcp remote XX.XXX.XX.XXX 443 key zabmon.key cert zabmon.crt resolv-retry infinite nobind persist-key persist-tun ca ca.crt remote-cert-tls server comp-lzo verb 3 Client's conf2: client dev tun1 proto tcp remote YY.YYY.YY.YYY 443 cert zabmon.crt key zabmon.key resolv-retry infinite nobind persist-key persist-tun ca ca.crt remote-cert-tls server comp-lzo verb 3 route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 255.255.255.0 0.0.0.0 255.255.255.255 UH 0 0 0 tun0 255.255.255.0 0.0.0.0 255.255.255.255 UH 0 0 0 tun1 10.8.3.1 255.255.255.0 255.255.255.255 UGH 0 0 0 tun0 10.8.1.1 255.255.255.0 255.255.255.255 UGH 0 0 0 tun0 193.46.86.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 172.20.3.0 255.255.255.0 255.255.255.0 UG 0 0 0 tun0 172.20.1.0 255.255.255.0 255.255.255.0 UG 0 0 0 tun0 192.168.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 1003 0 0 eth1 0.0.0.0 193.46.86.250 0.0.0.0 UG 0 0 0 eth0 Thank you
Traffic ESC wroteServer 1: .. client-config-dir /etc/openvpn/staticESC wroteServer2: .. client-config-dir /etc/openvpn/staticWhat is in your CCD files ?
ESC ifconfig-push 10.8.1.10 255.255.255.0 push "route 172.20.1.0 255.255.255.0" and ifconfig-push 10.8.3.10 255.255.255.0 push "route 172.20.3.0 255.255.255.0"
maikcat your ifconfig-push directives is wrong since you are using openvpn in p2p mode, try to use: ifconfig-push 10.8.1.10 10.8.1.9 Michael.