[LUAU] IP Routing

Clifton Royston cliftonr at iandicomputing.com
Mon Jun 29 13:17:10 PDT 2009


[Resending... previous post apparently got lost]

On Sun, Jun 28, 2009 at 09:42:02AM -1000, Camron W. Fox wrote:
> Alle,
> 
> 	I have what I thought was a fairly straightforward answer to this 
> 	but now I'm not so sure.
> 	Say you have a HOSTA with four interfaces on four different networks:
> 
> eth0 (HOSTA-0) - 10.1.0.0
> eth1 (HOSTA-1) - 10.2.0.0
> eth2 (HOSTA-2) - 10.3.0.0
> eth3 (HOSTA-3) - 10.4.0.0
> 
> 	The default route for HOSTA is 10.1.0.1. It is clear that access to 
> HOSTA from anyone of the listed networks would come in and go out the 
> same interface, i.e. traffic from HOSTB @ 10.1.0.100 goes in and out of 
> HOSTA-0 via eth0.
> 	If you are on a different network than exists on the interfaces, say 
> 10.5.0.0, traffic from HOSTC @ 10.5.0.100 goes in any interface but will 
> always go out via the default route on eth0.
> 	So the question is, is there anyway to make traffic from HOSTC go in 
> and out the same interface like HOSTA-3?
> 
> Best Regards,
> Camron

  First, terminology: it appears you are saying you always want traffic
to HOSTC to go via a specific interface.  That would be a static route
to HOSTC.

  To accomplish this, you would set a static route to either HOSTC or
perhaps (depending) the network it resides on, *via* the interface you
want it to go back through, i.e. eth3/HOSTA-3.  If you know that
there's a router on the HOSTA-3 network 10.4.0.0 by which you can reach
HOSTC, perhaps 10.4.0.1, then you'd set the static route for HOSTC
(10.5.0.100) or Network C (10.5.0.0/16) to be that router's address. On
a *BSD that would be something like
  "route add -net 10.5.0.0 netmask 255.255.0.0 10.4.0.1"

  If that's what you want, you'd be done at that point (well, once you
set that to happen at server boot time.)  In theory you can set that
route to the HOSTA-3 interface instead, but that's a little sketchy;
you really would prefer your host know what router it's trying to reach
with it, so that it can send its packets for that network specifically
via the MAC address (layer 2) of the router it's expecting to send them
on and can know if the router's down.

  Now what if the router, or network layout, were to move so that HOSTC
now reaches you from eth2?  You'll go on blindly trying to reach it via
eth3 and it will never get there.

  Well, that's where you start to see the benefits of dynamic routing. 
If you're running a routing daemon on HOSTA, communicating with the
routers on the network via a standard protocol such as OSPF, then it
will *know* when the route moves and will go on reaching HOSTC via
whatever the appropriate interface is.  The downside is that the
administration of dynamic routing is significantly harder, and if you
accidentally start broadcasting routes instead of just listening to
them, you have the potential to really screw up your whole network not
just your one host.

  Hope this helps; if not, Tony has offered to help and he's an
outstanding routing expert.

  -- Clifton (former LavaNet systems guy)

-- 
    Clifton Royston  --  cliftonr at iandicomputing.com / cliftonr at lava.net
       President  - I and I Computing * http://www.iandicomputing.com/
 Custom programming, network design, systems and network consulting services



More information about the LUAU mailing list