Im trying to make multiple tunnels in the same client, and after a successful connection to the openvpn server I've applied some routes for the tunnels created without success. My first tunnel works but the second one does not. Im doing it like this:
Routes before doing nothing
default 192.168.1.1 0.0.0.0 UG 0 0 0 enp3s0
link-local * 255.255.0.0 U 1000 0 0 enp3s0
192.168.1.0 * 255.255.255.0 U 0 0 0 enp3s0
First tunnel
France.ovpn
client
dev tun
proto udp
remote france.privateinternetaccess.com
lport 1190
resolv-retry infinite
persist-key
persist-tun
cipher aes-128-cbc
auth sha1
tls-client
remote-cert-tls server
auth-user-pass /etc/openvpn/piaauth.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify /etc/openvpn/crl.rsa.2048.pem
ca /etc/openvpn/ca.rsa.2048.crt
disable-occ
lport 1189
rport 1198
|
sudo /usr/sbin/openvpn --config /etc/openvpn/France.ovpn --dev tun0 --route-noexec
sudo route add -net 10.88.10.1 gw 10.88.10.5 netmask 255.255.255.255 dev tun0
sudo route add -net 10.88.10.5 gw * netmask 255.255.255.255 dev tun0
sudo route add -net 128.0.0.0 gw 10.88.10.5 netmask 128.0.0.0 dev tun0
sudo route add -net 172.98.67.121 gw 192.168.1.1 netmask 255.255.255.255 enp3s0
Routes after first tunnel
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 enp3s0
10.88.10.1 10.88.10.5 255.255.255.255 UGH 0 0 0 tun0
10.88.10.5 * 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.88.10.5 128.0.0.0 UG 0 0 0 tun0
link-local * 255.255.0.0 U 1000 0 0 enp3s0
172.98.67.121 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
192.168.1.0 * 255.255.255.0 U 0 0 0 enp3s0
All works perfect
Now I try with this:
Norway.ovpn
client
dev tun
proto udp
remote no.privateinternetaccess.com
resolv-retry infinite
persist-key
persist-tun
cipher aes-128-cbc
auth sha1
tls-client
remote-cert-tls server
auth-user-pass /etc/openvpn/piaauth.txt
comp-lzo
verb 1
reneg-sec 0
crl-verify /etc/openvpn/crl.rsa.2048.pem
ca /etc/openvpn/ca.rsa.2048.crt
disable-occ
lport 1187
rport 1198
sudo /usr/sbin/openvpn --config /etc/openvpn/Norway.ovpn --route-noexec
sudo route add -net 10.39.10.1 gw 10.39.10.5 netmask 255.255.255.255 dev tun1
sudo route add -net 10.39.10.5 gw * netmask 255.255.255.255 dev tun1
sudo route add -net 108.61.123.81 gw 192.168.1.1 netmask 255.255.255.255 enp3s0
Routes now:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 enp3s0
10.39.10.1 10.39.10.5 255.255.255.255 UGH 0 0 0 tun1
10.39.10.5 * 255.255.255.255 UH 0 0 0 tun1
10.8.10.1 10.8.10.5 255.255.255.255 UGH 0 0 0 tun0
10.8.10.5 * 255.255.255.255 UH 0 0 0 tun0
108.61.123.81.c 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
128.0.0.0 10.8.10.5 128.0.0.0 UG 0 0 0 tun0
link-local * 255.255.0.0 U 1000 0 0 enp3s0
172.98.67.121 192.168.1.1 255.255.255.255 UGH 0 0 0 enp3s0
192.168.1.0 * 255.255.255.0 U 0 0 0 enp3s0
And I think that the problem comes after trying to add the last route:
sudo route add -net 128.0.0.0 gw 10.39.10.5 netmask 128.0.0.0 dev tun1
because I used 128.0.0.0 previously with tun0. I tried to change it for something different like 252.0.0.0 or 224.0.0.0 for example but it does not work. And if I try with 128.0.0.0 tun1 works but tun0 does not. What should I do in order to make both tunnels working at the same time?