LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to force server to open connections via eth0:0 not eth0 ? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-force-server-to-open-connections-via-eth0-0-not-eth0-792934/)

Spacedust2 03-03-2010 01:39 PM

How to force server to open connections via eth0:0 not eth0 ?
 
Hello!

I got two IP's in my dedicated server.

Both are external IP's.

I would like to make connections using 2nd IP address under eth0:0 interface.

For example: when using "lynx whatismyip.com" should display my 2nd IP.

How to do this using iptables ?

Spacedust2 03-03-2010 01:55 PM

I found it:

Code:

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source <new_IP>


All times are GMT -5. The time now is 11:43 AM.