[Xorp-hackers] Problems when adding a static route

Pavlin Radoslavov pavlin@icir.org
Tue, 18 Jan 2005 13:36:01 -0800


> Whenever I try to add a static route where the nexthop is an IP address 
> for which there is more than one route, I get an error message telling 
> that the route could not be added because the nexthop is not directly 
> connected to the host.
> 
> Well, in my case the route I was trying to add was:
> 
>    10.0.1.1/32 nexthop 10.0.0.4
> 
> and I had the following pre-existing routes:
> 
>    10.0.0.0/24 nexthop 10.0.0.1 (connected)
>    10.0.0.4/32 nexthop 0.0.0.0 (test)
> 
> It seemed to me that the RIB was searching for a route to the nexthop 
> not only in the connected routes, and than it had a match with the 
> second route (which comes from the test protocol) and it though that the 
> desired nexthop was not directly connected. In order to solve this, I 
> changed my test protocol to add every 1-hop route as if it were the 
> connected protocol (just by changing the protocol name parameter in the 
> XRL call). Well, with this changes I had the following routing table:
> 
>    10.0.0.0/24 nexthop 10.0.0.1 (connected)
>    10.0.0.4/32 nexthop 0.0.0.0 (connected)
> 
> But I still get the same error (nexthop is not directly connected). When 
> I don't have the second route in the table, everything goes fine... Does 
> anybody know how to solve this? Am I doing something wrong?

First, I believe that you cannot explicitly add the
directly-connected routes to RIB. Those come from the network
interface information received by RIB from the REA.

To get around the problem, have you tried to use the
rib/0.1/add_interface_route4 XRL to explicitly specify the network
interface name toward the destination. No guarantee it will work,
but you can give it a try.

If this still doesn't work, please include the particular error
messages you receive, so this can help locate the code that rejects
the "add route" command.

Regards,
Pavlin