VPNNS=srv sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 10.8.5.2 # vpn tunnel local sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 10.10.5.2 # veth local sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 10.10.5.1 # veth other end sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 192.168.0.5 # vpn tunnel other end host ip sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 10.8.5.1 # vpn tunnel other end # below do not work without SNAT on the family computer sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 192.168.0.3 # ping this machine ip passing the traffic through the vpn tunnel sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 192.168.0.1 # overall gateway sudo ip netns exec "vpnns.${VPNNS}" ping -c 1 8.8.8.8 # internet PING 10.8.5.2 (10.8.5.2) 56(84) bytes of data. 64 bytes from 10.8.5.2: icmp_seq=1 ttl=64 time=0.031 ms --- 10.8.5.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.031/0.031/0.031/0.000 ms PING 10.10.5.2 (10.10.5.2) 56(84) bytes of data. 64 bytes from 10.10.5.2: icmp_seq=1 ttl=64 time=0.027 ms --- 10.10.5.2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.027/0.027/0.027/0.000 ms PING 10.10.5.1 (10.10.5.1) 56(84) bytes of data. 64 bytes from 10.10.5.1: icmp_seq=1 ttl=64 time=0.040 ms --- 10.10.5.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.040/0.040/0.040/0.000 ms PING 192.168.0.5 (192.168.0.5) 56(84) bytes of data. 64 bytes from 192.168.0.5: icmp_seq=1 ttl=254 time=0.142 ms --- 192.168.0.5 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.142/0.142/0.142/0.000 ms PING 10.8.5.1 (10.8.5.1) 56(84) bytes of data. 64 bytes from 10.8.5.1: icmp_seq=1 ttl=255 time=0.773 ms --- 10.8.5.1 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.773/0.773/0.773/0.000 ms connect: Network is unreachable connect: Network is unreachable connect: Network is unreachable