Hello all,
I am trying to set up my laptop at home to use a openvpn server that I (try to) set up on a cheap VPS I rent. The goal is to route all internet traffic of the client through my VPS. The laptop is connected to a DSL modem/router via wifi, handled by KDE network manager's GUI.
Despite my poor understanding of networking shenanigans, after a few tutorials and wiki pages, this is /etc/openvpn/server.conf on my server:
dev tun0
ifconfig 10.9.8.1 10.9.8.2
secret /etc/openvpn/static.key
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
and /etc/openvpn/client.conf on the client:
remote mydomainname.tld
dev tun0
ifconfig 10.9.8.2 10.9.8.1
secret /etc/openvpn/static.key
redirect-gateway def1
Once I systemctl start openvpn@client on my laptop, I believe I am on the right track because I can ping 10.9.8.1 and .2 from both the VPS and my laptop. I can also SSH into my laptop from the VPS by using ssh 10.9.8.2, which is what I expect to happen. Now the problem is that I cannot reach anything but the VPS once I am on the laptop. Illustration:
nicoco@vps ~> ssh 10.9.8.2
Linux laptop 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64
[...]
nicoco@laptop ~> ping 10.9.8.1
PING 10.9.8.1 (10.9.8.1) 56(84) bytes of data.
64 bytes from 10.9.8.1: icmp_seq=1 ttl=64 time=44.8 ms
[...]
nicoco@laptop ~> ping mydomainname.tld
PING nicoco.fr (213.32.90.179) 56(84) bytes of data.
64 bytes from 179.ip-213-32-90.eu (213.32.90.179): icmp_seq=1 ttl=51 time=36.5 ms
[...]
nicoco@laptop ~> ping google.fr
PING google.fr (172.217.19.227) 56(84) bytes of data.
[NOPE]
nicoco@laptop ~> netstat -rn
Table de routage IP du noyau
Destination Passerelle Genmask Indic MSS FenĂȘtre irtt Iface
0.0.0.0 10.9.8.1 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
10.9.8.1 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
128.0.0.0 10.9.8.1 128.0.0.0 UG 0 0 0 tun0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
my.vps.ip.1 192.168.1.1 255.255.255.255 UGH 0 0 0 wlan0
I tried to keep it short, I hope what I did wrong is obvious to the community.
Thanks for helping a noob!