[Xorp-hackers] Problems when adding a static route

Rafael Paoliello Guimaraes rafael.guimaraes@ac.upc.edu
Thu, 20 Jan 2005 21:27:11 +0100


>>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.

Ok. I was just trying to solve the problem (in a non-elegant way, for 
sure!). I have made a Ctrl+Z in my code and everything is back to normal.

> 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.

What do you mean by this? I am not dealing directly with XRL calls in 
this case. I am trying to add a static route through static_routes. Is 
there anyway to indicate the interface of a static route? The command 
line I am using is:

   create protocol static route4 10.0.1.1/32 nexthop 10.0.0.4

If, instead, you are talking about my routing protocol, all routes it 
adds to the RIB are interface routes (added through 
rib/0.1/add_interface_route4).

> 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.

The error I get is the following:

[ 2005/01/20 19:54:06  INFO xorp_rtrmgr:2123 RTRMGR +1372 task.cc 
run_task ] No more tasks to run
[ 2005/01/20 19:54:06  ERROR xorp_rib:2128 RIB +698 rib.cc add_route ] 
Attempting to add IGP route to table "static" (prefix 10.0.0.1/32 
next-hop 10.0.0.4): no directly connected interface toward the next-hop 
router
[ 2005/01/20 19:54:06 WARNING xorp_rib XrlRibTarget ] Handling method 
for rib/0.1/add_route4 failed: XrlCmdError 102 Command failed Could not 
add IPv4 route net 10.0.0.1/32, nexthop: 10.0.0.4 to unicast RIB
[ 2005/01/20 19:54:06  INFO xorp_rtrmgr:2123 RTRMGR +1372 task.cc 
run_task ] No more tasks to run
[ 2005/01/20 19:54:54  ERROR xorp_rtrmgr:2123 XRL +628 xrl_pf_stcp.cc 
die ] XrlPFSTCPSender died: end of file

Cheers,

===========================================
  Rafael Paoliello Guimaraes
  PhD Student - Computer Networking Group
  Department of Computer Architecture (DAC)
  Polytechnic University of Catalonia (UPC)
  Phone: +34-934017187   Fax: +34-934017055
  URL: http://people.ac.upc.es/rpaoliel
===========================================