Use unified configuration procedure.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
+++ /dev/null
-router bgp 65501
- bgp router-id 192.168.0.1
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- neighbor 192.168.0.2 remote-as 65502
- neighbor 192:168::2 remote-as 65502
-!
- bmp targets bmp1
- bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
- bmp monitor ipv4 unicast pre-policy
- bmp monitor ipv6 unicast pre-policy
- bmp monitor ipv4 vpn pre-policy
- bmp monitor ipv6 vpn pre-policy
- bmp monitor ipv4 unicast post-policy
- bmp monitor ipv6 unicast post-policy
- bmp monitor ipv4 vpn post-policy
- bmp monitor ipv6 vpn post-policy
- bmp monitor ipv4 unicast loc-rib
- bmp monitor ipv6 unicast loc-rib
- bmp monitor ipv4 vpn loc-rib
- bmp monitor ipv6 vpn loc-rib
- exit
-!
- address-family ipv4 vpn
- neighbor 192.168.0.2 activate
- neighbor 192.168.0.2 soft-reconfiguration inbound
- exit-address-family
- address-family ipv6 vpn
- neighbor 192:168::2 activate
- neighbor 192:168::2 soft-reconfiguration inbound
- exit-address-family
- address-family ipv4 unicast
- neighbor 192.168.0.2 activate
- neighbor 192.168.0.2 soft-reconfiguration inbound
- no neighbor 192:168::2 activate
- exit-address-family
-!
- address-family ipv6 unicast
- neighbor 192:168::2 activate
- neighbor 192:168::2 soft-reconfiguration inbound
- exit-address-family
-!
-router bgp 65501 vrf vrf1
- bgp router_id 192.168.0.1
- bgp log-neighbor-changes
- address-family ipv4 unicast
- label vpn export 101
- rd vpn export 444:1
- rt vpn both 52:100
- export vpn
- import vpn
- exit-address-family
- address-family ipv6 unicast
- label vpn export 103
- rd vpn export 555:1
- rt vpn both 54:200
- export vpn
- import vpn
- exit-address-family
-exit
--- /dev/null
+interface r1-eth0
+ ip address 192.0.2.1/24
+!
+interface r1-eth1
+ ip address 192.168.0.1/24
+ ipv6 address 192:168::1/64
+!
+router bgp 65501
+ bgp router-id 192.168.0.1
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ neighbor 192.168.0.2 remote-as 65502
+ neighbor 192:168::2 remote-as 65502
+!
+ bmp targets bmp1
+ bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
+ bmp monitor ipv4 unicast pre-policy
+ bmp monitor ipv6 unicast pre-policy
+ bmp monitor ipv4 vpn pre-policy
+ bmp monitor ipv6 vpn pre-policy
+ bmp monitor ipv4 unicast post-policy
+ bmp monitor ipv6 unicast post-policy
+ bmp monitor ipv4 vpn post-policy
+ bmp monitor ipv6 vpn post-policy
+ bmp monitor ipv4 unicast loc-rib
+ bmp monitor ipv6 unicast loc-rib
+ bmp monitor ipv4 vpn loc-rib
+ bmp monitor ipv6 vpn loc-rib
+ exit
+!
+ address-family ipv4 vpn
+ neighbor 192.168.0.2 activate
+ neighbor 192.168.0.2 soft-reconfiguration inbound
+ exit-address-family
+ address-family ipv6 vpn
+ neighbor 192:168::2 activate
+ neighbor 192:168::2 soft-reconfiguration inbound
+ exit-address-family
+ address-family ipv4 unicast
+ neighbor 192.168.0.2 activate
+ neighbor 192.168.0.2 soft-reconfiguration inbound
+ no neighbor 192:168::2 activate
+ exit-address-family
+!
+ address-family ipv6 unicast
+ neighbor 192:168::2 activate
+ neighbor 192:168::2 soft-reconfiguration inbound
+ exit-address-family
+!
+router bgp 65501 vrf vrf1
+ bgp router-id 192.168.0.1
+ bgp log-neighbor-changes
+ address-family ipv4 unicast
+ label vpn export 101
+ rd vpn export 444:1
+ rt vpn both 52:100
+ export vpn
+ import vpn
+ exit-address-family
+ address-family ipv6 unicast
+ label vpn export 103
+ rd vpn export 555:1
+ rt vpn both 54:200
+ export vpn
+ import vpn
+ exit-address-family
+exit
+++ /dev/null
-interface r1-eth0
- ip address 192.0.2.1/24
-!
-interface r1-eth1
- ip address 192.168.0.1/24
- ipv6 address 192:168::1/64
-!
+++ /dev/null
-router bgp 65501 vrf vrf1
- bgp router-id 192.168.0.1
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- neighbor 192.168.0.2 remote-as 65502
- neighbor 192:168::2 remote-as 65502
-!
- bmp targets bmp1
- bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
- bmp monitor ipv4 unicast pre-policy
- bmp monitor ipv6 unicast pre-policy
- bmp monitor ipv4 unicast post-policy
- bmp monitor ipv6 unicast post-policy
- bmp monitor ipv4 unicast loc-rib
- bmp monitor ipv6 unicast loc-rib
- exit
-!
-
- address-family ipv4 unicast
- neighbor 192.168.0.2 activate
- neighbor 192.168.0.2 soft-reconfiguration inbound
- no neighbor 192:168::2 activate
- exit-address-family
-!
- address-family ipv6 unicast
- neighbor 192:168::2 activate
- neighbor 192:168::2 soft-reconfiguration inbound
- exit-address-family
-!
--- /dev/null
+interface r1vrf-eth0
+ ip address 192.0.2.1/24
+!
+interface r1vrf-eth1
+ ip address 192.168.0.1/24
+ ipv6 address 192:168::1/64
+!
+router bgp 65501 vrf vrf1
+ bgp router-id 192.168.0.1
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ neighbor 192.168.0.2 remote-as 65502
+ neighbor 192:168::2 remote-as 65502
+!
+ bmp targets bmp1
+ bmp connect 192.0.2.10 port 1789 min-retry 100 max-retry 10000
+ bmp monitor ipv4 unicast pre-policy
+ bmp monitor ipv6 unicast pre-policy
+ bmp monitor ipv4 unicast post-policy
+ bmp monitor ipv6 unicast post-policy
+ bmp monitor ipv4 unicast loc-rib
+ bmp monitor ipv6 unicast loc-rib
+ exit
+!
+ address-family ipv4 unicast
+ neighbor 192.168.0.2 activate
+ neighbor 192.168.0.2 soft-reconfiguration inbound
+ no neighbor 192:168::2 activate
+ exit-address-family
+!
+ address-family ipv6 unicast
+ neighbor 192:168::2 activate
+ neighbor 192:168::2 soft-reconfiguration inbound
+ exit-address-family
+!
+++ /dev/null
-interface r1vrf-eth0
- ip address 192.0.2.1/24
-!
-interface r1vrf-eth1
- ip address 192.168.0.1/24
- ipv6 address 192:168::1/64
-!
+++ /dev/null
-router bgp 65502
- bgp router-id 192.168.0.2
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- no bgp network import-check
- neighbor 192.168.0.1 remote-as 65501
- neighbor 192:168::1 remote-as 65501
-!
- address-family ipv4 unicast
- neighbor 192.168.0.1 activate
- no neighbor 192:168::1 activate
- redistribute connected
- exit-address-family
-!
- address-family ipv4 vpn
- neighbor 192.168.0.1 activate
- exit-address-family
-!
- address-family ipv6 vpn
- neighbor 192:168::1 activate
- exit-address-family
-!
- address-family ipv6 unicast
- neighbor 192:168::1 activate
- redistribute connected
- exit-address-family
-!
-router bgp 65502 vrf vrf1
- bgp router-id 192.168.0.2
- bgp log-neighbor-changes
- no bgp network import-check
- address-family ipv4 unicast
- label vpn export 102
- rd vpn export 444:2
- rt vpn both 52:100
- export vpn
- import vpn
- exit-address-family
- address-family ipv6 unicast
- label vpn export 105
- rd vpn export 555:2
- rt vpn both 54:200
- export vpn
- import vpn
- exit-address-family
-exit
--- /dev/null
+interface r2-eth0
+ ip address 192.168.0.2/24
+ ipv6 address 192:168::2/64
+!
+interface r2-eth1
+ ip address 172.31.0.2/24
+ ipv6 address 172:31::2/64
+!
+router bgp 65502
+ bgp router-id 192.168.0.2
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ no bgp network import-check
+ neighbor 192.168.0.1 remote-as 65501
+ neighbor 192:168::1 remote-as 65501
+!
+ address-family ipv4 unicast
+ neighbor 192.168.0.1 activate
+ no neighbor 192:168::1 activate
+ redistribute connected
+ exit-address-family
+!
+ address-family ipv4 vpn
+ neighbor 192.168.0.1 activate
+ exit-address-family
+!
+ address-family ipv6 vpn
+ neighbor 192:168::1 activate
+ exit-address-family
+!
+ address-family ipv6 unicast
+ neighbor 192:168::1 activate
+ redistribute connected
+ exit-address-family
+!
+router bgp 65502 vrf vrf1
+ bgp router-id 192.168.0.2
+ bgp log-neighbor-changes
+ no bgp network import-check
+ address-family ipv4 unicast
+ label vpn export 102
+ rd vpn export 444:2
+ rt vpn both 52:100
+ export vpn
+ import vpn
+ exit-address-family
+ address-family ipv6 unicast
+ label vpn export 105
+ rd vpn export 555:2
+ rt vpn both 54:200
+ export vpn
+ import vpn
+ exit-address-family
+exit
+++ /dev/null
-interface r2-eth0
- ip address 192.168.0.2/24
- ipv6 address 192:168::2/64
-!
-interface r2-eth1
- ip address 172.31.0.2/24
- ipv6 address 172:31::2/64
-!
+++ /dev/null
-router bgp 65502
- bgp router-id 192.168.0.2
- bgp log-neighbor-changes
- no bgp ebgp-requires-policy
- no bgp network import-check
- neighbor 192.168.0.1 remote-as 65501
- neighbor 192:168::1 remote-as 65501
-!
- address-family ipv4 unicast
- neighbor 192.168.0.1 activate
- no neighbor 192:168::1 activate
- redistribute connected
- exit-address-family
-!
- address-family ipv6 unicast
- neighbor 192:168::1 activate
- redistribute connected
- exit-address-family
-!
--- /dev/null
+interface r2vrf-eth0
+ ip address 192.168.0.2/24
+ ipv6 address 192:168::2/64
+!
+interface r2vrf-eth1
+ ip address 172.31.0.2/24
+ ipv6 address 172:31::2/64
+!
+router bgp 65502
+ bgp router-id 192.168.0.2
+ bgp log-neighbor-changes
+ no bgp ebgp-requires-policy
+ no bgp network import-check
+ neighbor 192.168.0.1 remote-as 65501
+ neighbor 192:168::1 remote-as 65501
+!
+ address-family ipv4 unicast
+ neighbor 192.168.0.1 activate
+ no neighbor 192:168::1 activate
+ redistribute connected
+ exit-address-family
+!
+ address-family ipv6 unicast
+ neighbor 192:168::1 activate
+ redistribute connected
+ exit-address-family
+!
+++ /dev/null
-interface r2vrf-eth0
- ip address 192.168.0.2/24
- ipv6 address 192:168::2/64
-!
-interface r2vrf-eth1
- ip address 172.31.0.2/24
- ipv6 address 172:31::2/64
-!
)
for rname, router in tgen.routers().items():
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP,
- os.path.join(CWD, "{}/bgpd.conf".format(rname)),
- "-M bmp",
+ logger.info("Loading router %s" % rname)
+ router.load_frr_config(
+ os.path.join(CWD, "{}/frr.conf".format(rname)),
+ [(TopoRouter.RD_ZEBRA, None), (TopoRouter.RD_BGP, "-M bmp")],
)
tgen.start_router()
)
for rname, router in tgen.routers().items():
- router.load_config(
- TopoRouter.RD_ZEBRA, os.path.join(CWD, "{}/zebra.conf".format(rname))
- )
- router.load_config(
- TopoRouter.RD_BGP,
- os.path.join(CWD, "{}/bgpd.conf".format(rname)),
- "-M bmp",
+ logger.info("Loading router %s" % rname)
+ router.load_frr_config(
+ os.path.join(CWD, "{}/frr.conf".format(rname)),
+ [(TopoRouter.RD_ZEBRA, None), (TopoRouter.RD_BGP, "-M bmp")],
)
tgen.start_router()