I have 2 debian boxes and would like to use one of them as a vpn server, and the other as a client. The goal is for the client to access the internet through the server's internet connection. In other words:
client(encrypted packets) ---> ISP1 ----> ISP2 ----> server(decrypts packets) ---->ISP2
and the opposite for responses.
I have setup my TUN devices and can ping across. So this seems to be a routing problem.
client# route -n
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlp1s0
0.0.0.0 0.0.0.0 0.0.0.0 U 1002 0 0 enp2s0
10.0.0.0 10.4.0.1 255.255.255.0 UG 0 0 0 tun1
10.4.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 enp2s0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlp1s0
Obviously, currently internet requests are routed through 192.168.1.1
. However, If I set my Mozilla Firefox's proxy setting to 10.0.0.0
, nothing is accessible. traceroute 10.0.0.0
just shows 1 hop.
server# route -n
0.0.0.0 192.168.0.1 0.0.0.0 UG 202 0 0 eth0
10.0.0.0 10.4.0.2 255.255.255.0 UG 0 0 0 tun1
10.4.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
192.168.0.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
What is missing?