[Xorp-users] Redistributing the system kernel route table into OSPF

Pavlin Radoslavov pavlin at icir.org
Wed Jul 5 14:02:13 PDT 2006


> I have been working in parallel with Frank to get Xorp to redistribute
> an injected route into OSPF.  I have been able to introduce the route
> using the rip protocols and the "connected" and "static" policies;
> however as stated below the features are not sufficient.  I have the
> latest CVS and the files have been updated with the patch.  I must be
> missing a step but I am not sure what it is any help would be
> appreciated.  Below is an error which comes up on the screen and my
> config.boot file.  If there are any other trouble shooting step that
> you need from me please let me know.<br>

I believe the error you are referring to is:

[ 2006/07/05 02:02:40&nbsp; WARNING xorp_rtrmgr:3707 XrlFinderTarget +406
../xrl/targets/finder_base.cc handle_finder_0_2_resolve_xrl ] Handling
method for finder/0.2/resolve_xrl failed: XrlCmdError 102 Command
failed Xrl does not resolve:
finder://ospfv2/policy_redist6/0.1/add_route6<br>
[ 2006/07/05 02:02:40 WARNING xorp_rib RIB ] Unable to complete XRL:
add_route6 for ospfv2 route: Dst: fe80::/64 Vif: eth0 NextHop: NH:::
Metric: 256 Protocol: fib2mrib PolicyTags: 0<br>

The reason for this error is because all fib2mrib routes (IPv4 and
IPv6) are exported to OSPF, but currently OSPF doesn't support IPv6
(yet).
The simplest thing to do is to ignore those warnings. By looking
into the source code, it appears they should be harmless, and
everything else (IPv4) should continue working.
If you find them annoying, then you can modify your policy so it
doesn't redistribute the IPv6 routes to OSPF. E.g.:

policy {
    policy-statement export_fib2mrib {
        term export {
            from {
                protocol: "fib2mrib"
		network4 <= 0.0.0.0/0
            }
        }
    }
}

If you still don't see the fib2mrib routes introduced into OSPF,
then the problem is somewhere else. Please let us know if this is
the case.

Pavlin

> <br>
> [root at localhost rtrmgr]# ./xorp_rtrmgr -b config.boot<br>
> [ 2006/07/05 02:02:20&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +240
> master_conf_tree.cc execute ] Changed modules: interfaces, fea, rib,
> policy, fib2mrib, ospf4<br>
> [ 2006/07/05 02:02:20&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +99
> module_manager.cc execute ] Executing module: interfaces (fea/xorp_fea)<br>
> [ 2006/07/05 02:02:21 INFO xorp_fea MFEA ] MFEA enabled<br>
> [ 2006/07/05 02:02:21 INFO xorp_fea MFEA ] CLI enabled<br>
> [ 2006/07/05 02:02:21 INFO xorp_fea MFEA ] CLI started<br>
> [ 2006/07/05 02:02:21 INFO xorp_fea MFEA ] MFEA enabled<br>
> [ 2006/07/05 02:02:21 INFO xorp_fea MFEA ] CLI enabled<br>
> [ 2006/07/05 02:02:21 INFO xorp_fea MFEA ] CLI started<br>
> [ 2006/07/05 02:02:22&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +99
> module_manager.cc execute ] Executing module: fea (fea/xorp_fea)<br>
> [ 2006/07/05 02:02:28&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +99
> module_manager.cc execute ] Executing module: rib (rib/xorp_rib)<br>
> [ 2006/07/05 02:02:30&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +99
> module_manager.cc execute ] Executing module: policy
> (policy/xorp_policy)<br>
> [ 2006/07/05 02:02:32&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +99
> module_manager.cc execute ] Executing module: fib2mrib
> (fib2mrib/xorp_fib2mrib)<br>
> [ 2006/07/05 02:02:34&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +99
> module_manager.cc execute ] Executing module: ospf4 (ospf/xorp_ospfv2)<br>
> [ 2006/07/05 02:02:36&nbsp; INFO xorp_rtrmgr:3707 RTRMGR +2228 task.cc
> run_task ] No more tasks to run<br>
> [ 2006/07/05 02:02:40&nbsp; WARNING xorp_rtrmgr:3707 XrlFinderTarget +406
> ../xrl/targets/finder_base.cc handle_finder_0_2_resolve_xrl ] Handling
> method for finder/0.2/resolve_xrl failed: XrlCmdError 102 Command
> failed Xrl does not resolve:
> finder://ospfv2/policy_redist6/0.1/add_route6<br>
> [ 2006/07/05 02:02:40 WARNING xorp_rib RIB ] Unable to complete XRL:
> add_route6 for ospfv2 route: Dst: fe80::/64 Vif: eth0 NextHop: NH:::
> Metric: 256 Protocol: fib2mrib PolicyTags: 0<br>
> [ 2006/07/05 02:02:40&nbsp; WARNING xorp_rtrmgr:3707 XrlFinderTarget +406
> ../xrl/targets/finder_base.cc handle_finder_0_2_resolve_xrl ] Handling
> method for finder/0.2/resolve_xrl failed: XrlCmdError 102 Command
> failed Xrl does not resolve:
> finder://ospfv2/policy_redist6/0.1/delete_route6<br>
> [ 2006/07/05 02:02:40 WARNING xorp_rib RIB ] Unable to complete XRL:
> del_route6 for ospfv2 route: Dst: fe80::/64 Vif: eth0 NextHop: NH:::
> Metric: 256 Protocol: fib2mrib PolicyTags: 0<br>
> [ 2006/07/05 02:02:40&nbsp; WARNING xorp_rtrmgr:3707 XrlFinderTarget +406
> ../xrl/targets/finder_base.cc handle_finder_0_2_resolve_xrl ] Handling
> method for finder/0.2/resolve_xrl failed: XrlCmdError 102 Command
> failed Xrl does not resolve:
> finder://ospfv2/policy_redist6/0.1/add_route6<br>
> [ 2006/07/05 02:02:40 WARNING xorp_rib RIB ] Unable to complete XRL:
> add_route6 for ospfv2 route: Dst: fe80::/64 Vif: ath0 NextHop: NH:::
> Metric: 256 Protocol: fib2mrib PolicyTags: 0<br>
> <br>
> /* $XORP: xorp/rtrmgr/config.boot 2006/06 use xorp to be a gateway
> computer */<br>
> <br>
> interfaces {<br>
> &nbsp;&nbsp;&nbsp; interface eth0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; description: "wired side"<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vif eth0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; address 172.25.2.34 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; prefix-length: 28<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; broadcast: 172.25.2.47<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; disable: false<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; interface ath0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; description: "wireless"<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vif ath0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; address 172.26.2.252 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; prefix-length: 24<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; broadcast: 172.26.2.255<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; disable: false<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; }<br>
> }<br>
> <br>
> fea {<br>
> &nbsp;&nbsp;&nbsp; unicast-forwarding4 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; disable: false<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> }<br>
> <br>
> protocols {<br>
> &nbsp;&nbsp;&nbsp; fib2mrib {<br>
> &nbsp;&nbsp;&nbsp; disable: false<br>
> &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; ospf4 {<br>
> &nbsp;&nbsp;&nbsp; export: "export_fib2mrib"<br>
> &nbsp;&nbsp;&nbsp; router-id: 172.25.2.34<br>
> &nbsp;&nbsp;&nbsp; ip-router-alert: false<br>
> &nbsp;&nbsp;&nbsp; area 0.0.0.0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; area-type: "normal"<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; interface eth0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vif eth0 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; address 172.25.2.34 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; priority: 128<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; hello-interval: 10<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; router-dead-interval: 40<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; interface-cost: 1<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; retransmit-interval: 5<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; transit-delay: 1<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; passive: false<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; neighbor 172.25.2.33 {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; router-id 172.25.2.33<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; disable: false<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; }<br>
> &nbsp; }<br>
> }<br>
> <br>
> policy {<br>
> &nbsp;&nbsp;&nbsp; policy-statement export_fib2mrib {<br>
> &nbsp;&nbsp;&nbsp; term export {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; from {<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protocol: "fib2mrib"<br>
> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; }<br>
> &nbsp;&nbsp;&nbsp; }<br>
> }<br>
> <br>
> Thank you for your time<br>
> Neil Fenwick<br>
> <br>
> Pavlin Radoslavov wrote:
> <blockquote cite="mid200604111735.k3BHZl6r034075 at possum.icir.org"
>  type="cite">
>   <blockquote type="cite">
>     <pre wrap="">I am a new user to XORP and I am attempting to redistribute the system
> kernel route table into XORP OSPF.  I see redistribution support for
> connected and static routes, but not for the kernel route table, as is
> available in Quagga.  In my case, the system kernel route table is being
> written by another routing protocol (Optimized Link State Routing) into
> which XORP has no visibility.  The "connected" and "static" features are not
> sufficient to satisfy my objectives.
>     </pre>
>   </blockquote>
>   <pre wrap=""><!---->
> You won't be able to do this out-of-the-box, but there is a
> semi-hackish way around it. The basic idea is to use the fib2mrib
> module in XORP.
> That module typically is used to snoop the unicast routes from the
> kernel so they can be used for multicast purpose (the Reverse Path
> Forwarding check in PIM-SM). In your case you will redistribute them
> to OSPF.
> 
> 1. Get the latest XORP code from the anonymous CVS, and make sure
>    that file xrl/targets/fib2mrib_base.hh is ref. 1.12 (at least).
>    The instructions for the anonymous CVS access are available from
>    <a class="moz-txt-link-freetext" href="http://www.xorp.org/cvs.html">http://www.xorp.org/cvs.html</a>
> 
> 2. Apply the patch at the end of this email to the checked-out code.
>    Basically, this patch adds the necessary hooks to the
>    etc/templates/policy.tp and etc/templats/fib2mrib.tp so fib2mrib
>    can be used as part of the policy framework.
>    Also, it adds a hack to ospf/xrl_target.cc so OSPF will accept
>    the routes that would come from fib2mrib. If you want to export
>    the fib2mrib routes to some other protocol (BGP or RIP), then you
>    may have to apply a similar hack to the particular protocol.
> 
> 3. You can export the fib2mrib routes by using the following in your
>    XORP configuration:
> 
> policy {
>     policy-statement export_fib2mrib {
>         term export {
>             from {
>                 protocol: "fib2mrib"
>             }
>         }
>     }
> }
> 
> protocols {
>     ospf4 {
>         export: "export_fib2mrib"
> 	....
>     }
> }
> 
> protocols {
>     fib2mrib {
>         disable: false
>     }
> }
> 
> FYI, I tried the above mechanism, and it appears to work for me, but
> please let me know if you run into some issues.
> 
> Pavlin
> 
> Index: etc/templates/fib2mrib.tp
> ===================================================================
> RCS file: /usr/local/share/doc/apache/cvs/xorp/etc/templates/fib2mrib.tp,v
> retrieving revision 1.10
> diff -u -p -r1.10 fib2mrib.tp
> --- etc/templates/fib2mrib.tp	22 Feb 2006 02:26:10 -0000	1.10
> +++ etc/templates/fib2mrib.tp	11 Apr 2006 17:10:58 -0000
> @@ -8,11 +8,22 @@ protocols {
>      }
>  }
>  
> +policy {
> +    policy-statement @: txt {
> +	term @: txt {
> +	    from {
> +		metric: u32range;
> +	    }
> +	}
> +    }
> +}
> +
>  protocols {
>      fib2mrib {
>  	%help:		short		"Configure the FIB2MRIB module";
>  	%modinfo:	provides	fib2mrib;
>  	%modinfo:	depends		rib;
> +	%modinfo:	depends		policy;
>  	%modinfo:	path		"fib2mrib/xorp_fib2mrib";
>  	%modinfo:	default_targetname "fib2mrib";
>  	%modinfo:	status_method	xrl "$(fib2mrib.targetname)/common/0.1/get_status-&gt;status:u32&amp;reason:txt";
> @@ -43,3 +54,21 @@ protocols {
>  	}
>      }
>  }
> +
> +policy {
> +    %create: xrl "$(policy.targetname)/policy/0.1/set_proto_target?protocol:txt=fib2mrib&amp;target:txt=fib2mrib";
> +    %create: xrl "$(policy.targetname)/policy/0.1/add_varmap?protocol:txt=fib2mrib&amp;variable:txt=network4&amp;type:txt=ipv4net&amp;access:txt=r&amp;id:u32=10";
> +    %create: xrl "$(policy.targetname)/policy/0.1/add_varmap?protocol:txt=fib2mrib&amp;variable:txt=metric&amp;type:txt=u32&amp;access:txt=rw&amp;id:u32=14";
> +
> +    policy-statement @: txt {
> +	term @: txt {
> +	    from {
> +		metric {
> +		    %help: short "Set the metric value";
> +		    %set: xrl "$(policy.targetname)/policy/0.1/update_term_block?policy:txt=$(policy-statement.@)&amp;term:txt=$(term.@)&amp;block:u32=0&amp;order:txt=$(#)&amp;statement:txt=metric $(&lt;&gt;) $(@);";
> +		    %delete: xrl <a class="moz-txt-link-rfc2396E" href="mailto:$(policy.targetname)/policy/0.1/update_term_block?policy:txt=$(policy-statement.@)&term:txt=$(term.@)&block:u32=0&order:txt=$(#)&statement:txt=">"$(policy.targetname)/policy/0.1/update_term_block?policy:txt=$(policy-statement.@)&amp;term:txt=$(term.@)&amp;block:u32=0&amp;order:txt=$(#)&amp;statement:txt="</a>;
> +		}
> +	    }
> +	}
> +    }
> +}
> Index: etc/templates/policy.tp
> ===================================================================
> RCS file: /usr/local/share/doc/apache/cvs/xorp/etc/templates/policy.tp,v
> retrieving revision 1.20
> diff -u -p -r1.20 policy.tp
> --- etc/templates/policy.tp	3 Apr 2006 23:35:14 -0000	1.20
> +++ etc/templates/policy.tp	11 Apr 2006 17:10:58 -0000
> @@ -73,6 +73,7 @@ policy {
>  		    %help: short "Protocol from which route was learned";
>  		    %allow: $(@) "bgp" %help: "BGP routes";
>  		    %allow: $(@) "connected" %help: "Directly connected sub-network routes";
> +		    %allow: $(@) "fib2mrib" %help: "FIB2MRIB routes";
>  		    %allow: $(@) "ospf4" %help: "OSPF IPv4 routes";
>  		    %allow: $(@) "rip" %help: "RIP routes";
>  		    %allow: $(@) "ripng" %help: "RIPng routes";
> Index: ospf/xrl_target.cc
> ===================================================================
> RCS file: /usr/local/share/doc/apache/cvs/xorp/ospf/xrl_target.cc,v
> retrieving revision 1.36
> diff -u -p -r1.36 xrl_target.cc
> --- ospf/xrl_target.cc	28 Mar 2006 03:06:55 -0000	1.36
> +++ ospf/xrl_target.cc	11 Apr 2006 17:10:59 -0000
> @@ -278,8 +278,10 @@ XrlOspfV2Target::policy_redist4_0_1_add_
>  	      cstring(network), cstring(nexthop), pb(unicast), pb(multicast),
>  	      metric);
>  
> +#if 0
>      if (!unicast)
>  	return XrlCmdError::OKAY();
> +#endif
>  
>      if (!_ospf.originate_route(network, nexthop, metric, policytags)) {
>  	return XrlCmdError::COMMAND_FAILED("Network: " + network.str());
> @@ -296,8 +298,10 @@ XrlOspfV2Target::policy_redist4_0_1_dele
>      debug_msg("Net: %s Unicast: %s Multicast %s\n",
>  	      cstring(network), pb(unicast), pb(multicast));
>  
> +#if 0
>      if (!unicast)
>  	return XrlCmdError::OKAY();
> +#endif
>  
>      if (!_ospf.withdraw_route(network)) {
>  	return XrlCmdError::COMMAND_FAILED("Network: " + network.str());
> 
> _______________________________________________
> Xorp-users mailing list
> <a class="moz-txt-link-abbreviated" href="mailto:Xorp-users at xorp.org">Xorp-users at xorp.org</a>
> <a class="moz-txt-link-freetext" href="http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users">http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users</a>
> 
> 
>   </pre>
> </blockquote>
> </body>
> </html>
> 
> 
> --===============2002765754==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
> 
> _______________________________________________
> Xorp-users mailing list
> Xorp-users at xorp.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-users
> 
> --===============2002765754==--



More information about the Xorp-users mailing list