All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Easiest way to specify the outgoing IP on a VPS with multiple IPs?
My knowledge of nix is minimal (I can usually do/google enough to do basic things like run automated installers, manually go through and modify basic config files, follow guides, etc). My question is essentially the same as what another person posted here: http://www.questionhub.com/ServerFault/128169
Actually, there are two questions:
Q1) If I have a VPS with two or more IPv4 addresses, what is the easiest way to set it up such that if I connect (for the purpose of SSH tunneling) to IP 1, the outgoing IP will be IP 1, that connecting to IP2 will use IP2 as the outgoing IP, etc. For this question, I specifically want to SSH tunnel, not use a VPN.
Q2) What would be the easiest way to achieve the same set up as in Q1, except through (password-protected) SOCKS5 proxies instead of SSH tunneling?
I'm interested in both scenarios because while the setup in #2 would be more convenient (and fine for random surfing), I would presume that #1 is more secure (for example, if I am surfing private data from public wifi).
Thanks for letting me pick your collective nose brains .
Comments
Anyone?
Which distro do you use?
Debian 6 (32-bit) is my preferred default
I don't do much in Debian, so I will not give routing advise, but have you tried iptables nat?
If the service is running on < IP2 >
iptables -t nat -A POSTROUTING -s < IP2 > -j SNAT --to-source < IP2 >
SNAT is the only way
Thanks, FrankZ and joereid. I'll try that command once the second IP is set up on my VPS.
Like everyone said SNAT is the way to go
change main IP in SolusVM?
@FrankZ @joereid @cosmicgate
The command didn't work . IP1 still shows up as the IP when I surf after connecting to the VPS through IP2.
I want to be able to use both IPs.
You can try snat/postrouting by uid:
Then you can connect through SSH/tunnel/etc with proxy1 to use IP1 and proxy2 to use IP2
Thanks, this worked