All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin A. Brown" <mabrown-lartc@securepipe.com>
To: lartc@vger.kernel.org
Subject: [LARTC] iproute2: gatewayed routes in ancillary tables
Date: Mon, 05 May 2003 17:23:58 +0000	[thread overview]
Message-ID: <marc-lartc-105215601317386@msgid-missing> (raw)

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/

             reply	other threads:[~2003-05-05 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-05 17:23 Martin A. Brown [this message]
2003-05-05 23:04 ` [LARTC] iproute2: gatewayed routes in ancillary tables 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-lartc-105215601317386@msgid-missing \
    --to=mabrown-lartc@securepipe.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.