One PC Two IPs: Use one for VPN client route
Posted: Wed Jun 15, 2016 7:28 am
One VPS ubuntu two IPs. Client connection openvpn to a VPN service elsewhere. Connects OK.
I want to use second IP for VPN connection, leaving first IP and its routing alone. So
1.2.3.4 has default route to internet and must stay. Used for ordinary VPS roles such as email and web pages
5.6.7.8 has new default route via VPN for all exits used for things like TOR.
Services bound/listening to 5.6.7.8 send data via VPN (eg TOR)
I assume at the very least I will have to configure iproute2. Already added to the .ovpn file to route-noexec or the VPN server would push a whole system default route cutting me off from the server. I needed to get control of the routing. Currently the VPN server gives a dynamic IP with each connection to add to the complications of such a setup. It connects but no routes as yet.
Has anyone done this? Attach open VPN client connection to one of two IP and only route traffic of second IP via the VPN? Is there a HOWTO? !
Gerry
I want to use second IP for VPN connection, leaving first IP and its routing alone. So
1.2.3.4 has default route to internet and must stay. Used for ordinary VPS roles such as email and web pages
5.6.7.8 has new default route via VPN for all exits used for things like TOR.
Services bound/listening to 5.6.7.8 send data via VPN (eg TOR)
I assume at the very least I will have to configure iproute2. Already added to the .ovpn file to route-noexec or the VPN server would push a whole system default route cutting me off from the server. I needed to get control of the routing. Currently the VPN server gives a dynamic IP with each connection to add to the complications of such a setup. It connects but no routes as yet.
Has anyone done this? Attach open VPN client connection to one of two IP and only route traffic of second IP via the VPN? Is there a HOWTO? !
Gerry