fix for RtConfig Cisco address-family syntax

S.P.Zeidler spz at serpens.de
Sun Aug 3 22:45:06 UTC 2008


Hi,

there's two problems with the Cisco BGP config RtConfig produces at
present, which Daryl Collins <daryl at internode.com.au> brought to my
attention:

- IOS wants the address family specified without the dot, ie not
  "address-family ipv4.unicast" but "address-family ipv4 unicast"

- if you have an ipv6 only peer, you need to tell your Cisco that this BGP
  session is not doing the default, namely ipv4 unicast
  One could tell the Cisco not to assume a default,
  "no bgp default ipv4-unicast", but the less invasive change to RtConfig
  just disables ipv4 per session (as RtConfig assumes a default of
  ipv4.unicast too).

--- src/RtConfig/f_cisco.cc.orig        2007-01-23 01:45:16.000000000 +0100
+++ src/RtConfig/f_cisco.cc
@@ -1246,8 +1246,28 @@ bool CiscoConfig::printNeighbor(int impo
      cout << " neighbor "   << neighbor << " remote-as " << peerAS << "\n";
 
    if (afi_activate && !peerGroup) {
-     cout << " address-family " << (AddressFamily &) *filter_afi << endl;
-     cout << indent <<" neighbor " << neighbor << " activate\n"; 
+     if (strcmp(filter_afi->name(),"ipv6") == 0) {
+       cout << " address-family " << "ipv4" << endl;
+       cout << indent <<" no neighbor " << neighbor << " activate\n"; 
+       cout << " address-family " << "ipv6 unicast" << endl;
+       cout << indent <<" neighbor " << neighbor << " activate\n"; 
+       cout << " address-family " << "ipv6 multicast" << endl;
+       cout << indent <<" neighbor " << neighbor << " activate\n"; 
+     } else if (strcmp(filter_afi->name(),"ipv6.unicast") == 0) {
+       cout << " address-family " << "ipv4" << endl;
+       cout << indent <<" no neighbor " << neighbor << " activate\n"; 
+       cout << " address-family " << "ipv6 unicast" << endl;
+       cout << indent <<" neighbor " << neighbor << " activate\n"; 
+     } else if (strcmp(filter_afi->name(),"ipv4.multicast") == 0) {
+       cout << " address-family " << "ipv4 multicast" << endl;
+       cout << indent <<" neighbor " << neighbor << " activate\n"; 
+     } else if (strcmp(filter_afi->name(),"ipv6.multicast") == 0) {
+       cout << " address-family " << "ipv4" << endl;
+       cout << indent <<" no neighbor " << neighbor << " activate\n"; 
+       cout << " address-family " << "ipv6 multicast" << endl;
+       cout << indent <<" neighbor " << neighbor << " activate\n"; 
+     }
+     // ought to handle afi any too, but that's not just done by naming it here
    }
 
    if (routeMapGenerated) 
--------------------------------------------------------------------

regards,
	spz
-- 
spz at serpens.de (S.P.Zeidler)


More information about the irrtoolset mailing list