LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables and multiple IP adresses on intermet. (https://www.linuxquestions.org/questions/linux-networking-3/iptables-and-multiple-ip-adresses-on-intermet-193992/)

nldev 06-15-2004 09:45 PM

iptables and multiple IP adresses on intermet.
 
Hi!

My isp provides me with 4 static external ip addresses.

I am trying to set up a router using iptables.

I have 2 nics (1 internal and 1 external)

eth0 is external EXTIP1
eth0:1 is EXTIP2
eth0:2 is EXTIP3
eth0:3 is EXTIP4


eth1 is internal INTIP 192.168.0.1


By default i want it to rout all outgoing traffic (internal comunicting out) to route as EXTIP1.

And i also want some computers to be routerd as EXTIP2.EXTIP3.....

My problem is that iptables doesn't support IP alias.

I could solve this by buying 3 more NICs and a new switch, but that would be a little expensive.

And i want for example port 22 on EXTIP1 to be forwarded to 192.168.0.2.
port 22 on EXTIP2 shall be forwarded to 192.168.0.3

After searching the net i have found out that it's possible but i didn't find out how to do it.


Please help.


/Regards Niklas Lönn

ppuru 06-15-2004 10:05 PM

you should be able to achieve this using DNAT

Check www.netfilter.org documentation for more details.

nldev 06-15-2004 10:32 PM

how would that solve the ip alias problem?

/niklas

ppuru 06-15-2004 11:10 PM

http://www.tldp.org/HOWTO/IP-Alias/


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