From 2bfcc9540ddbf1e0c0151cd12ca6424606934678 Mon Sep 17 00:00:00 2001 From: Martin Winter Date: Thu, 6 Sep 2018 17:15:19 -0700 Subject: [PATCH] pick ospf6 router-id syntax based on version Signed-off-by: Martin Winter --- all-protocol-startup/r1/ospf6d.conf-pre-v4 | 16 ++++++++++ .../test_all_protocol_startup.py | 5 ++- ospf-topo1/r1/ospf6d.conf-pre-v4 | 9 ++++++ ospf-topo1/r2/ospf6d.conf-pre-v4 | 9 ++++++ ospf-topo1/r3/ospf6d.conf-pre-v4 | 10 ++++++ ospf-topo1/r4/ospf6d.conf-pre-v4 | 9 ++++++ ospf-topo1/test_ospf_topo1.py | 6 +++- ospf6-topo1/r1/ospf6d.conf-pre-v4 | 27 ++++++++++++++++ ospf6-topo1/r2/ospf6d.conf-pre-v4 | 27 ++++++++++++++++ ospf6-topo1/r3/ospf6d.conf-pre-v4 | 31 +++++++++++++++++++ ospf6-topo1/r4/ospf6d.conf-pre-v4 | 27 ++++++++++++++++ ospf6-topo1/test_ospf6_topo1.py | 6 +++- 12 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 all-protocol-startup/r1/ospf6d.conf-pre-v4 create mode 100644 ospf-topo1/r1/ospf6d.conf-pre-v4 create mode 100644 ospf-topo1/r2/ospf6d.conf-pre-v4 create mode 100644 ospf-topo1/r3/ospf6d.conf-pre-v4 create mode 100644 ospf-topo1/r4/ospf6d.conf-pre-v4 create mode 100644 ospf6-topo1/r1/ospf6d.conf-pre-v4 create mode 100644 ospf6-topo1/r2/ospf6d.conf-pre-v4 create mode 100644 ospf6-topo1/r3/ospf6d.conf-pre-v4 create mode 100644 ospf6-topo1/r4/ospf6d.conf-pre-v4 diff --git a/all-protocol-startup/r1/ospf6d.conf-pre-v4 b/all-protocol-startup/r1/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..6d870f3 --- /dev/null +++ b/all-protocol-startup/r1/ospf6d.conf-pre-v4 @@ -0,0 +1,16 @@ +log file ospf6d.log +! +debug ospf6 lsa unknown +debug ospf6 zebra +debug ospf6 interface +debug ospf6 neighbor +! +interface r1-eth4 +! +router ospf6 + router-id 192.168.0.1 + log-adjacency-changes + interface r1-eth4 area 0.0.0.0 +! +line vty +! diff --git a/all-protocol-startup/test_all_protocol_startup.py b/all-protocol-startup/test_all_protocol_startup.py index c56c2c8..fb2100e 100755 --- a/all-protocol-startup/test_all_protocol_startup.py +++ b/all-protocol-startup/test_all_protocol_startup.py @@ -111,7 +111,10 @@ def setup_module(module): net['r%s' % i].loadConf('ripd', '%s/r%s/ripd.conf' % (thisDir, i)) net['r%s' % i].loadConf('ripngd', '%s/r%s/ripngd.conf' % (thisDir, i)) net['r%s' % i].loadConf('ospfd', '%s/r%s/ospfd.conf' % (thisDir, i)) - net['r%s' % i].loadConf('ospf6d', '%s/r%s/ospf6d.conf' % (thisDir, i)) + if net['r1'].checkRouterVersion('<', '4.0'): + net['r%s' % i].loadConf('ospf6d', '%s/r%s/ospf6d.conf-pre-v4' % (thisDir, i)) + else: + net['r%s' % i].loadConf('ospf6d', '%s/r%s/ospf6d.conf' % (thisDir, i)) net['r%s' % i].loadConf('isisd', '%s/r%s/isisd.conf' % (thisDir, i)) net['r%s' % i].loadConf('bgpd', '%s/r%s/bgpd.conf' % (thisDir, i)) if net['r%s' % i].daemon_available('ldpd'): diff --git a/ospf-topo1/r1/ospf6d.conf-pre-v4 b/ospf-topo1/r1/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..6a40f85 --- /dev/null +++ b/ospf-topo1/r1/ospf6d.conf-pre-v4 @@ -0,0 +1,9 @@ +! +router ospf6 + router-id 10.0.255.1 + redistribute kernel + redistribute connected + redistribute static + interface r1-eth0 area 0.0.0.0 + interface r1-eth1 area 0.0.0.0 +! diff --git a/ospf-topo1/r2/ospf6d.conf-pre-v4 b/ospf-topo1/r2/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..7448b25 --- /dev/null +++ b/ospf-topo1/r2/ospf6d.conf-pre-v4 @@ -0,0 +1,9 @@ +! +router ospf6 + router-id 10.0.255.2 + redistribute kernel + redistribute connected + redistribute static + interface r2-eth0 area 0.0.0.0 + interface r2-eth1 area 0.0.0.0 +! diff --git a/ospf-topo1/r3/ospf6d.conf-pre-v4 b/ospf-topo1/r3/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..e853e0e --- /dev/null +++ b/ospf-topo1/r3/ospf6d.conf-pre-v4 @@ -0,0 +1,10 @@ +! +router ospf6 + router-id 10.0.255.3 + redistribute kernel + redistribute connected + redistribute static + interface r3-eth0 area 0.0.0.0 + interface r3-eth1 area 0.0.0.0 + interface r3-eth2 area 0.0.0.1 +! diff --git a/ospf-topo1/r4/ospf6d.conf-pre-v4 b/ospf-topo1/r4/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..dcc07a4 --- /dev/null +++ b/ospf-topo1/r4/ospf6d.conf-pre-v4 @@ -0,0 +1,9 @@ +! +router ospf6 + router-id 10.0.255.4 + redistribute kernel + redistribute connected + redistribute static + interface r4-eth0 area 0.0.0.1 + interface r4-eth1 area 0.0.0.1 +! diff --git a/ospf-topo1/test_ospf_topo1.py b/ospf-topo1/test_ospf_topo1.py index 4de1e92..638e394 100755 --- a/ospf-topo1/test_ospf_topo1.py +++ b/ospf-topo1/test_ospf_topo1.py @@ -87,6 +87,10 @@ def setup_module(mod): tgen = Topogen(OSPFTopo, mod.__name__) tgen.start_topology() + ospf6_config = 'ospf6d.conf' + if tgen.gears['r1'].has_version('<', '4.0'): + ospf6_config = 'ospf6d.conf-pre-v4' + router_list = tgen.routers() for rname, router in router_list.iteritems(): router.load_config( @@ -99,7 +103,7 @@ def setup_module(mod): ) router.load_config( TopoRouter.RD_OSPF6, - os.path.join(CWD, '{}/ospf6d.conf'.format(rname)) + os.path.join(CWD, '{}/{}'.format(rname, ospf6_config)) ) # Initialize all routers. diff --git a/ospf6-topo1/r1/ospf6d.conf-pre-v4 b/ospf6-topo1/r1/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..c4b3821 --- /dev/null +++ b/ospf6-topo1/r1/ospf6d.conf-pre-v4 @@ -0,0 +1,27 @@ +hostname r1 +log file ospf6d.log +! +debug ospf6 message all +debug ospf6 lsa unknown +debug ospf6 zebra +debug ospf6 interface +debug ospf6 neighbor +debug ospf6 route table +debug ospf6 flooding +! +interface r1-stubnet + ipv6 ospf6 network broadcast +! +interface r1-sw5 + ipv6 ospf6 network broadcast +! +router ospf6 + router-id 10.0.0.1 + log-adjacency-changes detail + redistribute static + interface r1-stubnet area 0.0.0.0 + interface r1-sw5 area 0.0.0.0 +! +line vty + exec-timeout 0 0 +! diff --git a/ospf6-topo1/r2/ospf6d.conf-pre-v4 b/ospf6-topo1/r2/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..bb9958d --- /dev/null +++ b/ospf6-topo1/r2/ospf6d.conf-pre-v4 @@ -0,0 +1,27 @@ +hostname r2 +log file ospf6d.log +! +debug ospf6 message all +debug ospf6 lsa unknown +debug ospf6 zebra +debug ospf6 interface +debug ospf6 neighbor +debug ospf6 route table +debug ospf6 flooding +! +interface r2-stubnet + ipv6 ospf6 network broadcast +! +interface r2-sw5 + ipv6 ospf6 network broadcast +! +router ospf6 + router-id 10.0.0.2 + log-adjacency-changes detail + redistribute static + interface r2-stubnet area 0.0.0.0 + interface r2-sw5 area 0.0.0.0 +! +line vty + exec-timeout 0 0 +! diff --git a/ospf6-topo1/r3/ospf6d.conf-pre-v4 b/ospf6-topo1/r3/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..d2dbc4a --- /dev/null +++ b/ospf6-topo1/r3/ospf6d.conf-pre-v4 @@ -0,0 +1,31 @@ +hostname r3 +log file ospf6d.log +! +debug ospf6 message all +debug ospf6 lsa unknown +debug ospf6 zebra +debug ospf6 interface +debug ospf6 neighbor +debug ospf6 route table +debug ospf6 flooding +! +interface r3-stubnet + ipv6 ospf6 network broadcast +! +interface r3-sw5 + ipv6 ospf6 network broadcast +! +interface r3-sw6 + ipv6 ospf6 network broadcast +! +router ospf6 + router-id 10.0.0.3 + log-adjacency-changes detail + redistribute static + interface r3-stubnet area 0.0.0.0 + interface r3-sw5 area 0.0.0.0 + interface r3-sw6 area 0.0.0.1 +! +line vty + exec-timeout 0 0 +! diff --git a/ospf6-topo1/r4/ospf6d.conf-pre-v4 b/ospf6-topo1/r4/ospf6d.conf-pre-v4 new file mode 100644 index 0000000..6f9c30d --- /dev/null +++ b/ospf6-topo1/r4/ospf6d.conf-pre-v4 @@ -0,0 +1,27 @@ +hostname r4 +log file ospf6d.log +! +debug ospf6 message all +debug ospf6 lsa unknown +debug ospf6 zebra +debug ospf6 interface +debug ospf6 neighbor +debug ospf6 route table +debug ospf6 flooding +! +interface r4-stubnet + ipv6 ospf6 network broadcast +! +interface r4-sw6 + ipv6 ospf6 network broadcast +! +router ospf6 + router-id 10.0.0.4 + log-adjacency-changes detail + redistribute static + interface r4-stubnet area 0.0.0.1 + interface r4-sw6 area 0.0.0.1 +! +line vty + exec-timeout 0 0 +! diff --git a/ospf6-topo1/test_ospf6_topo1.py b/ospf6-topo1/test_ospf6_topo1.py index 59a899a..f226f8b 100755 --- a/ospf6-topo1/test_ospf6_topo1.py +++ b/ospf6-topo1/test_ospf6_topo1.py @@ -156,10 +156,14 @@ def setup_module(module): # For debugging after starting net, but before starting FRR/Quagga, uncomment the next line # CLI(net) + ospf_config = 'ospf6d.conf' + if net['r1'].checkRouterVersion('<', '4.0'): + ospf_config = 'ospf6d.conf-pre-v4' + # Starting Routers for i in range(1, 5): net['r%s' % i].loadConf('zebra', '%s/r%s/zebra.conf' % (thisDir, i)) - net['r%s' % i].loadConf('ospf6d', '%s/r%s/ospf6d.conf' % (thisDir, i)) + net['r%s' % i].loadConf('ospf6d', '%s/r%s/%s' % (thisDir, i, ospf_config)) net['r%s' % i].startRouter() # For debugging after starting FRR/Quagga daemons, uncomment the next line