--- /dev/null
+!
+# Create the various blackhole route types
+ip route 4.5.6.7/32 blackhole
+ipv6 route 4:5::6:7/128 blackhole
+ip route 4.5.6.8/32 Null0
+ipv6 route 4:5::6:8/128 Null0
+ip route 4.5.6.9/32 reject
+ipv6 route 4:5::6:9/128 reject
+# Test various spellings of NULL0 to make sure we accept them
+ip route 4.5.6.13/32 null0
+ip route 4.5.6.14/32 NULL0
+# Create normal gateway routes
+ip route 4.5.6.10/32 192.168.0.2
+ipv6 route 4:5::6:10/128 fc00:0:0:0::2
+# Create normal gateway + interface routes
+ip route 4.5.6.11/32 192.168.0.2 r1-eth0
+ipv6 route 4:5::6:11/128 fc00:0:0:0::2 r1-eth0
+# Create ifname routes
+ip route 4.5.6.12/32 r1-eth0
+ipv6 route 4:5::6:12/128 r1-eth0
+# Create a route that has a large admin distance
+# an admin distance of 255 should be accepted
+# by zebra but not installed.
+ip route 4.5.6.15/32 192.168.0.2 255
+ipv6 route 4:5::6:15/128 fc00:0:0:0::2 255
+# Routes to put into a nexthop-group
+ip route 1.1.1.1/32 r1-eth1
+ip route 1.1.1.2/32 r1-eth2
+ip route 1.1.1.3/32 r1-eth3
+ip route 1.1.1.4/32 r1-eth4
+ip route 1.1.1.5/32 r1-eth5
+ip route 1.1.1.6/32 r1-eth6
+ip route 1.1.1.7/32 r1-eth7
+ip route 1.1.1.8/32 r1-eth8
+
+# Create a route that has overlapping distance
+# so we have backups
+ip route 4.5.6.16/32 192.168.0.2 5
+ip route 4.5.6.16/32 192.168.0.4 10
+
+# Create routes that have different tags
+# and how we handle it
+ip route 4.5.6.17/32 192.168.0.2 tag 9000
+ip route 4.5.6.17/32 192.168.0.2 tag 10000
+!
log file zebra.log
!
hostname r1
-!
-# Create the various blackhole route types
-ip route 4.5.6.7/32 blackhole
-ipv6 route 4:5::6:7/128 blackhole
-ip route 4.5.6.8/32 Null0
-ipv6 route 4:5::6:8/128 Null0
-ip route 4.5.6.9/32 reject
-ipv6 route 4:5::6:9/128 reject
-# Test various spellings of NULL0 to make sure we accept them
-ip route 4.5.6.13/32 null0
-ip route 4.5.6.14/32 NULL0
-# Create normal gateway routes
-ip route 4.5.6.10/32 192.168.0.2
-ipv6 route 4:5::6:10/128 fc00:0:0:0::2
-# Create normal gateway + interface routes
-ip route 4.5.6.11/32 192.168.0.2 r1-eth0
-ipv6 route 4:5::6:11/128 fc00:0:0:0::2 r1-eth0
-# Create ifname routes
-ip route 4.5.6.12/32 r1-eth0
-ipv6 route 4:5::6:12/128 r1-eth0
-# Create a route that has a large admin distance
-# an admin distance of 255 should be accepted
-# by zebra but not installed.
-ip route 4.5.6.15/32 192.168.0.2 255
-ipv6 route 4:5::6:15/128 fc00:0:0:0::2 255
-# Routes to put into a nexthop-group
-ip route 1.1.1.1/32 r1-eth1
-ip route 1.1.1.2/32 r1-eth2
-ip route 1.1.1.3/32 r1-eth3
-ip route 1.1.1.4/32 r1-eth4
-ip route 1.1.1.5/32 r1-eth5
-ip route 1.1.1.6/32 r1-eth6
-ip route 1.1.1.7/32 r1-eth7
-ip route 1.1.1.8/32 r1-eth8
-
-# Create a route that has overlapping distance
-# so we have backups
-ip route 4.5.6.16/32 192.168.0.2 5
-ip route 4.5.6.16/32 192.168.0.4 10
-
-# Create routes that have different tags
-# and how we handle it
-ip route 4.5.6.17/32 192.168.0.2 tag 9000
-ip route 4.5.6.17/32 192.168.0.2 tag 10000
-
!
interface r1-eth0
description to sw0 - no routing protocol
--- /dev/null
+!
+ip route 0.0.0.0/0 blackhole
+ip route 192.0.2.1/32 blackhole
+ip route 192.0.2.2/32 blackhole
+ip route 192.0.2.3/32 blackhole
+ip route 192.0.2.4/32 blackhole
+ip route 192.0.2.5/32 blackhole
+!
!
hostname Router1
!
-ip route 0.0.0.0/0 blackhole
-ip route 192.0.2.1/32 blackhole
-ip route 192.0.2.2/32 blackhole
-ip route 192.0.2.3/32 blackhole
-ip route 192.0.2.4/32 blackhole
-ip route 192.0.2.5/32 blackhole
-!
interface r1-eth0
ip address 10.10.10.1/24
!
router_list = tgen.routers()
for i, (rname, router) in enumerate(router_list.items(), 1):
+ router.load_config(
+ TopoRouter.RD_MGMTD, os.path.join(CWD, "{}/mgmtd.conf".format(rname))
+ )
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
--- /dev/null
+ip route 192.168.13.0./24 Null0
interface r1-eth0
ip address 192.168.255.1/24
!
-ip route 192.168.13.0./24 Null0
-!
ip forwarding
!
--- /dev/null
+!
+ip route 192.168.13.0./24 Null0
+!
interface r1-eth0
ip address 192.168.255.1/24
!
-ip route 192.168.13.0./24 Null0
-!
ip forwarding
!
--- /dev/null
+ip route 10.100.0.2/32 10.0.1.2
!
log file zebra.log
!
-ip route 10.100.0.2/32 10.0.1.2
-!
vrf vrf-blue
vni 1000 prefix-routes-only
exit-vrf
--- /dev/null
+ip route 10.100.0.1/32 10.0.1.1
!
log file zebra.log
!
-ip route 10.100.0.1/32 10.0.1.1
-!
vrf vrf-blue
vni 1000 prefix-routes-only
exit-vrf
--- /dev/null
+!
+ip route 99.0.0.1/32 192.168.1.2
+!
ip address 192.168.1.1/24
no link-detect
!
-ip route 99.0.0.1/32 192.168.1.2
-!
ip forwarding
!
!
--- /dev/null
+ip route 99.0.0.2/32 192.168.1.2
ip address 192.168.1.1/24
no link-detect
!
-ip route 99.0.0.2/32 192.168.1.2
-!
ip forwarding
!
!
--- /dev/null
+ip route 99.0.0.3/32 192.168.1.2
ip address 192.168.1.1/24
no link-detect
!
-ip route 99.0.0.3/32 192.168.1.2
-!
ip forwarding
!
line vty
--- /dev/null
+ip route 10.0.4.0/24 10.0.1.2
# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
+ router.load_config(
+ TopoRouter.RD_MGMTD, os.path.join(CWD, "{}/mgmtd.conf".format(rname))
+ )
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
--- /dev/null
+!
+ip route 198.51.100.0/24 10.0.2.2
+!
# For all registered routers, load the zebra configuration file
for rname, router in tgen.routers().items():
router.run("/bin/bash {}/setup_vrfs".format(CWD))
+ router.load_config(
+ TopoRouter.RD_MGMTD, os.path.join(CWD, "{}/mgmtd.conf".format(rname))
+ )
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
--- /dev/null
+!
+ip route 99.0.0.1/32 192.168.1.2
+!
ip address 192.168.1.1/24
no link-detect
!
-ip route 99.0.0.1/32 192.168.1.2
-!
ip forwarding
!
!
--- /dev/null
+!
+ip route 99.0.0.2/32 192.168.1.2
+!
ip address 192.168.1.1/24
no link-detect
!
-ip route 99.0.0.2/32 192.168.1.2
-!
ip forwarding
!
!
--- /dev/null
+!
+ip route 99.0.0.3/32 192.168.1.2
+!
ip address 192.168.1.1/24
no link-detect
!
-ip route 99.0.0.3/32 192.168.1.2
-!
ip forwarding
!
line vty
--- /dev/null
+!
+ip route 40.0.0.0/8 blackhole
+ip route 50.0.0.0/8 blackhole
+!
ip address 10.0.0.1/30
!
ip forwarding
-!
-ip route 40.0.0.0/8 blackhole
-ip route 50.0.0.0/8 blackhole
-!
+
# pylint: disable=C0413
from lib.topogen import Topogen, TopoRouter, get_topogen
from lib.topolog import logger
-
+from lib import topotest
pytestmark = [pytest.mark.staticd]
router_list = tgen.routers()
for rname, router in router_list.items():
+ router.load_config(
+ TopoRouter.RD_MGMTD,
+ os.path.join(CWD, "{}/mgmtd.conf".format(rname)),
+ )
router.load_config(
TopoRouter.RD_ZEBRA,
os.path.join(CWD, "{}/zebra.conf".format(rname)),
[u"10.0.0.0/8", u"11.0.0.0/8"],
[u"2100:1111:2220::/44", u"2100:3333:4440::/44"],
]
-
+ topotest.sleep(5)
bad_indices = []
for ipv6 in [False, True]:
base_delta = do_config(
--- /dev/null
+ip route 192.168.2.0/24 192.168.3.10
ip address 193.1.2.2/24
no link-detect
!
-ip route 192.168.2.0/24 192.168.3.10
-!
ip forwarding
ipv6 forwarding
!
# This is a sample of configuration loading.
router_list = tgen.routers()
for rname, router in router_list.items():
+ router.load_config(
+ TopoRouter.RD_MGMTD, os.path.join(CWD, "{}/mgmtd.conf".format(rname))
+ )
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
--- /dev/null
+ip route 9.9.9.2/32 10.0.11.2
!
ip forwarding
!
-ip route 9.9.9.2/32 10.0.11.2
-!
line vty
!
# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
+ router.load_config(
+ TopoRouter.RD_MGMTD, os.path.join(CWD, "{}/mgmtd.conf".format(rname))
+ )
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
"""
self.load_config(self.RD_FRR, source)
if not daemons:
- # Always add zebra
+ # Always add zebra and mgmtd
+ self.load_config(self.RD_MGMTD)
self.load_config(self.RD_ZEBRA)
for daemon in self.RD:
# This will not work for all daemons
self.routertype = "frr"
self.unified_config = None
self.daemons = {
+ "mgmtd": 0,
"zebra": 0,
"ripd": 0,
"ripngd": 0,
"babeld": 0,
"pbrd": 0,
"pathd": 0,
- "snmpd": 0,
- "mgmtd": 0,
+ "snmpd": 0
}
- self.daemons_options = {"zebra": "", "mgmtd": ""}
+ self.daemons_options = {"mgmtd": "", "zebra": ""}
self.reportCores = True
self.version = None
self._config_frr(**params)
else:
# Test the provided path
+ cpath = os.path.join(self.daemondir, "mgmtd")
+ if not os.path.isfile(zpath):
+ raise Exception("No MGMTD binary found in {}".format(cpath))
+
zpath = os.path.join(self.daemondir, "zebra")
if not os.path.isfile(zpath):
raise Exception("No zebra binary found in {}".format(zpath))
- cpath = os.path.join(self.daemondir, "mgmtd")
- if not os.path.isfile(zpath):
- raise Exception("No MGMTD binary found in {}".format(cpath))
# Allow user to specify routertype when the path was specified.
if params.get("routertype") is not None:
self.routertype = params.get("routertype")
--- /dev/null
+ip route 10.2.1.0/24 10.1.1.3
interface r1-eth0
ip address 10.1.1.1/24
!
-ip route 10.2.1.0/24 10.1.1.3
interface r1-gre0
ip address 10.255.255.1/32
no link-detect
--- /dev/null
+ip route 10.1.1.0/24 10.2.1.3
interface r2-eth0
ip address 10.2.1.2/24
!
-ip route 10.1.1.0/24 10.2.1.3
interface r2-gre0
ip address 10.255.255.2/32
no link-detect
_populate_iface()
for rname, router in router_list.items():
+ router.load_config(
+ TopoRouter.RD_MGMTD,
+ os.path.join(CWD, "{}/mgmtd.conf".format(rname)),
+ )
router.load_config(
TopoRouter.RD_ZEBRA,
os.path.join(CWD, "{}/zebra.conf".format(rname)),
--- /dev/null
+ipv6 route fc00:1::/64 fc00:100::1234
+ipv6 route fc00:2::/64 fc00:100::1234
+ipv6 route fc00:3::/64 fc00:100::1234
interface r3-eth0
ipv6 address 2001:db8:2::1/64
!
-ipv6 route fc00:1::/64 fc00:100::1234
-ipv6 route fc00:2::/64 fc00:100::1234
-ipv6 route fc00:3::/64 fc00:100::1234
# This is a sample of configuration loading.
r1 = tgen.gears["r1"]
+ r1.load_config(
+ TopoRouter.RD_MGMTD, os.path.join(CWD, "r1/mgmtd.conf")
+ )
r1.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "r1/zebra.conf")
)
--- /dev/null
+ip route 9.9.9.2/32 10.0.11.2
!
ip forwarding
!
-ip route 9.9.9.2/32 10.0.11.2
-!
line vty
!
# For all registered routers, load the zebra configuration file
for rname, router in router_list.items():
+ router.load_config(
+ TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/mgmtd.conf".format(rname))
+ )
router.load_config(
TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
)
--- /dev/null
+!
+ip route 3.3.1.1/32 Null0
+ip route 3.3.2.2/32 Null0
+ip route 3.3.3.3/32 Null0
+!
-!
-ip route 3.3.1.1/32 Null0
-ip route 3.3.2.2/32 Null0
-ip route 3.3.3.3/32 Null0
-!
interface r3-eth0
ip address 10.0.23.3/24
!
--- /dev/null
+ip route 0.0.0.0/0 192.168.100.1
description connection to r1 via sw1
ip address 192.168.100.10/24
!
-ip route 0.0.0.0/0 192.168.100.1
-!
--- /dev/null
+ip route 0.0.0.0/0 192.168.101.1
description connection to r1 via sw2
ip address 192.168.101.2/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+ip route 0.0.0.0/0 192.168.101.1
description connection to r1 via sw1
ip address 192.168.101.11/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+ip route 0.0.0.0/0 192.168.101.1
description connection to r1 via sw1
ip address 192.168.101.12/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+ip route 0.0.0.0/0 192.168.101.1
description connection to r1 via sw1
ip address 192.168.101.13/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+ip route 0.0.0.0/0 192.168.101.1
description connection to r1 via sw1
ip address 192.168.101.14/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+ip route 0.0.0.0/0 192.168.101.1
description connection to r1 via sw1
ip address 192.168.101.15/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+!
+ip route 0.0.0.0/0 192.168.100.1
+!
description connection to r1 via sw1
ip address 192.168.100.10/24
!
-ip route 0.0.0.0/0 192.168.100.1
-!
+
--- /dev/null
+!
+ip route 0.0.0.0/0 192.168.101.1
+!
description connection to r1 via sw2
ip address 192.168.101.2/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+!
+ip route 0.0.0.0/0 192.168.100.1
+!
description connection to r1 via sw3
ip address 192.168.100.20/24
!
-ip route 0.0.0.0/0 192.168.100.1
-!
--- /dev/null
+!
+ip route 0.0.0.0/0 192.168.101.1
+!
description connection to r1 via sw4
ip address 192.168.101.4/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
--- /dev/null
+!
+ip route 0.0.0.0/0 192.168.101.1
+!
description connection to r1 via sw1
ip address 192.168.101.11/24
!
-ip route 0.0.0.0/0 192.168.101.1
-!
+
--- /dev/null
+!
+ip route 0.0.0.0/0 192.168.101.1
+!
--- /dev/null
+ip route 192.168.2.0/24 192.168.3.10
ip address 193.1.2.2/24
no link-detect
!
-ip route 192.168.2.0/24 192.168.3.10
-!
ip forwarding
ipv6 forwarding
!
# Starting Routers
#
for i in range(1, 4):
+ net["r%s" % i].loadConf("mgmtd", "%s/r%s/mgmtd.conf" % (thisDir, i))
net["r%s" % i].loadConf("zebra", "%s/r%s/zebra.conf" % (thisDir, i))
net["r%s" % i].loadConf("ripd", "%s/r%s/ripd.conf" % (thisDir, i))
tgen.gears["r%s" % i].start()
tgen.start_topology()
router_list = tgen.routers()
for rname, router in tgen.routers().items():
+ router.load_config(TopoRouter.RD_MGMTD, os.path.join(CWD, "{}/mgmtd.conf".format(rname)))
router.load_config(TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname)))
router.load_config(
TopoRouter.RD_SHARP, os.path.join(CWD, "{}/sharpd.conf".format(rname))