[Xorp-users] Unreachable default route.

Pavlin Radoslavov pavlin at icir.org
Thu Sep 13 17:01:27 PDT 2007


> > You need to install a different type of route in the kernel which I
> > believe in Linux is RTN_UNREACHABLE instead of RTN_BLACKHOLE.
> > However, XORP doesn't support such routes.
> > You could try experimenting with such routes by replacing all
> > references (I counted two references) of RTN_BLACKHOLE with
> > RTN_UNREACHABLE inside file
> > fea/data_plane/fibconfig/fibconfig_entry_set_netlink_socket.cc
> > 
> > This is not the right solution, but allows you to play with such
> > routes.
> 
> Yeah, I figured I could do this..but I am also interested in learning
> how to do it the right way:
> 
> new option for Interface:
>    unreachable: true
> 
> And propagate that through like you do the "discard: true" option currently.
> 
> Is this a major task, or just a few hours of work?
> 
> I'm willing to attempt it assuming it's not horribly complex or requires all new infrastructure.

It could be relatively complex and it could easily take at least a
day or two for someone who is not familiar with all the internals.

To implement it, you need to follow the "discard" interface
mechanism:
 * Start with interfaces.tp and add the new flag and the new XRL.
 * Add the new XRL to xrl/interfaces/fea_ifmgr.xif
 * Add the processing front-end to the FEA
 * Add the processing back-end to the FEA
 * Add the new flag to the generic fea/iftree.hh
 * Update libfeaclient to support and carry the new flag
 * Add the appropriate hooks to the fibconfig backend to set/install
   the RTN_UNREACHABLE routes.

Note that I am skipping a number of important details.

Usually, when I add something like this that goes in parallel with
something similar that already exists, I always do deep search
(case insensitive) for the appropriate keyword. In this case it will
be "discard".

Said that, the simplest thing for you would be to add a bugzilla
entry for this new feature and I will try to implement it when time
allows me.
Sorry, right now I am occupied with the VLAN task and I need to
finish it without sidetracks.


> > Just curious, could you describe your particular scenario you have
> > that requires installing RTN_UNREACHABLE routes.
> 
> Suppose I have a virtual router with subnets A, B, C hanging off of it and no default gateway.
> When I ping through this VR to subnet D, I would like to
> get an ICMP message that says something like 'no route to host', not
> just no response (which can take a while to realize).
> 
> The reason I need a bogus default route (unreachable and/or blackhole) is that
> it appears Linux will try other routing tables if there is no matching route
> in the table you specify.  This basically breaks VRs if you don't have a
> catch-all default route entry because it will try the local routing table and
> may immediately find a destination (that does not go through the virtual
> routes & links.)

I see. Though, if I remember correctly, I believe you could apply
some policies to the multiple route tables to get around this
issue.

In the worst case, if it is really important you could always
install that "unreachable" default route by hand before starting the
virtual XORP instances. Not very elegant solution, but should get
you going :)

Regards,
Pavlin



More information about the Xorp-users mailing list