Re: Multiple IP addresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Will Twomey wrote:
I apologize if this is the wrong list, but...

I would like to have several (3?) ip addresses on one interface (eth0,
eth0:1, etc.),

Aliasing your network card isn't necessary.  Just assign IP's to it.

ip address add 192.168.0.1/24 dev eth0
ip address add 192.168.1.1/24 dev eth0
ip address add 192.168.2.1/24 dev eth0

and forward each of those IP addresses to another
interface (192.168.0.1, 192.168.1.1, 192.168.2.1, etc.)

I think these might work.

iptables -A FORWARD -d 192.168.0.0/24 -i eth0 -o eth1 -j ACCEPT
iptables -A FORWARD -d 192.168.1.0/24 -i eth0 -o eth2 -j ACCEPT
iptables -A FORWARD -d 192.168.2.0/24 -i eth0 -o eth3 -j ACCEPT


Does anyone have an advice for me, or a good place to learn how to do this?

If someone has an iptables/netfilter script that does this, I'd love
to see it. :D

Thanks!

--
Will Twomey
http://UnhandledExceptions.com




[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux