LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Randomizing or Changing output IP (https://www.linuxquestions.org/questions/linux-networking-3/randomizing-or-changing-output-ip-805971/)

guigos 05-04-2010 08:14 PM

Randomizing or Changing output IP
 
Hello folks, i'm kinda new on this, so i would like some help to solve this:

I have a proxy tunnel server which the client connects trough SOCKS protocol, for ex: he opens a ssh window "ssh -D 1070 server.com" and set his connection to SOCKS v5 on 127.0.0.1:1070.

My server is a VPN, and i have some external IPS set as virtual interfaces, like this:

net0 - 127.0.0.1
net0:0 - externalip1
net0:1 - externalip2

So thats the deal: I want that, when someone uses the proxy, the external ip the persons gets to be random, not always externalip1! Or... if he uses externalip2 to connect on ssh, his externalip should be externalip2. I don't want every user with the same external IP.

Thanks since now, hope I can do it :study:

guigos 05-04-2010 10:26 PM

Ok, I've just solved... googled a little. For future references, for ones who might need:

iptables -A POSTROUTING -t nat - j SNAT --to externalip1-externalip150

this will choose randomly a ip betwen the 1 and the 150 to realize the conections.


All times are GMT -5. The time now is 10:30 AM.