multihomed - different gateways

Steffen Kluge kluge at fujitsu.com.au
Fri May 26 04:40:53 UTC 2006


On Thu, 2006-05-25 at 12:08 +0100, Tom Brown wrote:
> On a multihomed box how can i set different gateways for each NIC? 
> Setting them in the ifcfg-ethx does not seem to make any difference to 
> the routing?

The gateway is not an interface but a host property, but must reside on
one of the directly connected IP subnets.

You can have multiple default gateways defined on your box (just keep
adding them with "route add default") and once a gateway has been chosen
for outbound traffic the best suited interface will be picked to get to
it. Which is of course the one that's on the same IP subnet as the
gateway.

This works without further ado if all but one gateways are unreachable
(i.e. a fail-over scenario). To take care of return traffic, your
outbound connections must be masqueraded with the outbound interface's
IP address.

If you want to accept traffic initiated from the outside you need to tie
your services to the interfaces' IP addresses you want the traffic to
come in on. I.e. web server port-forwarded via eth0, mail via eth1, etc.

For anything more elaborate you need to use Linux' advanced routing
capabilities (Manish posted a link), and maybe even be able to inject
routes into the Internet via BGP.

Cheers
Steffen.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060526/2f11ce5a/attachment-0001.sig>


More information about the fedora-list mailing list