All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] iproute2: gatewayed routes in ancillary tables
@ 2003-05-05 17:23 Martin A. Brown
  2003-05-05 23:04 ` Julian Anastasov
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Martin A. Brown @ 2003-05-05 17:23 UTC (permalink / raw)
  To: lartc

Hello all,

Tomas Bonnedahl and I recently corresponded about a rather odd behaviour
with routes in ancillary routing tables.

We both receive a "Network is unreachable" error when we try to add
gatewayed routes to ancillary tables and the main routing table does not
contain an entry for the gateway IP.

It seems that unless a route to the gateway IP exists in the main routing
table, I cannot add a route through the gateway IP, even if there is a
route to the destination in the ancillary routing table.

Why is this?

Tomas has used the workaround as described in the annotated example below,
and there is no problem with this solution, but it strikes both of us as a
bit kludgy.

See the annotated example script below.

-Martin

# -- the below set of commands are annotated to describe what
#    is happening
#
# -- empty the ancillary routing table; I chose 4 as an arbitary routing
#    table--it could be any other non-main routing table
#
ip route flush table 4
#
# -- add a route to a locally reachable destination into table 4
#    this command succeeds
#
ip route add 192.168.237.0/24 dev eth0 table 4
#
# -- adding a gatewayed route fails, returning this error message:
#
#   RTNETLINK answers: Network is unreachable
#
ip route add default via 192.168.237.1 table 4
#
# -- even a route to a non-default route....same error:
#
ip route add 192.168.236.0/24 via 192.168.237.1 table 4
#
# -- now, if we put a route for our locally connected network into
#    the main routing table....
#
ip route add 192.168.237.0/24 dev eth0 table main
#
# -- and try to add a gatewayed route to table 4, it works!
#    same with a default route (just another gatewayed route)
#
ip route add 192.168.236.0/24 via 192.168.237.1 table 4
ip route add default via 192.168.237.1 table 4
#
# -- now, if we remove the route from table main,
#    things still operate as we had initially desired
#
ip route del 192.168.237.0/24 dev eth0 table main
#
# -- when we display the routing table it looks exactly like we want
#
ip route show table 4
#
# -- should look like this:
#
#   192.168.236.0/24 via 192.168.237.1 dev eth0
#   192.168.237.0/24 dev eth0  scope link
#   default via 192.168.237.1 dev eth0

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-06 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-05 17:23 [LARTC] iproute2: gatewayed routes in ancillary tables Martin A. Brown
2003-05-05 23:04 ` Julian Anastasov
2003-05-06  3:33 ` Martin A. Brown
2003-05-06  8:58 ` Julian Anastasov
2003-05-06 13:56 ` Martin A. Brown
2003-05-06 14:33 ` Julian Anastasov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.