3
2
So I have a server with the public ip address of 101.102.103.104 (for example). This server is running an openvpn server, plus a bunch of other stuff that is listening on the public ip network device ports.
What I want to do is once connecting to 101.102.103.104, route all future traffic to this IP via the VPN.
So for example if I curl
101.102.103.104:8080 it goes via the VPN connection.
I've tried adding a push route
to my server.conf like so:
push "route 101.102.103.104 255.255.255.255"
and I even tried adding an exclusion route:
push "route 101.102.103.104 255.255.255.255 net_gateway"
but I didn't seem to work. running sudo route -n
still showed the route going via my home router:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
10.8.0.1 10.8.0.5 255.255.255.255 UGH 0 0 0 tun0
10.8.0.5 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
101.102.103.104 192.168.1.1 255.255.255.255 UGH 0 0 0 wlan0
192.168.1.0 0.0.0.0 255.255.255.0 U 9 0 0 wlan0
Any thoughts on how I can accomplish this? I figured the problem was likely the fact that I'm trying to route traffic to the vpn server itself, via the vpn server, and thus forming some sort of infinite loop, but that's just a guess.