How do I configure networking to allow certain scripts/users to connect via different network interfaces?
I have a script on my Linode server which makes connections to external (non-Linode) servers. I need these connections to be made via a VPN or Proxy Service (to mask our IP address as well as rotate it periodically). At the same time, all other services on my server need to continue using the regular network interface and our normal public IP.
I signed up for a VPN service, but when I connect the VPN, it (obviously) routes all connections through the new network interface, thereby disconnecting my SSH connection, and blocking any incoming connections that are set up to use my public IP.
I'm guessing I need a way to tell the script to use a specific network interface? Or maybe run the script as a new user that is configured to connect to that interface? And it also seems like I need a way to prevent my VPN service from becoming the default interface when it connects.
I'm open to any suggestions. Thanks in advance for your wisdom and experience! :)
1 Reply
I think the easiest way to do this would be set up a second node for the two types of traffic. You could connect the two with a VPC if they need to communicate with each other privately.
On each node, you could set up the VPC on ETH1 and Public IP on ETH0 and then on one node, try to do add a VPN (which would use ETH0). I didn't test this, so it's just a thought.
You could also potentially use Docker to run a VPN as a container. I think the way the networking works with containers might help you avoid the issue you're seeing, but again, I can't say for sure.
Ultimately, I'm not sure how that works and it might not change the way the VPN ends up working, but I wanted to give you some additional ideas to explore.