[Xorp-users] Some help with xorp sintax!

Pavlin Radoslavov pavlin@icir.org
Fri, 21 Oct 2005 09:33:21 -0700


> i did a configuration file matching a static route with an interface 
> following some suggestion on the sintax i had to use.
> My problem is 
> that with this file i am able to specify the interface to use to 
> forward packets through but i don't know the right sintaz to specify 
> also the next-hop address!
> Could somebody help me?
> protocols {
>         
> static {
>         interface-route4 192.168.10.0/24 {
>                 
> next-hop-interface: "eth9"
>                 next-hop-vif: "eth9"
>                 metric:7
>                                 }
>                 }

No, currently the rtrmgr template for interface-routes doesn't allow
you to provide the next-hop router address as well.

To add the syntax for specifying the next-hop router address as well
all you need to do is to modify file etc/templates/static_routes.tp.
At the end of this email there is a patch that adds this syntax for
"interface-route4" (adding same syntax for interface-route6 and
for mrib-interface-route{4,6} would require similar modifications).
With the new syntax, you can use "next-hop-router" to specify the
next-hop-router address for interface-route4 entries.

Please let me know If it works for yor and I will apply the patch to
CVS.

> I have also a second question!
> I am trying to 
> configure a 4 interfaces network adapter.
> One of this interface is 
> configured with a static route by xorp.
> Because all these interfaces 
> are located on the same pc,do i need to export the static route in the 
> rip declaration to make its information available to the rip protocol?

The answer depends on what you want to do with this static route. If
you want to tell the other RIP routers about it, then yes you have
to export it.

Pavlin

----------
Index: static_routes.tp
===================================================================
RCS file: /usr/local/share/doc/apache/cvs/xorp/etc/templates/static_routes.tp,v
retrieving revision 1.25
diff -u -p -r1.25 static_routes.tp
--- static_routes.tp	6 Oct 2005 00:33:56 -0000	1.25
+++ static_routes.tp	21 Oct 2005 16:22:40 -0000
@@ -15,6 +15,7 @@ protocols {
 	interface-route4 @: ipv4net {
 	    next-hop-interface: txt = "";
 	    next-hop-vif:	txt = "";
+	    next-hop-router:	ipv4 = 0.0.0.0;
 	    metric:		u32 = 1;
 	}
 
@@ -133,8 +134,8 @@ protocols {
 	    %help:	short "Configure an interface-based IPv4 static route";
 	    %mandatory:	$(@.next-hop-interface), $(@.next-hop-vif);
 
-	    %activate:	xrl "$(static.targetname)/static_routes/0.1/add_interface_route4?unicast:bool=true&multicast:bool=false&network:ipv4net=$(@)&nexthop:ipv4=0.0.0.0&ifname:txt=$(@.next-hop-interface)&vifname:txt=$(@.next-hop-vif)&metric:u32=$(@.metric)";
-	    %update:	xrl "$(static.targetname)/static_routes/0.1/replace_interface_route4?unicast:bool=true&multicast:bool=false&network:ipv4net=$(@)&nexthop:ipv4=0.0.0.0&ifname:txt=$(@.next-hop-interface)&vifname:txt=$(@.next-hop-vif)&metric:u32=$(@.metric)";
+	    %activate:	xrl "$(static.targetname)/static_routes/0.1/add_interface_route4?unicast:bool=true&multicast:bool=false&network:ipv4net=$(@)&nexthop:ipv4=$(@.next-hop-router)&ifname:txt=$(@.next-hop-interface)&vifname:txt=$(@.next-hop-vif)&metric:u32=$(@.metric)";
+	    %update:	xrl "$(static.targetname)/static_routes/0.1/replace_interface_route4?unicast:bool=true&multicast:bool=false&network:ipv4net=$(@)&nexthop:ipv4=$(@.next-hop-router)&ifname:txt=$(@.next-hop-interface)&vifname:txt=$(@.next-hop-vif)&metric:u32=$(@.metric)";
 	    %delete:	xrl "$(static.targetname)/static_routes/0.1/delete_route4?unicast:bool=true&multicast:bool=false&network:ipv4net=$(@)";
 
 	    next-hop-interface {
@@ -147,6 +148,11 @@ protocols {
 		%set:;
 	    }
 
+	    next-hop-router {
+		%help:	short "Configure the next-hop router";
+		%set:;
+	    }
+
 	    metric {
 		%help:	short "Configure the routing metric";
 		%allow-range: $(@) "1" "65535";

----------