Group: comp.os.linux.networking
From: Andy Furniss
Date: Sunday, April 13, 2008 6:42 PM
Subject: Re: Routing to multiple gateways from a single NIC

Eric B. wrote:
> Hi,
>
> I've got a computer running RHEL with a single NIC that is multi-homed with
> a single default gateway for everything.
> eth0: 192.168.101.54/24
> eth0:0 192.168.104.54/24
>
> So far, everything is running fine. The machine is able to respond to
> requests coming in to 101.54 and 104.54 without any problems.
>
> However, I have now reached a situation where I need to route my response
> packets to 2 different gateways, based on where the packets came in from.
> All packets that came in to eth0 have to be routed out via gateway1 and all
> packets that came in on eth0:0 have to be routed via gateway2.
>
> How can I accomplish this? I've tried reading the lartc howto for routing
> for multiple uplinks/providers, but it doesn't seem to address my issue.
> The howto for split access seems to require 2 independent NICs. When I try
> to follow the instructions, the ip route add command complains that it
> doesn't recognize eth0:0 as a valid interface.
>
> Is there any thing I can do? Can anyone point me to the right place to look
> for this? I'm assuming that it shouldn't be too difficult to configure the
> system to respond differently based on the incoming address, but not quite
> sure how to approach the situation.

I am unsure of your setup - if this box is the default gateway for
others then the addresses on your nic won't be involved - just the mac
address which will be the same as you only have one nic. I guess you
will need to use the source address of the incoming packet to tell where
it came from.

Andy.

Safety Articles | Usenet Groups | Usenet News | Bluegrass