Networking Forums

Networking Forums > Computer Networking > Linux Networking > Routing to multiple gateways from a single NIC

Reply
Thread Tools Display Modes

Routing to multiple gateways from a single NIC

 
 
Eric B.
Guest
Posts: n/a

 
      04-04-2008, 02:40 AM
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.

Any help, advice and/or suggestions would be greatly appreciated.

Thanks!

Eric




 
Reply With Quote
 
 
 
 
Jurgen Haan
Guest
Posts: n/a

 
      04-04-2008, 12:50 PM
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


Using the tool 'ip' you can create priority tables for where to route
which traffic to. I've used this for IP failover, but it should also do
the trick of routing multiple ways.

And instead of trying to route between devices, try routing between subnets.

-R-
 
Reply With Quote
 
Eric B.
Guest
Posts: n/a

 
      04-04-2008, 02:49 PM
"Jurgen Haan" <(E-Mail Removed)> wrote in message
news:47f62414$0$14344$(E-Mail Removed)...
> 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

>
> Using the tool 'ip' you can create priority tables for where to route
> which traffic to. I've used this for IP failover, but it should also do
> the trick of routing multiple ways.
>
> And instead of trying to route between devices, try routing between
> subnets.


I've looked into the 'ip' tool, but to be honest with you, I have had
trouble figuring out how to get it to do what I need. I'm still used to the
2.0 kernel route tools, and not quite comfortable yet with iproute2 tools.

Any suggestions / pointers where I might be able to find examples to help
guide me for this?

Thanks,

Eric



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Jurgen Haan
Guest
Posts: n/a

 
      04-04-2008, 03:00 PM
Eric B. wrote:

>
> I've looked into the 'ip' tool, but to be honest with you, I have had
> trouble figuring out how to get it to do what I need. I'm still used to the
> 2.0 kernel route tools, and not quite comfortable yet with iproute2 tools.
>
> Any suggestions / pointers where I might be able to find examples to help
> guide me for this?
>
> Thanks,
>
> Eric
>
>
>


Try LARTC
http://tldp.org/HOWTO/Adv-Routing-HOWTO/
 
Reply With Quote
 
Eric B.
Guest
Posts: n/a

 
      04-04-2008, 04:04 PM
"Jurgen Haan" <(E-Mail Removed)> wrote in message
news:47f64292$0$14356$(E-Mail Removed)...
> Eric B. wrote:
>
>>
>> I've looked into the 'ip' tool, but to be honest with you, I have had
>> trouble figuring out how to get it to do what I need. I'm still used to
>> the
>> 2.0 kernel route tools, and not quite comfortable yet with iproute2
>> tools.
>>
>> Any suggestions / pointers where I might be able to find examples to help
>> guide me for this?
>>
>> Thanks,
>>
>> Eric
>>
>>
>>

>
> Try LARTC
> http://tldp.org/HOWTO/Adv-Routing-HOWTO/


I have already read through what seemed to be the relevant sections, but
unfortunately, am no further ahead. Specifically, sections 3, 4 and 11, but
from everything I read, they all seem to be pointing to configuration on a
per device basis. Given that eth0:0 is only a virtual device, the ip tool
doesn't seem to like it very much. From what I can tell, it seems as though
I have to mark the packets on the way in from gw1 differently than those
coming in from gw2, and then use the ip route to add different gateways
based on the routing table, but again, I am having trouble understanding how
to do this with a single device only.

Any ideas?

Thanks,

Eric



--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
Andy Furniss
Guest
Posts: n/a

 
      04-13-2008, 10:32 PM
Eric B. wrote:

> I have already read through what seemed to be the relevant sections, but
> unfortunately, am no further ahead. Specifically, sections 3, 4 and 11, but
> from everything I read, they all seem to be pointing to configuration on a
> per device basis. Given that eth0:0 is only a virtual device,


I don't think you could even call it a virtual device. It's just the way
ifconfig let you add secondary addresses to nics. ip just uses what it
calls secondary addresses (though there is a way to add labels that look
like the ifconfig way IIRC)

> the ip tool
> doesn't seem to like it very much. From what I can tell, it seems as though
> I have to mark the packets on the way in from gw1 differently than those
> coming in from gw2, and then use the ip route to add different gateways
> based on the routing table, but again, I am having trouble understanding how
> to do this with a single device only.
>
> Any ideas?


I've never done anything like this. Have a look on

http://www.linux-ip.net

as an alternative to LARTC.

Andy.
 
Reply With Quote
 
Andy Furniss
Guest
Posts: n/a

 
      04-13-2008, 11:42 PM
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple gateways? Troy Windows Networking 3 02-04-2009 05:09 PM
TCP/IP Multiple gateways (different gateways) Windows (NT, 98, 2000, 2003, XP) goonmunster Windows Networking 1 02-26-2007 08:39 AM
TCP/IP Multiple gateways (different gateways) Windows (NT, 98, 2000, 2003, XP) goonmunster Windows Networking 1 02-26-2007 08:39 AM
Using static routes in routing & remote access for multiple gateways. jahyen Windows Networking 1 11-14-2005 01:25 PM
Question on single host with mutiple subnets/gateways Stanoo Chang Linux Networking 4 12-29-2003 01:38 PM



1 2 3 4 5 6 7 8 9 10 11