Routing to multiple gateways from a single NIC - Networking

This is a discussion on Routing to multiple gateways from a single NIC - Networking ; 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 ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Routing to multiple gateways from a single NIC

  1. Routing to multiple gateways from a single NIC

    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





  2. 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


    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-

  3. Re: Routing to multiple gateways from a single NIC

    "Jurgen Haan" wrote in message
    news:47f62414$0$14344$e4fe514c@news.xs4all.nl...
    > 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


  4. Re: Routing to multiple gateways from a single NIC

    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/

  5. Re: Routing to multiple gateways from a single NIC

    "Jurgen Haan" wrote in message
    news:47f64292$0$14356$e4fe514c@news.xs4all.nl...
    > 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


  6. Re: Routing to multiple gateways from a single NIC

    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.

  7. 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.

+ Reply to Thread