[Novalug] multihomed linux router with public ip addresses
Nick Danger
nick@hackermonkey.com
Tue Apr 27 11:50:33 EDT 2010
On 04/27/2010 10:25 AM, Miguel González Castaños wrote:
> But how? If you use two IPs of the same subnet in the linux router, you
> get two routes in the routing table for that subnet that are forwarded
> to different interfaces. It's what I said in my first message. Let's say
>
> eth2 - 80.35.2.3 - facing to the Internet
>
> eth0 - 10.30.1.1
>
> eth1 - 80.35.2.2
>
> if you run netstat -rn you get two routes for 80.35.2.0 that are routed
> to eth2 and eth1
You CAN have two interfaces in the same network. IE:
[me@chimay ~]$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window rtt iface
xxx.yyy.64.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
xxx.yyy.64.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
0.0.0.0 xxx.yyy.64.1 0.0.0.0 UG 0 0 0 eth0
[me@chimay ~]$
Packets by default head out the lowest interface, eth0. I have a few
rulesets to force some out eth1. And some very complicated iptables rules.
Nick
More information about the Novalug
mailing list