diff --git a/examples/basic_bfd/spec.yaml b/examples/basic_bfd/spec.yaml new file mode 100644 index 0000000..518261c --- /dev/null +++ b/examples/basic_bfd/spec.yaml @@ -0,0 +1,116 @@ +# http://www.asciiflow.com + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R4#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: R4#net1 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: R3#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface lo' + -c ' ip address 10.255.0.1/32' + -c 'exit' + -c 'interface net0' + -c ' ip address 10.0.0.1/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'interface net1' + -c ' ip address 10.0.0.5/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'router ospf' + -c ' network 10.0.0.0/30 area 0' + -c ' network 10.0.0.4/30 area 0' + -c 'exit' + - name: R2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface lo' + -c ' ip address 10.255.0.2/32' + -c 'exit' + -c 'interface net0' + -c ' ip address 10.0.0.2/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'interface net1' + -c ' ip address 10.0.0.9/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'router ospf' + -c ' network 10.0.0.0/30 area 0' + -c ' network 10.0.0.8/30 area 0' + -c 'exit' + - name: R3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface lo' + -c ' ip address 10.255.0.3/32' + -c 'exit' + -c 'interface net0' + -c ' ip address 10.0.0.6/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'interface net1' + -c ' ip address 10.0.0.13/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'router ospf' + -c ' network 10.0.0.4/30 area 0' + -c ' network 10.0.0.12/30 area 0' + - name: R4 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface lo' + -c ' ip address 10.255.0.4/32' + -c 'exit' + -c 'interface net0' + -c ' ip address 10.0.0.10/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'interface net1' + -c ' ip address 10.0.0.14/30' + -c ' ip ospf bfd' + -c 'exit' + -c 'router ospf' + -c ' network 10.0.0.8/30 area 0' + -c ' network 10.0.0.12/30 area 0' + +test: + - cmds: + ## P2P Link test + - cmd: docker exec R1 ping -c2 10.0.0.2 + - cmd: docker exec R1 ping -c2 10.0.0.6 + - cmd: docker exec R2 ping -c2 10.0.0.1 + - cmd: docker exec R2 ping -c2 10.0.0.10 + - cmd: docker exec R3 ping -c2 10.0.0.5 + - cmd: docker exec R3 ping -c2 10.0.0.14 + - cmd: docker exec R4 ping -c2 10.0.0.9 + - cmd: docker exec R4 ping -c2 10.0.0.13 + diff --git a/examples/basic_bfd/topo.jpeg b/examples/basic_bfd/topo.jpeg new file mode 100644 index 0000000..d36b41d Binary files /dev/null and b/examples/basic_bfd/topo.jpeg differ diff --git a/examples/basic_bgp/README.md b/examples/basic_bgp/README.md new file mode 100644 index 0000000..0b26cca --- /dev/null +++ b/examples/basic_bgp/README.md @@ -0,0 +1,4 @@ + +# BGP Playground + + diff --git a/examples/basic_bgp/hv_bgp_dcn/README.md b/examples/basic_bgp/hv_bgp_dcn/README.md new file mode 100644 index 0000000..c4bdc48 --- /dev/null +++ b/examples/basic_bgp/hv_bgp_dcn/README.md @@ -0,0 +1,25 @@ + +# HV route advertisement study for BGP-DCN + +- [GOOD reference about routing-info manupulation by @ukinau](https://engineering.linecorp.com/ja/blog/openstack-summit-vancouver-2018-recap-2-2/) +- [GOOD reference about proxy arp by @ukinau](https://qiita.com/ukinau/items/cb25588fb0c276a009dc) + +![](topo.png) + +``` +docker exec TOR vtysh -c 'show bgp ipv4 unicast' +BGP table version is 4, local router ID is 10.255.0.99, vrf id 0 +Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, + i internal, r RIB-failure, S Stale, R Removed +Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self +Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path +*> 1.1.1.1/32 0.0.0.0 0 32768 ? +*> 10.0.0.11/32 dn1 0 0 65001 ? +*> 10.0.0.12/32 dn1 0 0 65001 ? +*> 10.0.0.13/32 dn1 0 0 65001 ? + +Displayed 4 routes and 4 total paths +``` + diff --git a/examples/basic_bgp/hv_bgp_dcn/spec.yaml b/examples/basic_bgp/hv_bgp_dcn/spec.yaml new file mode 100644 index 0000000..c5f4717 --- /dev/null +++ b/examples/basic_bgp/hv_bgp_dcn/spec.yaml @@ -0,0 +1,98 @@ + +nodes: + - name: TOR + image: slankdev/frr + interfaces: + - { name: dn1, type: direct, args: HV1#up1 } + - name: HV1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: TOR#dn1 } + - { name: dn1, type: direct, args: VM1#net0 } + - { name: dn2, type: direct, args: VM2#net0 } + - { name: dn3, type: direct, args: VM3#net0 } + - name: VM1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: HV1#dn1 } + - name: VM2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: HV1#dn2 } + - name: VM3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: HV1#dn3 } + +node_configs: + - name: TOR + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: ip addr add 1.1.1.1/32 dev lo + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface dn1' + -c ' ipv6 nd ra-interval 3' + -c ' no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65099' + -c ' bgp router-id 10.255.0.99' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor dn1 interface peer-group PEER' + -c '!' + -c ' address-family ipv4 unicast' + -c ' neighbor dn1 activate' + -c ' redistribute connected' + -c ' exit-address-family' + + - name: HV1 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: ip addr add 10.0.0.1/24 dev dn1 + - cmd: ip addr add 10.0.0.1/24 dev dn2 + - cmd: ip addr add 10.0.0.1/24 dev dn3 + - cmd: ip route add 10.0.0.11 dev dn1 + - cmd: ip route add 10.0.0.12 dev dn2 + - cmd: ip route add 10.0.0.13 dev dn3 + - cmd: sysctl -w net.ipv4.conf.dn1.proxy_arp=1 + - cmd: sysctl -w net.ipv4.conf.dn2.proxy_arp=1 + - cmd: sysctl -w net.ipv4.conf.dn3.proxy_arp=1 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface up1' + -c ' ipv6 nd ra-interval 3' + -c ' no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65001' + -c ' bgp router-id 10.255.0.1' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor up1 interface peer-group PEER' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' redistribute kernel route-map TO_TOR' + -c ' neighbor up1 route-map TO_TOR out' + -c ' exit-address-family' + -c '!' + -c 'route-map TO_TOR permit 1' + -c 'match ip address prefix-len 32' + -c 'exit' + + - name: VM1 + cmds: + - cmd: ip addr add 10.0.0.11/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + - name: VM2 + cmds: + - cmd: ip addr add 10.0.0.12/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + - name: VM3 + cmds: + - cmd: ip addr add 10.0.0.13/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + diff --git a/examples/basic_bgp/hv_bgp_dcn/topo.png b/examples/basic_bgp/hv_bgp_dcn/topo.png new file mode 100644 index 0000000..1e0ee06 Binary files /dev/null and b/examples/basic_bgp/hv_bgp_dcn/topo.png differ diff --git a/examples/basic_bgp/hv_bgp_dcn_isol/Makefile b/examples/basic_bgp/hv_bgp_dcn_isol/Makefile new file mode 100644 index 0000000..25689fa --- /dev/null +++ b/examples/basic_bgp/hv_bgp_dcn_isol/Makefile @@ -0,0 +1,3 @@ + +sh: + docker exec TOR vtysh -c 'show bgp ipv4 vpn' diff --git a/examples/basic_bgp/hv_bgp_dcn_isol/README.md b/examples/basic_bgp/hv_bgp_dcn_isol/README.md new file mode 100644 index 0000000..c4bdc48 --- /dev/null +++ b/examples/basic_bgp/hv_bgp_dcn_isol/README.md @@ -0,0 +1,25 @@ + +# HV route advertisement study for BGP-DCN + +- [GOOD reference about routing-info manupulation by @ukinau](https://engineering.linecorp.com/ja/blog/openstack-summit-vancouver-2018-recap-2-2/) +- [GOOD reference about proxy arp by @ukinau](https://qiita.com/ukinau/items/cb25588fb0c276a009dc) + +![](topo.png) + +``` +docker exec TOR vtysh -c 'show bgp ipv4 unicast' +BGP table version is 4, local router ID is 10.255.0.99, vrf id 0 +Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, + i internal, r RIB-failure, S Stale, R Removed +Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self +Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path +*> 1.1.1.1/32 0.0.0.0 0 32768 ? +*> 10.0.0.11/32 dn1 0 0 65001 ? +*> 10.0.0.12/32 dn1 0 0 65001 ? +*> 10.0.0.13/32 dn1 0 0 65001 ? + +Displayed 4 routes and 4 total paths +``` + diff --git a/examples/basic_bgp/hv_bgp_dcn_isol/spec.yaml b/examples/basic_bgp/hv_bgp_dcn_isol/spec.yaml new file mode 100644 index 0000000..e0426a7 --- /dev/null +++ b/examples/basic_bgp/hv_bgp_dcn_isol/spec.yaml @@ -0,0 +1,126 @@ + +nodes: + - name: TOR + # image: slankdev/frr-dev:latest + image: slankdev/frr-dev:draft-ietf-bess-srv6-services + interfaces: + - { name: dn1, type: direct, args: HV1#up1 } + - name: HV1 + # image: slankdev/frr-dev:latest + image: slankdev/frr-dev:draft-ietf-bess-srv6-services + interfaces: + - { name: up1, type: direct, args: TOR#dn1 } + - { name: dn1, type: direct, args: VM1#net0 } + - { name: dn2, type: direct, args: VM2#net0 } + - { name: dn3, type: direct, args: VM3#net0 } + - name: VM1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: HV1#dn1 } + - name: VM2 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: HV1#dn2 } + - name: VM3 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: HV1#dn3 } + +node_configs: + - name: TOR + cmds: + - cmd: sh -c "echo > /etc/frr/frr.conf" + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: ip addr add 1.1.1.1/32 dev lo + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c 'conf t' + -c 'interface dn1' + -c ' ipv6 nd ra-interval 3' + -c ' no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65099' + -c ' bgp router-id 10.255.0.99' + -c ' no bgp default ipv4-unicast' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor dn1 interface peer-group PEER' + -c '!' + -c ' address-family ipv4 vpn' + -c ' neighbor PEER activate' + -c ' exit-address-family' + + - name: HV1 + cmds: + - cmd: sh -c "echo > /etc/frr/frr.conf" + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: ip link add vrf1 type vrf table 10 + - cmd: ip link set vrf1 up + - cmd: ip link set dn1 vrf vrf1 + - cmd: ip link set dn2 vrf vrf1 + - cmd: ip link set dn3 vrf vrf1 + - cmd: ip addr add 10.0.0.1/24 dev dn1 + - cmd: ip addr add 10.0.0.1/24 dev dn2 + - cmd: ip addr add 10.0.0.1/24 dev dn3 + - cmd: ip route add 10.0.0.11 dev dn1 vrf vrf1 + - cmd: ip route add 10.0.0.12 dev dn2 vrf vrf1 + - cmd: ip route add 10.0.0.13 dev dn3 vrf vrf1 + - cmd: sysctl -w net.ipv4.conf.dn1.proxy_arp=1 + - cmd: sysctl -w net.ipv4.conf.dn2.proxy_arp=1 + - cmd: sysctl -w net.ipv4.conf.dn3.proxy_arp=1 + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c 'conf t' + -c 'interface up1' + -c ' ipv6 nd ra-interval 3' + -c ' no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65001' + -c ' bgp router-id 10.255.0.1' + -c ' no bgp default ipv4-unicast' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor up1 interface peer-group PEER' + -c ' !' + -c ' address-family ipv4 vpn' + -c ' neighbor PEER activate' + -c ' segment-routing-ipv6' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65001 vrf vrf1' + -c ' bgp router-id 10.255.0.1' + -c ' bgp bestpath as-path multipath-relax' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' redistribute kernel' + -c ' sid vpn export locator default' + -c ' rd vpn export 65001:1' + -c ' rt vpn both 100:1' + -c ' export vpn' + -c ' import vpn' + -c ' exit-address-family' + -c '!' + -c 'segment-routing-ipv6' + -c ' encapsulation source-address 2001:1::' + -c ' locator prefix 2001:1::/64' + -c ' exit' + -c '!' + -c 'route-map TO_TOR permit 1' + -c ' match ip address prefix-len 32' + -c ' exit' + + - name: VM1 + cmds: + - cmd: ip addr add 10.0.0.11/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + - name: VM2 + cmds: + - cmd: ip addr add 10.0.0.12/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + - name: VM3 + cmds: + - cmd: ip addr add 10.0.0.13/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + diff --git a/examples/basic_bgp/hv_bgp_dcn_isol/topo.png b/examples/basic_bgp/hv_bgp_dcn_isol/topo.png new file mode 100644 index 0000000..979804d Binary files /dev/null and b/examples/basic_bgp/hv_bgp_dcn_isol/topo.png differ diff --git a/examples/basic_bgp/path_attr/README.md b/examples/basic_bgp/path_attr/README.md new file mode 100644 index 0000000..63234cc --- /dev/null +++ b/examples/basic_bgp/path_attr/README.md @@ -0,0 +1,34 @@ + +# BGP route-map playground (import-prefix-filter) + +![](topo.png) + +``` +docker exec R3 vtysh -c 'show bgp ipv4 unicast' +BGP table version is 1, local router ID is 10.255.0.3, vrf id 0 +Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, + i internal, r RIB-failure, S Stale, R Removed +Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self +Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path +*> 10.0.0.2/32 net0 0 65001 65002 i + +Displayed 1 routes and 1 total paths +``` +``` +docker exec R4 vtysh -c 'show bgp ipv4 unicast' +BGP table version is 3, local router ID is 10.255.0.4, vrf id 0 +Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, + i internal, r RIB-failure, S Stale, R Removed +Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self +Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path +*> 10.0.0.1/32 net0 0 65001 65002 i +*> 10.0.0.2/32 net0 0 65001 65002 i +*> 10.0.0.3/32 net0 0 65001 65002 i + +Displayed 3 routes and 3 total paths +``` + diff --git a/examples/basic_bgp/path_attr/spec.yaml b/examples/basic_bgp/path_attr/spec.yaml new file mode 100644 index 0000000..6826f73 --- /dev/null +++ b/examples/basic_bgp/path_attr/spec.yaml @@ -0,0 +1,126 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - { name: net2, type: direct, args: R4#net0 } + + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net2 } + +node_configs: + - name: R1 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface net0' -c 'ipv6 nd ra-interval 3' -c 'no ipv6 nd suppress-ra' + -c 'interface net1' -c 'ipv6 nd ra-interval 3' -c 'no ipv6 nd suppress-ra' + -c 'interface net2' -c 'ipv6 nd ra-interval 3' -c 'no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65001' + -c ' bgp router-id 10.255.0.1' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor net0 interface peer-group PEER' + -c ' neighbor net1 interface peer-group PEER' + -c ' neighbor net2 interface peer-group PEER' + -c '!' + -c ' address-family ipv4 unicast' + -c ' neighbor net0 activate' + -c ' exit-address-family' + -c '!' + -c 'ip prefix-list PREF1 seq 5 permit 10.0.0.1/32' + -c 'ip prefix-list PREF2 seq 5 permit 10.0.0.2/32' + -c 'ip prefix-list PREF3 seq 5 permit 10.0.0.3/32' + + - name: R2 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface net0' -c 'ipv6 nd ra-interval 3' -c 'no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65002' + -c ' bgp router-id 10.255.0.2' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor net0 interface peer-group PEER' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' network 10.0.0.1/32 route-map COM1' + -c ' network 10.0.0.2/32 route-map COM2' + -c ' network 10.0.0.3/32 route-map COM3' + -c ' exit-address-family' + -c '!' + -c 'ip prefix-list PREF1 seq 5 permit 10.0.0.1/32' + -c 'ip prefix-list PREF2 seq 5 permit 10.0.0.2/32' + -c 'ip prefix-list PREF3 seq 5 permit 10.0.0.3/32' + -c '!' + -c 'route-map COM1 permit 1' -c 'set community 65002:1' -c 'exit' + -c 'route-map COM2 permit 1' -c 'set community 65002:2' -c 'exit' + -c 'route-map COM3 permit 1' -c 'set community 65002:3' -c 'exit' + + - name: R3 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface net0' -c 'ipv6 nd ra-interval 3' -c 'no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65003' + -c ' bgp router-id 10.255.0.3' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor net0 interface peer-group PEER' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' neighbor net0 route-map MAP1 in' + -c ' exit-address-family' + -c '!' + -c 'route-map MAP1 permit 1' + -c ' match ip address prefix-list PREF2' + -c ' !match community 65002:2' + -c ' exit' + -c '!' + -c 'ip prefix-list PREF1 seq 5 permit 10.0.0.1/32' + -c 'ip prefix-list PREF2 seq 5 permit 10.0.0.2/32' + -c 'ip prefix-list PREF3 seq 5 permit 10.0.0.3/32' + + - name: R4 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface net0' -c 'ipv6 nd ra-interval 3' -c 'no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65004' + -c ' bgp router-id 10.255.0.4' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor net0 interface peer-group PEER' + -c '!' + -c 'ip prefix-list PREF1 seq 5 permit 10.0.0.1/32' + -c 'ip prefix-list PREF2 seq 5 permit 10.0.0.2/32' + -c 'ip prefix-list PREF3 seq 5 permit 10.0.0.3/32' + diff --git a/examples/basic_bgp/path_attr/topo.png b/examples/basic_bgp/path_attr/topo.png new file mode 100644 index 0000000..77a22ce Binary files /dev/null and b/examples/basic_bgp/path_attr/topo.png differ diff --git a/examples/basic_bgp/spec.yaml b/examples/basic_bgp/spec.yaml new file mode 100644 index 0000000..8739d69 --- /dev/null +++ b/examples/basic_bgp/spec.yaml @@ -0,0 +1,31 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: >- + vtysh -c "conf t" + -c "router bgp 65001" + -c "bgp router-id 10.255.0.1" + -c "neighbor 10.0.0.2 remote-as 65002" + - name: R2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: >- + vtysh -c "conf t" + -c "router bgp 65002" + -c "bgp router-id 10.255.0.2" + -c "neighbor 10.0.0.1 remote-as 65001" + diff --git a/examples/basic_bgp/unnumbered/r1.pcap b/examples/basic_bgp/unnumbered/r1.pcap new file mode 100644 index 0000000..044b593 Binary files /dev/null and b/examples/basic_bgp/unnumbered/r1.pcap differ diff --git a/examples/basic_bgp/unnumbered/spec.yaml b/examples/basic_bgp/unnumbered/spec.yaml new file mode 100644 index 0000000..9bad27e --- /dev/null +++ b/examples/basic_bgp/unnumbered/spec.yaml @@ -0,0 +1,66 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface lo' + -c ' ip address 10.255.0.1/32' + -c '!' + -c 'interface net0' + -c ' ipv6 nd ra-interval 3' + -c ' no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65001' + -c ' bgp router-id 10.255.0.1' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor net0 interface peer-group PEER' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' redistribute connected route-map redis_lo' + -c ' exit-address-family' + -c '!' + -c 'route-map redis_lo permit 10' + -c ' match interface lo' + + - name: R2 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'interface lo' + -c ' ip address 10.255.0.2/32' + -c '!' + -c 'interface net0' + -c ' ipv6 nd ra-interval 3' + -c ' no ipv6 nd suppress-ra' + -c '!' + -c 'router bgp 65002' + -c ' bgp router-id 10.255.0.2' + -c ' bgp bestpath as-path multipath-relax' + -c ' neighbor PEER peer-group' + -c ' neighbor PEER remote-as external' + -c ' neighbor net0 interface peer-group PEER' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' redistribute connected route-map redis_lo' + -c ' exit-address-family' + -c '!' + -c 'route-map redis_lo permit 10' + -c ' match interface lo' + diff --git a/examples/basic_bgp/vrf2vrf_rouet_leak/Makefile b/examples/basic_bgp/vrf2vrf_rouet_leak/Makefile new file mode 100644 index 0000000..480bafa --- /dev/null +++ b/examples/basic_bgp/vrf2vrf_rouet_leak/Makefile @@ -0,0 +1,9 @@ + +sh: + docker exec R1 ip route list + @echo + docker exec R1 ip route list vrf red + @echo + docker exec R1 ip route list vrf blu + @echo + docker exec R1 ip route list vrf grn diff --git a/examples/basic_bgp/vrf2vrf_rouet_leak/spec.yaml b/examples/basic_bgp/vrf2vrf_rouet_leak/spec.yaml new file mode 100644 index 0000000..882dad2 --- /dev/null +++ b/examples/basic_bgp/vrf2vrf_rouet_leak/spec.yaml @@ -0,0 +1,42 @@ + +nodes: + - name: R1 + image: slankdev/frr-dev:latest + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/frr-dev:latest + interfaces: + - { name: net0, type: direct, args: R1#net0 } + + +node_configs: + - name: R1 + cmds: + - cmd: ip link add red type vrf table 10 + - cmd: ip link add blu type vrf table 20 + - cmd: ip link add grn type vrf table 30 + - cmd: ip link set red up + - cmd: ip link set blu up + - cmd: ip link set grn up + - cmd: ip link set net0 vrf red + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c 'conf t' + -c 'int net0' -c 'ip addr 10.0.0.1/24' -c 'exit' + -c 'router bgp 1 vrf red' + -c ' bgp router-id 1.1.1.1' + -c ' address-family ipv4 unicast' + -c ' redistribute connected' + -c ' exit-address-family' + -c 'router bgp 2 vrf blu' + -c ' bgp router-id 2.2.2.2' + -c ' address-family ipv4 unicast' + -c ' import vrf red' + -c ' exit-address-family' + -c 'router bgp 3 vrf grn' + -c ' bgp router-id 3.3.3.3' + -c ' address-family ipv4 unicast' + -c ' import vrf blu' + -c ' exit-address-family' + diff --git a/examples/basic_bgp_mpls_vpnv4/README.md b/examples/basic_bgp_mpls_vpnv4/README.md new file mode 100644 index 0000000..2b6e1ea --- /dev/null +++ b/examples/basic_bgp_mpls_vpnv4/README.md @@ -0,0 +1,61 @@ + +# MP-BGP VPNv4 per-VRF w/ MPLS + +![](./topo.png) + +references: configure example of vpnv4 as small set. +https://gist.github.com/hkwi/5c116f05667a3abf43c7456fae32a529 + +setup +``` +$ tn upconf | sudo sh +``` + +check vpn routes on R1 +``` +$ docker exec R1 vtysh -c 'show bgp ipv4 vpn' +BGP table version is 1, local router ID is 10.255.0.1, vrf id 0 +Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, + i internal, r RIB-failure, S Stale, R Removed +Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self +Origin codes: i - IGP, e - EGP, ? - incomplete + + Network Next Hop Metric LocPrf Weight Path +Route Distinguisher: 65001:1 +*> 20.1.0.0/24 0.0.0.0@6< 0 32768 ? + UN=0.0.0.0 EC{100:1} label=80 type=bgp, subtype=5 +Route Distinguisher: 65001:2 +*> 20.3.0.0/24 0.0.0.0@7< 0 32768 ? + UN=0.0.0.0 EC{100:2} label=81 type=bgp, subtype=5 +Route Distinguisher: 65001:3 +*> 20.5.0.0/24 0.0.0.0@8< 0 32768 ? + UN=0.0.0.0 EC{100:1} label=82 type=bgp, subtype=5 +Route Distinguisher: 65002:1 +*> 20.2.0.0/24 10.0.0.2 0 0 65002 ? + UN=10.0.0.2 EC{100:1} label=80 type=bgp, subtype=0 +Route Distinguisher: 65002:2 +*> 20.4.0.0/24 10.0.0.2 0 0 65002 ? + UN=10.0.0.2 EC{100:2} label=81 type=bgp, subtype=0 +Route Distinguisher: 65002:3 +*> 20.6.0.0/24 10.0.0.2 0 0 65002 ? + UN=10.0.0.2 EC{100:2} label=82 type=bgp, subtype=0 + +Displayed 6 routes and 6 total paths +``` + +check vrf's route on VRF1 on R1 (VPNv4 rt100:1) +``` +docker exec R1 vtysh -c 'show ip route vrf vrf1' +Codes: K - kernel route, C - connected, S - static, R - RIP, + O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, + T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, + F - PBR, + > - selected route, * - FIB route + + +VRF vrf1: +C>* 20.1.0.0/24 is directly connected, net1, 00:01:37 +B>* 20.2.0.0/24 [200/0] via 10.0.0.2, net0(vrf Default-IP-Routing-Table), label 80, 00:01:30 +B>* 20.5.0.0/24 [200/0] is directly connected, net3(vrf vrf3), 00:01:37 +``` + diff --git a/examples/basic_bgp_mpls_vpnv4/r1.pcap b/examples/basic_bgp_mpls_vpnv4/r1.pcap new file mode 100644 index 0000000..08b9bbb Binary files /dev/null and b/examples/basic_bgp_mpls_vpnv4/r1.pcap differ diff --git a/examples/basic_bgp_mpls_vpnv4/r2.pcap b/examples/basic_bgp_mpls_vpnv4/r2.pcap new file mode 100644 index 0000000..76879f7 Binary files /dev/null and b/examples/basic_bgp_mpls_vpnv4/r2.pcap differ diff --git a/examples/basic_bgp_mpls_vpnv4/spec.yaml b/examples/basic_bgp_mpls_vpnv4/spec.yaml new file mode 100644 index 0000000..b79a5a3 --- /dev/null +++ b/examples/basic_bgp_mpls_vpnv4/spec.yaml @@ -0,0 +1,223 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: C1#net0 } + - { name: net2, type: direct, args: C3#net0 } + - { name: net3, type: direct, args: C5#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: C2#net0 } + - { name: net2, type: direct, args: C4#net0 } + - { name: net3, type: direct, args: C6#net0 } + - name: C1 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R1#net1 } ] + - name: C2 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R2#net1 } ] + - name: C3 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R1#net2 } ] + - name: C4 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R2#net2 } ] + - name: C5 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R1#net3 } ] + - name: C6 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R2#net3 } ] + +node_configs: + - name: R1 + cmds: + - cmd: sh -c 'echo 100000 > /proc/sys/net/mpls/platform_labels' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net0/input' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net1/input' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net2/input' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net3/input' + - cmd: ip link add vrf1 type vrf table 10 + - cmd: ip link set vrf1 up + - cmd: ip link add vrf2 type vrf table 20 + - cmd: ip link set vrf2 up + - cmd: ip link add vrf3 type vrf table 30 + - cmd: ip link set vrf3 up + - cmd: ip link set net1 vrf vrf1 + - cmd: ip link set net2 vrf vrf2 + - cmd: ip link set net3 vrf vrf3 + - cmd: tcpdump -ni net0 -w /tmp/R1.in.pcap & + + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf te' + -c 'int net0' + -c ' ip address 10.0.0.1/24' + -c '!' + -c 'int net1 vrf vrf1' + -c ' ip address 20.1.0.1/24' + -c '!' + -c 'int net2 vrf vrf2' + -c ' ip address 20.3.0.1/24' + -c '!' + -c 'int net3 vrf vrf3' + -c ' ip address 20.5.0.1/24' + -c '!' + -c 'router bgp 65001' + -c ' bgp router-id 10.255.0.1' + -c ' neighbor 10.0.0.2 remote-as 65002' + -c ' !' + -c ' address-family ipv4 unicast' + -c ' neighbor 10.0.0.2 activate' + -c ' redistribute connected' + -c ' redistribute static' + -c ' exit-address-family' + -c ' !' + -c ' address-family ipv4 vpn' + -c ' neighbor 10.0.0.2 activate' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65001 vrf vrf1' + -c ' address-family ipv4' + -c ' export vpn' + -c ' import vpn' + -c ' rd vpn export 65001:1' + -c ' rt vpn both 100:1' + -c ' label vpn export auto' + -c ' redistribute connected' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65001 vrf vrf2' + -c ' address-family ipv4' + -c ' export vpn' + -c ' import vpn' + -c ' rd vpn export 65001:2' + -c ' rt vpn both 100:2' + -c ' label vpn export auto' + -c ' redistribute connected' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65001 vrf vrf3' + -c ' address-family ipv4' + -c ' export vpn' + -c ' import vpn' + -c ' rd vpn export 65001:3' + -c ' rt vpn both 100:1' + -c ' label vpn export auto' + -c ' redistribute connected' + -c ' exit-address-family' + -c '!' + + - name: R2 + cmds: + - cmd: sh -c 'echo 100000 > /proc/sys/net/mpls/platform_labels' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net0/input' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net1/input' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net2/input' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net3/input' + - cmd: ip link add vrf1 type vrf table 10 + - cmd: ip link set vrf1 up + - cmd: ip link add vrf2 type vrf table 20 + - cmd: ip link set vrf2 up + - cmd: ip link add vrf3 type vrf table 30 + - cmd: ip link set vrf3 up + - cmd: ip link set net1 vrf vrf1 + - cmd: ip link set net2 vrf vrf2 + - cmd: ip link set net3 vrf vrf3 + - cmd: tcpdump -ni net0 -w /tmp/R2.in.pcap & + + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf te' + -c 'int net0' + -c ' ip address 10.0.0.2/24' + -c '!' + -c 'int net1 vrf vrf1' + -c ' ip address 20.2.0.1/24' + -c '!' + -c 'int net2 vrf vrf2' + -c ' ip address 20.4.0.1/24' + -c '!' + -c 'int net3 vrf vrf3' + -c ' ip address 20.6.0.1/24' + -c '!' + -c 'router bgp 65002' + -c ' bgp router-id 10.255.0.2' + -c ' neighbor 10.0.0.1 remote-as 65001' + -c ' !' + -c ' address-family ipv4' + -c ' neighbor 10.0.0.1 activate' + -c ' redistribute connected' + -c ' redistribute static' + -c ' exit-address-family' + -c ' !' + -c ' address-family ipv4 vpn' + -c ' neighbor 10.0.0.1 activate' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65002 vrf vrf1' + -c ' address-family ipv4' + -c ' export vpn' + -c ' import vpn' + -c ' rd vpn export 65002:1' + -c ' rt vpn both 100:1' + -c ' label vpn export auto' + -c ' redistribute connected' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65002 vrf vrf2' + -c ' address-family ipv4' + -c ' export vpn' + -c ' import vpn' + -c ' rd vpn export 65002:2' + -c ' rt vpn both 100:2' + -c ' label vpn export auto' + -c ' redistribute connected' + -c ' exit-address-family' + -c '!' + -c 'router bgp 65002 vrf vrf3' + -c ' address-family ipv4' + -c ' export vpn' + -c ' import vpn' + -c ' rd vpn export 65002:3' + -c ' rt vpn both 100:2' + -c ' label vpn export auto' + -c ' redistribute connected' + -c ' exit-address-family' + -c '!' + + - name: C1 + cmds: + - cmd: ip addr replace 20.1.0.2/24 dev net0 + - cmd: ip route replace default via 20.1.0.1 + - name: C2 + cmds: + - cmd: ip addr replace 20.2.0.2/24 dev net0 + - cmd: ip route replace default via 20.2.0.1 + - name: C3 + cmds: + - cmd: ip addr replace 20.3.0.2/24 dev net0 + - cmd: ip route replace default via 20.3.0.1 + - name: C4 + cmds: + - cmd: ip addr replace 20.4.0.2/24 dev net0 + - cmd: ip route replace default via 20.4.0.1 + - name: C5 + cmds: + - cmd: ip addr replace 20.5.0.2/24 dev net0 + - cmd: ip route replace default via 20.5.0.1 + - name: C6 + cmds: + - cmd: ip addr replace 20.6.0.2/24 dev net0 + - cmd: ip route replace default via 20.6.0.1 + +test: + - name: p2p + cmds: + - cmd: echo slankdev slankdev + - cmd: echo slankdev slankdev + diff --git a/examples/basic_bgp_mpls_vpnv4/topo.png b/examples/basic_bgp_mpls_vpnv4/topo.png new file mode 100644 index 0000000..9d4a0b1 Binary files /dev/null and b/examples/basic_bgp_mpls_vpnv4/topo.png differ diff --git a/examples/basic_bgp_srv6_vpnv4/Makefile b/examples/basic_bgp_srv6_vpnv4/Makefile new file mode 100644 index 0000000..a5d1689 --- /dev/null +++ b/examples/basic_bgp_srv6_vpnv4/Makefile @@ -0,0 +1,89 @@ + +help: + @echo help + +build: + make -C /home/vagrant/git/frr.slankdev + sudo make -C /home/vagrant/git/frr.slankdev install + +install: + docker exec R1 rm -rf /usr/lib/frr + docker cp /usr/lib/frr R1:/usr/lib/frr + docker cp /usr/bin/vtysh R1:/usr/bin/vtysh + \ + docker exec R2 rm -rf /usr/lib/frr + docker cp /usr/lib/frr R2:/usr/lib/frr + docker cp /usr/bin/vtysh R2:/usr/bin/vtysh + +config_srv6_only: + docker cp frr.conf.srv6.R1 R1:/etc/frr/frr.conf + docker cp frr.conf.srv6.R2 R2:/etc/frr/frr.conf + +stop: + docker exec R1 /usr/lib/frr/frrinit.sh stop + docker exec R2 /usr/lib/frr/frrinit.sh stop + +start: + docker exec R1 /usr/lib/frr/frrinit.sh start + docker exec R2 /usr/lib/frr/frrinit.sh start + +restart: + docker exec R1 /usr/lib/frr/frrinit.sh restart + docker exec R2 /usr/lib/frr/frrinit.sh restart + +capture: + docker exec R1 pkill tcpdump | true + docker exec R2 pkill tcpdump | true + docker exec -d R1 tcpdump -ni net0 -w /tmp/r1.pcap + docker exec -d R2 tcpdump -ni net0 -w /tmp/r2.pcap + +nocapture: + docker exec R1 pkill tcpdump | true + docker exec R2 pkill tcpdump | true + docker cp R1:/tmp/r1.pcap /vagrant/r1.pcap + docker cp R2:/tmp/r2.pcap /vagrant/r2.pcap + +rere: + make -C . build + make -C . install + make -C . reload + +taillog_R1: + while :; do \ + docker exec -it R1 touch /tmp/frr.log; \ + docker exec -it R1 chown frr.frr /tmp/frr.log; \ + docker exec -it R1 tail -f /tmp/frr.log -n0; \ + sleep 1 ; done +taillog_R2: + while :; do \ + docker exec -it R2 touch /tmp/frr.log; \ + docker exec -it R2 chown frr.frr /tmp/frr.log; \ + docker exec -it R2 tail -f /tmp/frr.log -n0; \ + sleep 1 ; done + +tn_reconf: + tn reconf | sudo sh + make -C . install + make -C . config_srv6_only + +sh_route_vrfs: + @echo -e '\n[[R1-glb]]' + @docker exec R1 ip route list + @docker exec R1 ip -6 route list + @echo -e '\n[[R1-vrf1]]' + @docker exec R1 ip route list vrf vrf1 + @echo -e '\n[[R1-vrf2]]' + @docker exec R1 ip route list vrf vrf2 + @echo -e '\n[[R1-vrf3]]' + @docker exec R1 ip route list vrf vrf3 + @echo -e '\n[[R2-glb]]' + @docker exec R2 ip route list + @docker exec R2 ip -6 route list + @echo -e '\n[[R2-vrf1]]' + @docker exec R2 ip route list vrf vrf1 + @echo -e '\n[[R2-vrf2]]' + @docker exec R2 ip route list vrf vrf2 + @echo -e '\n[[R2-vrf3]]' + @docker exec R2 ip route list vrf vrf3 + @echo + diff --git a/examples/basic_bgp_srv6_vpnv4/README.md b/examples/basic_bgp_srv6_vpnv4/README.md new file mode 100644 index 0000000..b079c37 --- /dev/null +++ b/examples/basic_bgp_srv6_vpnv4/README.md @@ -0,0 +1,61 @@ + +# FRR meets BGP-SRv6-VPNv4 + +MP-BGP VPNv4 per-VRF w/ SRv6..? + +![](./topo.png) + +``` +$ make sh_route_vrfs + +[[R1-glb]] +169.254.99.10 dev vrf1 scope link +169.254.99.20 dev vrf2 scope link +169.254.99.30 dev vrf3 scope link +1:1:: encap seg6local action End.DX4 nh4 169.254.99.10 dev net0 metric 1024 pref medium +1:2:: encap seg6local action End.DX4 nh4 169.254.99.20 dev net0 metric 1024 pref medium +1:3:: encap seg6local action End.DX4 nh4 169.254.99.30 dev net0 metric 1024 pref medium +2:1:: via 2001::2 dev net0 metric 1024 pref medium +2:2:: via 2001::2 dev net0 metric 1024 pref medium +2:3:: via 2001::2 dev net0 metric 1024 pref medium +2001::/64 dev net0 proto kernel metric 256 pref medium +fe80::/64 dev net0 proto kernel metric 256 pref medium + +[[R1-vrf1]] +30.1.0.0/24 dev net1 proto kernel scope link src 30.1.0.1 +30.2.0.0/24 encap seg6 mode encap segs 1 [ 2:1:: ] dev net0 scope link + +[[R1-vrf2]] +30.3.0.0/24 dev net2 proto kernel scope link src 30.3.0.1 +30.4.0.0/24 encap seg6 mode encap segs 1 [ 2:2:: ] dev net0 scope link + +[[R1-vrf3]] +30.5.0.0/24 dev net3 proto kernel scope link src 30.5.0.1 +30.6.0.0/24 encap seg6 mode encap segs 1 [ 2:3:: ] dev net0 scope link + +[[R2-glb]] +169.254.99.10 dev vrf1 scope link +169.254.99.20 dev vrf2 scope link +169.254.99.30 dev vrf3 scope link +1:1:: via 2001::1 dev net0 metric 1024 pref medium +1:2:: via 2001::1 dev net0 metric 1024 pref medium +1:3:: via 2001::1 dev net0 metric 1024 pref medium +2:1:: encap seg6local action End.DX4 nh4 169.254.99.10 dev net0 metric 1024 pref medium +2:2:: encap seg6local action End.DX4 nh4 169.254.99.20 dev net0 metric 1024 pref medium +2:3:: encap seg6local action End.DX4 nh4 169.254.99.30 dev net0 metric 1024 pref medium +2001::/64 dev net0 proto kernel metric 256 pref medium +fe80::/64 dev net0 proto kernel metric 256 pref medium + +[[R2-vrf1]] +30.1.0.0/24 encap seg6 mode encap segs 1 [ 1:1:: ] dev net0 scope link +30.2.0.0/24 dev net1 proto kernel scope link src 30.2.0.1 + +[[R2-vrf2]] +30.3.0.0/24 encap seg6 mode encap segs 1 [ 1:2:: ] dev net0 scope link +30.4.0.0/24 dev net2 proto kernel scope link src 30.4.0.1 + +[[R2-vrf3]] +30.5.0.0/24 encap seg6 mode encap segs 1 [ 1:3:: ] dev net0 scope link +30.6.0.0/24 dev net3 proto kernel scope link src 30.6.0.1 +``` + diff --git a/examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R1 b/examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R1 new file mode 100644 index 0000000..210900c --- /dev/null +++ b/examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R1 @@ -0,0 +1,72 @@ +hostname R1 +log file /tmp/frr.log +! +debug bgp vpn label +debug bgp vpn leak-from-vrf +debug bgp vpn leak-to-vrf +debug bgp vpn rmap-event +debug bgp vpn adv-prefix-sid +! +int net0 + ipv6 address 2001::1/64 +! +int net1 vrf vrf1 + ip address 30.1.0.1/24 +! +int net2 vrf vrf2 + ip address 30.3.0.1/24 +! +int net3 vrf vrf3 + ip address 30.5.0.1/24 +! +router bgp 65001 + bgp router-id 10.255.0.1 + neighbor 2001::2 remote-as 65002 + ! + address-family ipv4 unicast + redistribute connected + redistribute static + exit-address-family + ! + address-family ipv4 srv6-vpn + neighbor 2001::2 activate + exit-address-family +! +router bgp 65001 vrf vrf1 + bgp router-id 10.255.0.1 + ! + address-family ipv4 unicast + redistribute connected + sid srv6-vpn export 1:1:: + rd srv6-vpn export 65001:1 + rt srv6-vpn both 100:1 + export srv6-vpn + import srv6-vpn + exit-address-family +! +router bgp 65001 vrf vrf2 + bgp router-id 10.255.0.1 + ! + address-family ipv4 unicast + redistribute connected + sid srv6-vpn export 1:2:: + rd srv6-vpn export 65001:2 + rt srv6-vpn both 100:2 + export srv6-vpn + import srv6-vpn + exit-address-family +! +router bgp 65001 vrf vrf3 + bgp router-id 10.255.0.1 + ! + address-family ipv4 unicast + redistribute connected + sid srv6-vpn export 1:3:: + rd srv6-vpn export 65001:3 + rt srv6-vpn both 100:3 + export srv6-vpn + import srv6-vpn + exit-address-family +! +line vty +! diff --git a/examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R2 b/examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R2 new file mode 100644 index 0000000..adb3f46 --- /dev/null +++ b/examples/basic_bgp_srv6_vpnv4/frr.conf.srv6.R2 @@ -0,0 +1,72 @@ +hostname R2 +log file /tmp/frr.log +! +debug bgp vpn label +debug bgp vpn leak-from-vrf +debug bgp vpn leak-to-vrf +debug bgp vpn rmap-event +debug bgp vpn adv-prefix-sid +! +int net0 + ipv6 address 2001::2/64 +! +int net1 vrf vrf1 + ip address 30.2.0.1/24 +! +int net2 vrf vrf2 + ip address 30.4.0.1/24 +! +int net3 vrf vrf3 + ip address 30.6.0.1/24 +! +router bgp 65002 + bgp router-id 10.255.0.2 + neighbor 2001::1 remote-as 65001 + ! + address-family ipv4 unicast + redistribute connected + redistribute static + exit-address-family + ! + address-family ipv4 srv6-vpn + neighbor 2001::1 activate + exit-address-family +! +router bgp 65002 vrf vrf1 + bgp router-id 10.255.0.2 + ! + address-family ipv4 unicast + redistribute connected + sid srv6-vpn export 2:1:: + rd srv6-vpn export 65002:1 + rt srv6-vpn both 100:1 + export srv6-vpn + import srv6-vpn + exit-address-family +! +router bgp 65002 vrf vrf2 + bgp router-id 10.255.0.2 + ! + address-family ipv4 unicast + redistribute connected + sid srv6-vpn export 2:2:: + rd srv6-vpn export 65002:2 + rt srv6-vpn both 100:2 + export srv6-vpn + import srv6-vpn + exit-address-family +! +router bgp 65002 vrf vrf3 + bgp router-id 10.255.0.2 + ! + address-family ipv4 unicast + redistribute connected + sid srv6-vpn export 2:3:: + rd srv6-vpn export 65002:3 + rt srv6-vpn both 100:3 + export srv6-vpn + import srv6-vpn + exit-address-family +! +line vty +! diff --git a/examples/basic_bgp_srv6_vpnv4/spec.yaml b/examples/basic_bgp_srv6_vpnv4/spec.yaml new file mode 100644 index 0000000..a5cfcc4 --- /dev/null +++ b/examples/basic_bgp_srv6_vpnv4/spec.yaml @@ -0,0 +1,104 @@ + +nodes: + + - name: R1 + image: slankdev/frr-7.3:slankdev-support-mpbgp-vpnv4-srv6-cplane + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: C1#net0 } + - { name: net2, type: direct, args: C3#net0 } + - { name: net3, type: direct, args: C5#net0 } + + - name: R2 + image: slankdev/frr-7.3:slankdev-support-mpbgp-vpnv4-srv6-cplane + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: C2#net0 } + - { name: net2, type: direct, args: C4#net0 } + - { name: net3, type: direct, args: C6#net0 } + + - name: C1 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R1#net1 } ] + - name: C2 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R2#net1 } ] + - name: C3 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R1#net2 } ] + - name: C4 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R2#net2 } ] + - name: C5 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R1#net3 } ] + - name: C6 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: R2#net3 } ] + +node_configs: + - name: R1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: touch /etc/frr/frr.conf + + - cmd: ip link add vrf1 type vrf table 10 + - cmd: ip link set vrf1 up + - cmd: ip link set net1 vrf vrf1 + - cmd: ip route add 169.254.99.10 dev vrf1 + + - cmd: ip link add vrf2 type vrf table 20 + - cmd: ip link set vrf2 up + - cmd: ip link set net2 vrf vrf2 + - cmd: ip route add 169.254.99.20 dev vrf2 + + - cmd: ip link add vrf3 type vrf table 30 + - cmd: ip link set vrf3 up + - cmd: ip link set net3 vrf vrf3 + - cmd: ip route add 169.254.99.30 dev vrf3 + + - name: R2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: touch /etc/frr/frr.conf + + - cmd: ip link add vrf1 type vrf table 10 + - cmd: ip link set vrf1 up + - cmd: ip link set net1 vrf vrf1 + - cmd: ip route add 169.254.99.10 dev vrf1 + + - cmd: ip link add vrf2 type vrf table 20 + - cmd: ip link set vrf2 up + - cmd: ip link set net2 vrf vrf2 + - cmd: ip route add 169.254.99.20 dev vrf2 + + - cmd: ip link add vrf3 type vrf table 30 + - cmd: ip link set vrf3 up + - cmd: ip link set net3 vrf vrf3 + - cmd: ip route add 169.254.99.30 dev vrf3 + + - name: C1 + cmds: + - cmd: ip addr replace 30.1.0.2/24 dev net0 + - cmd: ip route replace default via 30.1.0.1 + - name: C2 + cmds: + - cmd: ip addr replace 30.2.0.2/24 dev net0 + - cmd: ip route replace default via 30.2.0.1 + - name: C3 + cmds: + - cmd: ip addr replace 30.3.0.2/24 dev net0 + - cmd: ip route replace default via 30.3.0.1 + - name: C4 + cmds: + - cmd: ip addr replace 30.4.0.2/24 dev net0 + - cmd: ip route replace default via 30.4.0.1 + - name: C5 + cmds: + - cmd: ip addr replace 30.5.0.2/24 dev net0 + - cmd: ip route replace default via 30.5.0.1 + - name: C6 + cmds: + - cmd: ip addr replace 30.6.0.2/24 dev net0 + - cmd: ip route replace default via 30.6.0.1 + diff --git a/examples/basic_bgp_srv6_vpnv4/topo.png b/examples/basic_bgp_srv6_vpnv4/topo.png new file mode 100644 index 0000000..21be7cc Binary files /dev/null and b/examples/basic_bgp_srv6_vpnv4/topo.png differ diff --git a/examples/basic_bgp_unumbered/spec.yaml b/examples/basic_bgp_unumbered/spec.yaml new file mode 100644 index 0000000..d9fcef0 --- /dev/null +++ b/examples/basic_bgp_unumbered/spec.yaml @@ -0,0 +1,92 @@ + +# DESCRIPTION: BGP network using FRR +# +# INIT: +# cns spec.yaml init | sudo sh +# cns spec.yaml conf | sudo sh +# cns spec.yaml test | sudo sh +# +# FINI: +# cns spec.yaml fini | sudo sh +# +# TOPO: +# +# vlan1:10.0.0.0/24 +# .1(net0) .2(net0) +# R0(AS100)------------------R1(AS200) +# (net1).1| |.1(net1) +# | | +# vlan1:10.1.0.0/24 | | vlan1:10.2.0.0/24 +# | | +# (net0).2| |.2(net0) +# R2(AS300) R3(AS400) +# (net1).1| |.1(net1) +# | | +# vlan1:10.3.0.0/24 | | vlan1:10.4.0.0/24 +# | | +# (net0).2| |.2(net0) +# C0 C1 +# + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 1" + -c " bgp router-id 1.1.1.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " redistribute kernel" + -c " exit-address-family" + + # -c "int net0" + # -c " !ipv6 nd ra-interval 1" + # -c " !no ipv6 nd suppress-ra" + # -c " !ip address 10.0.0.2/24" + # -c "!" + - name: R2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 2" + -c " bgp router-id 2.2.2.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " redistribute kernel" + -c " exit-address-family" + + # -c "int net0" + # -c " !ipv6 nd ra-interval 1" + # -c " !no ipv6 nd suppress-ra" + # -c " !ip address 10.0.0.2/24" + # -c "!" + diff --git a/examples/basic_bond/spec.yaml b/examples/basic_bond/spec.yaml new file mode 100644 index 0000000..650b98d --- /dev/null +++ b/examples/basic_bond/spec.yaml @@ -0,0 +1,45 @@ + +precmd: + - cmds: + - cmd: export IMAGE=slankdev/frr + - cmd: export IMAGE=slankdev/gobgp + - cmd: export IMAGE=slankdev/ubuntu:18.04 + +nodes: + - name: R1 + image: $IMAGE + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R2#net1 } + - name: R2 + image: $IMAGE + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R1#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: ip link add bond0 type bond miimon 100 mode active-backup + - cmd: ip link set bond0 up + - cmd: ip link set net0 down + - cmd: ip link set net1 down + - cmd: ip link set net0 master bond0 + - cmd: ip link set net1 master bond0 + - cmd: ip addr add 10.0.0.1/24 dev bond0 + - name: R2 + cmds: + - cmd: ip link add bond0 type bond miimon 100 mode active-backup + - cmd: ip link set bond0 up + - cmd: ip link set net0 down + - cmd: ip link set net1 down + - cmd: ip link set net0 master bond0 + - cmd: ip link set net1 master bond0 + - cmd: ip addr add 10.0.0.2/24 dev bond0 + +test: + - name: p2p + cmds: + - cmd: echo slankdev slankdev + - cmd: echo slankdev slankdev + diff --git a/examples/basic_clos/README.md b/examples/basic_clos/README.md new file mode 100644 index 0000000..a2fbae4 --- /dev/null +++ b/examples/basic_clos/README.md @@ -0,0 +1,51 @@ + +# CLOS Topology + +Practice of designing DCN. Following are principle of Design. +- using modernaized technology (such as BGP-unnumbered.) + +Version +- 0.0.0: basic CLOS-network ([yaml](./spec.v0.0.0.yaml)) +- 0.0.1: using BGP-unnumbered ([yaml](./spec.v0.0.1.yaml)) +- 0.0.2: using ECMP anycast ([yaml](./spec.v0.0.2.yaml)) +- 0.0.3: add VM and ToR nodes ([yaml](./spec.v0.0.3.yaml)) +- 0.0.4: support multi-tenancy ([yaml](./spec.v0.0.4.yaml)) (**currentry version**) +- 0.0.5: support SRv6 network slicing ([yaml](./spec.v0.0.5.yaml)) + +**version v0.0.3** +![](./topo.v0.0.3.png) + +**version v0.0.2** +![](./topo.v0.0.2.png) + +**version v0.0.1** +![](./topo.v0.0.1.png) + +**version v0.0.0** +![](./topo.v0.0.0.png) + +references +- LINE-SRv6-DCN ENOG55 http://enog.jp/wp-content/uploads/2018/12/05_20190222_ENOG55_LINE.pdf +- Large Scale DC Network Design https://www.slideshare.net/MasayukiKobayashi/dc-66865243 +- Good TiNET examples by MIYA-kun https://github.com/mi2428/netben +- LINE DCN Overview by Kobayashi-san 2018.10 https://www.slideshare.net/linecorp/ss-116867631 +- About designing the LINE-NW from scrach by Kobayashi-san 2019.01 https://www.janog.gr.jp/meeting/janog43/application/files/7915/4823/1858/janog43-line-kobayashi.pdf +- OpenStack Summit Vancouver 2018 Recap LINE-verda https://engineering.linecorp.com/ja/blog/openstack-summit-vancouver-2018-recap-2-2 + +operation performance +``` +v0.0.3 sh -c 'tn up | sudo sh' +real 0m29.151s +user 0m6.945s +sys 0m4.472s + +v0.0.3 sh -c 'tn conf | sudo sh' frr-all +real 1m25.104s +user 0m6.110s +sys 0m4.263s + +v0.0.3 sh -c 'tn conf | sudo sh' frr-zebra,bgpd +real 1m13.867s +user 0m6.239s +sys 0m4.143s +``` diff --git a/examples/basic_clos/spec.v0.0.0.yaml b/examples/basic_clos/spec.v0.0.0.yaml new file mode 100644 index 0000000..b5b5cbe --- /dev/null +++ b/examples/basic_clos/spec.v0.0.0.yaml @@ -0,0 +1,300 @@ + +nodes: + - name: Ext1 + image: slankdev/frr + interfaces: + # - { name: net0, type: direct, args: Internet#net0 } + - { name: net1, type: direct, args: Spine1#dn1 } + - { name: net2, type: direct, args: Spine2#dn1 } + - name: Spine1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#net1 } + - { name: dn1, type: direct, args: Leaf1#up1 } + - { name: dn2, type: direct, args: Leaf2#up1 } + - { name: dn3, type: direct, args: Leaf3#up1 } + - { name: dn4, type: direct, args: Leaf4#up1 } + - name: Spine2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#net2 } + - { name: dn1, type: direct, args: Leaf1#up2 } + - { name: dn2, type: direct, args: Leaf2#up2 } + - { name: dn3, type: direct, args: Leaf3#up2 } + - { name: dn4, type: direct, args: Leaf4#up2 } + - name: Leaf1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn1 } + - { name: up2, type: direct, args: Spine2#dn1 } + - { name: dn1, type: direct, args: Serv1#net0 } + - { name: dn2, type: direct, args: Serv2#net0 } + - name: Leaf2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn2 } + - { name: up2, type: direct, args: Spine2#dn2 } + - { name: dn1, type: direct, args: Serv3#net0 } + - { name: dn2, type: direct, args: Serv4#net0 } + - name: Leaf3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn3 } + - { name: up2, type: direct, args: Spine2#dn3 } + - { name: dn1, type: direct, args: Serv3#net0 } + - { name: dn2, type: direct, args: Serv4#net0 } + - name: Leaf4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn4 } + - { name: up2, type: direct, args: Spine2#dn4 } + - { name: dn1, type: direct, args: Serv3#net0 } + - { name: dn2, type: direct, args: Serv4#net0 } + - name: Serv1 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf1#dn1 } ] + - name: Serv2 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf1#dn2 } ] + - name: Serv3 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf2#dn1 } ] + - name: Serv4 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf2#dn2 } ] + - name: Serv5 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf3#dn1 } ] + - name: Serv6 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf3#dn2 } ] + - name: Serv7 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf4#dn1 } ] + - name: Serv8 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf4#dn2 } ] + +node_configs: + - name: Ext1 + cmds: + - cmd: echo slankdev slankdev + - name: Spine1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.1/32" + -c "int dn1" -c "ip addr 10.0.0.1/30" + -c "int dn2" -c "ip addr 10.0.0.5/30" + -c "int dn3" -c "ip addr 10.0.0.9/30" + -c "int dn4" -c "ip addr 10.0.0.13/30" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 10.0.0.2 remote-as 65011" + -c " neighbor 10.0.0.6 remote-as 65012" + -c " neighbor 10.0.0.10 remote-as 65013" + -c " neighbor 10.0.0.14 remote-as 65014" + - name: Spine2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.2/32" + -c "int dn1" -c "ip addr 10.0.0.17/30" + -c "int dn2" -c "ip addr 10.0.0.21/30" + -c "int dn3" -c "ip addr 10.0.0.25/30" + -c "int dn4" -c "ip addr 10.0.0.29/30" + -c "router bgp 65002" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 10.0.0.18 remote-as 65011" + -c " neighbor 10.0.0.22 remote-as 65012" + -c " neighbor 10.0.0.26 remote-as 65013" + -c " neighbor 10.0.0.30 remote-as 65014" + - name: Leaf1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.11/32" + -c "int up1" -c "ip addr 10.0.0.2/30" + -c "int up2" -c "ip addr 10.0.0.18/30" + -c "int dn1" -c "ip addr 20.0.0.1/30" + -c "int dn2" -c "ip addr 20.0.0.5/30" + -c "router bgp 65011" + -c " bgp router-id 10.255.0.11" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 10.0.0.1 remote-as 65001" + -c " neighbor 10.0.0.17 remote-as 65002" + -c " neighbor 20.0.0.2 remote-as 65021" + -c " neighbor 20.0.0.6 remote-as 65022" + - name: Leaf2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.12/32" + -c "int up1" -c "ip addr 10.0.0.6/30" + -c "int up2" -c "ip addr 10.0.0.22/30" + -c "int dn1" -c "ip addr 20.0.0.9/30" + -c "int dn2" -c "ip addr 20.0.0.13/30" + -c "router bgp 65012" + -c " bgp router-id 10.255.0.12" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 10.0.0.5 remote-as 65001" + -c " neighbor 10.0.0.21 remote-as 65002" + -c " neighbor 20.0.0.10 remote-as 65023" + -c " neighbor 20.0.0.14 remote-as 65024" + - name: Leaf3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.13/32" + -c "int up1" -c "ip addr 10.0.0.10/30" + -c "int up2" -c "ip addr 10.0.0.26/30" + -c "int dn1" -c "ip addr 20.0.0.17/30" + -c "int dn2" -c "ip addr 20.0.0.21/30" + -c "router bgp 65013" + -c " bgp router-id 10.255.0.13" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 10.0.0.9 remote-as 65001" + -c " neighbor 10.0.0.25 remote-as 65002" + -c " neighbor 20.0.0.18 remote-as 65025" + -c " neighbor 20.0.0.22 remote-as 65026" + - name: Leaf4 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.14/32" + -c "int up1" -c "ip addr 10.0.0.14/30" + -c "int up2" -c "ip addr 10.0.0.30/30" + -c "int dn1" -c "ip addr 20.0.0.25/30" + -c "int dn2" -c "ip addr 20.0.0.29/30" + -c "router bgp 65014" + -c " bgp router-id 10.255.0.14" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 10.0.0.13 remote-as 65001" + -c " neighbor 10.0.0.29 remote-as 65002" + -c " neighbor 20.0.0.26 remote-as 65027" + -c " neighbor 20.0.0.30 remote-as 65028" + - name: Serv1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.21/32" + -c "int net0" -c "ip addr 20.0.0.2/30" + -c "router bgp 65021" + -c " bgp router-id 10.255.0.21" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.1 remote-as external" + -c " network 20.0.0.2/30" + - name: Serv2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.22/32" + -c "int net0" -c "ip addr 20.0.0.6/30" + -c "router bgp 65022" + -c " bgp router-id 10.255.0.22" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.5 remote-as external" + -c " network 20.0.0.6/30" + - name: Serv3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.23/32" + -c "int net0" -c "ip addr 20.0.0.10/30" + -c "router bgp 65023" + -c " bgp router-id 10.255.0.23" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.9 remote-as external" + -c " network 20.0.0.10/30" + - name: Serv4 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.24/32" + -c "int net0" -c "ip addr 20.0.0.14/30" + -c "router bgp 65024" + -c " bgp router-id 10.255.0.24" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.13 remote-as external" + -c " network 20.0.0.14/30" + - name: Serv5 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.25/32" + -c "int net0" -c "ip addr 20.0.0.18/30" + -c "router bgp 65025" + -c " bgp router-id 10.255.0.25" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.17 remote-as external" + -c " network 20.0.0.18/30" + - name: Serv6 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.26/32" + -c "int net0" -c "ip addr 20.0.0.22/30" + -c "router bgp 65026" + -c " bgp router-id 10.255.0.26" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.21 remote-as external" + -c " network 20.0.0.22/30" + - name: Serv7 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.27/32" + -c "int net0" -c "ip addr 20.0.0.26/30" + -c "router bgp 65027" + -c " bgp router-id 10.255.0.27" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.25 remote-as external" + -c " network 20.0.0.26/30" + - name: Serv8 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.28/32" + -c "int net0" -c "ip addr 20.0.0.30/30" + -c "router bgp 65028" + -c " bgp router-id 10.255.0.28" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor 20.0.0.29 remote-as external" + -c " network 20.0.0.30/30" + +test: + - name: p2p + cmds: + - cmd: docker exec Ext1 echo slank + - cmd: echo slankdev slankdev + diff --git a/examples/basic_clos/spec.v0.0.1.yaml b/examples/basic_clos/spec.v0.0.1.yaml new file mode 100644 index 0000000..3ce107e --- /dev/null +++ b/examples/basic_clos/spec.v0.0.1.yaml @@ -0,0 +1,382 @@ + +nodes: + - name: Ext1 + image: slankdev/frr + interfaces: + # - { name: net0, type: direct, args: Internet#net0 } + - { name: net1, type: direct, args: Spine1#dn1 } + - { name: net2, type: direct, args: Spine2#dn1 } + - name: Spine1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#net1 } + - { name: dn1, type: direct, args: Leaf1#up1 } + - { name: dn2, type: direct, args: Leaf2#up1 } + - { name: dn3, type: direct, args: Leaf3#up1 } + - { name: dn4, type: direct, args: Leaf4#up1 } + - name: Spine2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#net2 } + - { name: dn1, type: direct, args: Leaf1#up2 } + - { name: dn2, type: direct, args: Leaf2#up2 } + - { name: dn3, type: direct, args: Leaf3#up2 } + - { name: dn4, type: direct, args: Leaf4#up2 } + - name: Leaf1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn1 } + - { name: up2, type: direct, args: Spine2#dn1 } + - { name: dn1, type: direct, args: Serv1#net0 } + - { name: dn2, type: direct, args: Serv2#net0 } + - name: Leaf2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn2 } + - { name: up2, type: direct, args: Spine2#dn2 } + - { name: dn1, type: direct, args: Serv3#net0 } + - { name: dn2, type: direct, args: Serv4#net0 } + - name: Leaf3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn3 } + - { name: up2, type: direct, args: Spine2#dn3 } + - { name: dn1, type: direct, args: Serv3#net0 } + - { name: dn2, type: direct, args: Serv4#net0 } + - name: Leaf4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn4 } + - { name: up2, type: direct, args: Spine2#dn4 } + - { name: dn1, type: direct, args: Serv3#net0 } + - { name: dn2, type: direct, args: Serv4#net0 } + - name: Serv1 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf1#dn1 } ] + - name: Serv2 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf1#dn2 } ] + - name: Serv3 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf2#dn1 } ] + - name: Serv4 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf2#dn2 } ] + - name: Serv5 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf3#dn1 } ] + - name: Serv6 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf3#dn2 } ] + - name: Serv7 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf4#dn1 } ] + - name: Serv8 + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf4#dn2 } ] + +node_configs: + - name: Ext1 + cmds: + - cmd: echo slankdev slankdev + - name: Spine1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.1/32" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Spine2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.2/32" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65002" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.11/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65011" + -c " bgp router-id 10.255.0.11" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.12/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65012" + -c " bgp router-id 10.255.0.12" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf3 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.13/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65013" + -c " bgp router-id 10.255.0.13" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf4 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.14/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65014" + -c " bgp router-id 10.255.0.14" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.21/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65021" + -c " bgp router-id 10.255.0.21" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.22/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65022" + -c " bgp router-id 10.255.0.22" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv3 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.23/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65023" + -c " bgp router-id 10.255.0.23" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " network 3.3.3.3/32" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv4 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.24/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65024" + -c " bgp router-id 10.255.0.24" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " network 4.4.4.4/32" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv5 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.25/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65025" + -c " bgp router-id 10.255.0.25" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " network 5.5.5.5/32" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv6 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.26/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65026" + -c " bgp router-id 10.255.0.26" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " network 6.6.6.6/32" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv7 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.27/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65027" + -c " bgp router-id 10.255.0.27" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " network 7.7.7.7/32" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv8 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.28/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65028" + -c " bgp router-id 10.255.0.28" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " network 8.8.8.8/32" + -c " redistribute connected" + -c " exit-address-family" + +test: + - name: p2p + cmds: + - cmd: docker exec Ext1 echo slank + - cmd: echo slankdev slankdev + diff --git a/examples/basic_clos/spec.v0.0.2.yaml b/examples/basic_clos/spec.v0.0.2.yaml new file mode 100644 index 0000000..e1e720d --- /dev/null +++ b/examples/basic_clos/spec.v0.0.2.yaml @@ -0,0 +1,428 @@ + +nodes: + - name: Ext1 + image: slankdev/frr + interfaces: + # - { name: net0, type: direct, args: Internet#net0 } + - { name: dn1, type: direct, args: Spine1#up1 } + - { name: dn2, type: direct, args: Spine2#up1 } + - name: Spine1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#dn1 } + - { name: dn1, type: direct, args: Leaf1#up1 } + - { name: dn2, type: direct, args: Leaf2#up1 } + - { name: dn3, type: direct, args: Leaf3#up1 } + - { name: dn4, type: direct, args: Leaf4#up1 } + - name: Spine2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#dn2 } + - { name: dn1, type: direct, args: Leaf1#up2 } + - { name: dn2, type: direct, args: Leaf2#up2 } + - { name: dn3, type: direct, args: Leaf3#up2 } + - { name: dn4, type: direct, args: Leaf4#up2 } + - name: Leaf1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn1 } + - { name: up2, type: direct, args: Spine2#dn1 } + - { name: dn1, type: direct, args: Serv1a#net0 } + - { name: dn2, type: direct, args: Serv2a#net0 } + - name: Leaf2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn2 } + - { name: up2, type: direct, args: Spine2#dn2 } + - { name: dn1, type: direct, args: Serv3a#net0 } + - { name: dn2, type: direct, args: Serv4a#net0 } + - name: Leaf3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn3 } + - { name: up2, type: direct, args: Spine2#dn3 } + - { name: dn1, type: direct, args: Serv1b#net0 } + - { name: dn2, type: direct, args: Serv2b#net0 } + - name: Leaf4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn4 } + - { name: up2, type: direct, args: Spine2#dn4 } + - { name: dn1, type: direct, args: Serv3b#net0 } + - { name: dn2, type: direct, args: Serv4b#net0 } + - name: Serv1a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf1#dn1 } ] + - name: Serv2a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf1#dn2 } ] + - name: Serv3a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf2#dn1 } ] + - name: Serv4a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf2#dn2 } ] + - name: Serv1b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf3#dn1 } ] + - name: Serv2b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf3#dn2 } ] + - name: Serv3b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf4#dn1 } ] + - name: Serv4b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Leaf4#dn2 } ] + +node_configs: + - name: Ext1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.254/32" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65999" + -c " bgp router-id 10.255.0.254" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Spine1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.1/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Spine2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.2/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65002" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.11/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65011" + -c " bgp router-id 10.255.0.11" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.12/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65012" + -c " bgp router-id 10.255.0.12" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.13/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65013" + -c " bgp router-id 10.255.0.13" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Leaf4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.14/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65014" + -c " bgp router-id 10.255.0.14" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv1a + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.21/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65021" + -c " bgp router-id 10.255.0.21" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv2a + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.22/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65022" + -c " bgp router-id 10.255.0.22" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv3a + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.23/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65023" + -c " bgp router-id 10.255.0.23" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv4a + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.24/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65024" + -c " bgp router-id 10.255.0.24" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv1b + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.21/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65021" + -c " bgp router-id 10.255.0.21" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv2b + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.22/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65022" + -c " bgp router-id 10.255.0.22" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv3b + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.23/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65023" + -c " bgp router-id 10.255.0.23" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + - name: Serv4b + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.24/32" + -c "int net0" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65024" + -c " bgp router-id 10.255.0.24" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + +test: + - name: p2p + cmds: + - cmd: docker exec Ext1 echo slank + - cmd: echo slankdev slankdev + diff --git a/examples/basic_clos/spec.v0.0.3.yaml b/examples/basic_clos/spec.v0.0.3.yaml new file mode 100644 index 0000000..6ceacf1 --- /dev/null +++ b/examples/basic_clos/spec.v0.0.3.yaml @@ -0,0 +1,1304 @@ + +nodes: + - name: Ext1 + image: slankdev/frr + interfaces: + # - { name: net0, type: direct, args: Internet#net0 } + - { name: dn1, type: direct, args: Spine1#up1 } + - { name: dn2, type: direct, args: Spine2#up1 } + - name: Spine1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#dn1 } + - { name: dn1, type: direct, args: Leaf1#up1 } + - { name: dn2, type: direct, args: Leaf2#up1 } + - { name: dn3, type: direct, args: Leaf3#up1 } + - { name: dn4, type: direct, args: Leaf4#up1 } + - name: Spine2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#dn2 } + - { name: dn1, type: direct, args: Leaf1#up2 } + - { name: dn2, type: direct, args: Leaf2#up2 } + - { name: dn3, type: direct, args: Leaf3#up2 } + - { name: dn4, type: direct, args: Leaf4#up2 } + - name: Leaf1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn1 } + - { name: up2, type: direct, args: Spine2#dn1 } + - { name: dn1, type: direct, args: Tor1#up1 } + - { name: dn2, type: direct, args: Tor2#up1 } + - { name: dn3, type: direct, args: Tor3#up1 } + - { name: dn4, type: direct, args: Tor4#up1 } + - { name: dn5, type: direct, args: Tor5#up1 } + - { name: dn6, type: direct, args: Tor6#up1 } + - { name: dn7, type: direct, args: Tor7#up1 } + - { name: dn8, type: direct, args: Tor8#up1 } + - name: Leaf2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn2 } + - { name: up2, type: direct, args: Spine2#dn2 } + - { name: dn1, type: direct, args: Tor1#up2 } + - { name: dn2, type: direct, args: Tor2#up2 } + - { name: dn3, type: direct, args: Tor3#up2 } + - { name: dn4, type: direct, args: Tor4#up2 } + - { name: dn5, type: direct, args: Tor5#up2 } + - { name: dn6, type: direct, args: Tor6#up2 } + - { name: dn7, type: direct, args: Tor7#up2 } + - { name: dn8, type: direct, args: Tor8#up2 } + - name: Leaf3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn3 } + - { name: up2, type: direct, args: Spine2#dn3 } + - { name: dn1, type: direct, args: Tor1#up3 } + - { name: dn2, type: direct, args: Tor2#up3 } + - { name: dn3, type: direct, args: Tor3#up3 } + - { name: dn4, type: direct, args: Tor4#up3 } + - { name: dn5, type: direct, args: Tor5#up3 } + - { name: dn6, type: direct, args: Tor6#up3 } + - { name: dn7, type: direct, args: Tor7#up3 } + - { name: dn8, type: direct, args: Tor8#up3 } + - name: Leaf4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn4 } + - { name: up2, type: direct, args: Spine2#dn4 } + - { name: dn1, type: direct, args: Tor1#up4 } + - { name: dn2, type: direct, args: Tor2#up4 } + - { name: dn3, type: direct, args: Tor3#up4 } + - { name: dn4, type: direct, args: Tor4#up4 } + - { name: dn5, type: direct, args: Tor5#up4 } + - { name: dn6, type: direct, args: Tor6#up4 } + - { name: dn7, type: direct, args: Tor7#up4 } + - { name: dn8, type: direct, args: Tor8#up4 } + + - name: Tor1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn1 } + - { name: up2, type: direct, args: Leaf2#dn1 } + - { name: up3, type: direct, args: Leaf3#dn1 } + - { name: up4, type: direct, args: Leaf4#dn1 } + - { name: dn1, type: direct, args: Serv1#up1 } + - { name: dn2, type: direct, args: Serv2#up1 } + - { name: dn3, type: direct, args: Serv3#up1 } + - { name: dn4, type: direct, args: Serv4#up1 } + - name: Tor2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn2 } + - { name: up2, type: direct, args: Leaf2#dn2 } + - { name: up3, type: direct, args: Leaf3#dn2 } + - { name: up4, type: direct, args: Leaf4#dn2 } + - { name: dn1, type: direct, args: Serv1#up2 } + - { name: dn2, type: direct, args: Serv2#up2 } + - { name: dn3, type: direct, args: Serv3#up2 } + - { name: dn4, type: direct, args: Serv4#up2 } + - name: Tor3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn3 } + - { name: up2, type: direct, args: Leaf2#dn3 } + - { name: up3, type: direct, args: Leaf3#dn3 } + - { name: up4, type: direct, args: Leaf4#dn3 } + - { name: dn1, type: direct, args: Serv5#up1 } + - { name: dn2, type: direct, args: Serv6#up1 } + - { name: dn3, type: direct, args: Serv7#up1 } + - { name: dn4, type: direct, args: Serv8#up1 } + - name: Tor4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn4 } + - { name: up2, type: direct, args: Leaf2#dn4 } + - { name: up3, type: direct, args: Leaf3#dn4 } + - { name: up4, type: direct, args: Leaf4#dn4 } + - { name: dn1, type: direct, args: Serv5#up2 } + - { name: dn2, type: direct, args: Serv6#up2 } + - { name: dn3, type: direct, args: Serv7#up2 } + - { name: dn4, type: direct, args: Serv8#up2 } + - name: Tor5 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn5 } + - { name: up2, type: direct, args: Leaf2#dn5 } + - { name: up3, type: direct, args: Leaf3#dn5 } + - { name: up4, type: direct, args: Leaf4#dn5 } + - { name: dn1, type: direct, args: Serv9#up1 } + - { name: dn2, type: direct, args: Serv10#up1 } + - { name: dn3, type: direct, args: Serv11#up1 } + - { name: dn4, type: direct, args: Serv12#up1 } + - name: Tor6 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn6 } + - { name: up2, type: direct, args: Leaf2#dn6 } + - { name: up3, type: direct, args: Leaf3#dn6 } + - { name: up4, type: direct, args: Leaf4#dn6 } + - { name: dn1, type: direct, args: Serv9#up2 } + - { name: dn2, type: direct, args: Serv10#up2 } + - { name: dn3, type: direct, args: Serv11#up2 } + - { name: dn4, type: direct, args: Serv12#up2 } + - name: Tor7 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn7 } + - { name: up2, type: direct, args: Leaf2#dn7 } + - { name: up3, type: direct, args: Leaf3#dn7 } + - { name: up4, type: direct, args: Leaf4#dn7 } + - { name: dn1, type: direct, args: Serv13#up1 } + - { name: dn2, type: direct, args: Serv14#up1 } + - { name: dn3, type: direct, args: Serv15#up1 } + - { name: dn4, type: direct, args: Serv16#up1 } + - name: Tor8 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn8 } + - { name: up2, type: direct, args: Leaf2#dn8 } + - { name: up3, type: direct, args: Leaf3#dn8 } + - { name: up4, type: direct, args: Leaf4#dn8 } + - { name: dn1, type: direct, args: Serv13#up2 } + - { name: dn2, type: direct, args: Serv14#up2 } + - { name: dn3, type: direct, args: Serv15#up2 } + - { name: dn4, type: direct, args: Serv16#up2 } + + - name: Serv1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn1 } + - { name: up2, type: direct, args: Tor2#dn1 } + - { name: dn1, type: direct, args: Vm1a#net0 } + - { name: dn2, type: direct, args: Vm1b#net0 } + - name: Serv2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn2 } + - { name: up2, type: direct, args: Tor2#dn2 } + - { name: dn1, type: direct, args: Vm2a#net0 } + - { name: dn2, type: direct, args: Vm2b#net0 } + - name: Serv3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn3 } + - { name: up2, type: direct, args: Tor2#dn3 } + - { name: dn1, type: direct, args: Vm3a#net0 } + - { name: dn2, type: direct, args: Vm3b#net0 } + - name: Serv4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn4 } + - { name: up2, type: direct, args: Tor2#dn4 } + - { name: dn1, type: direct, args: Vm4a#net0 } + - { name: dn2, type: direct, args: Vm4b#net0 } + - name: Serv5 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn1 } + - { name: up2, type: direct, args: Tor4#dn1 } + - { name: dn1, type: direct, args: Vm5a#net0 } + - { name: dn2, type: direct, args: Vm5b#net0 } + - name: Serv6 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn2 } + - { name: up2, type: direct, args: Tor4#dn2 } + - { name: dn1, type: direct, args: Vm6a#net0 } + - { name: dn2, type: direct, args: Vm6b#net0 } + - name: Serv7 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn3 } + - { name: up2, type: direct, args: Tor4#dn3 } + - { name: dn1, type: direct, args: Vm7a#net0 } + - { name: dn2, type: direct, args: Vm7b#net0 } + - name: Serv8 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn4 } + - { name: up2, type: direct, args: Tor4#dn4 } + - { name: dn1, type: direct, args: Vm8a#net0 } + - { name: dn2, type: direct, args: Vm8b#net0 } + - name: Serv9 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn1 } + - { name: up2, type: direct, args: Tor6#dn1 } + - { name: dn1, type: direct, args: Vm9a#net0 } + - { name: dn2, type: direct, args: Vm9b#net0 } + - name: Serv10 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn2 } + - { name: up2, type: direct, args: Tor6#dn2 } + - { name: dn1, type: direct, args: Vm10a#net0 } + - { name: dn2, type: direct, args: Vm10b#net0 } + - name: Serv11 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn3 } + - { name: up2, type: direct, args: Tor6#dn3 } + - { name: dn1, type: direct, args: Vm11a#net0 } + - { name: dn2, type: direct, args: Vm11b#net0 } + - name: Serv12 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn4 } + - { name: up2, type: direct, args: Tor6#dn4 } + - { name: dn1, type: direct, args: Vm12a#net0 } + - { name: dn2, type: direct, args: Vm12b#net0 } + - name: Serv13 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn1 } + - { name: up2, type: direct, args: Tor8#dn1 } + - { name: dn1, type: direct, args: Vm13a#net0 } + - { name: dn2, type: direct, args: Vm13b#net0 } + - name: Serv14 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn2 } + - { name: up2, type: direct, args: Tor8#dn2 } + - { name: dn1, type: direct, args: Vm14a#net0 } + - { name: dn2, type: direct, args: Vm14b#net0 } + - name: Serv15 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn3 } + - { name: up2, type: direct, args: Tor8#dn3 } + - { name: dn1, type: direct, args: Vm15b#net0 } + - { name: dn2, type: direct, args: Vm15b#net0 } + - name: Serv16 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn4 } + - { name: up2, type: direct, args: Tor8#dn4 } + - { name: dn1, type: direct, args: Vm16b#net0 } + - { name: dn2, type: direct, args: Vm16b#net0 } + + - name: Vm1a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv1#dn1 } ] + - name: Vm2a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv2#dn1 } ] + - name: Vm3a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv3#dn1 } ] + - name: Vm4a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv4#dn1 } ] + - name: Vm5a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv5#dn1 } ] + - name: Vm6a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv6#dn1 } ] + - name: Vm7a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv7#dn1 } ] + - name: Vm8a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv8#dn1 } ] + - name: Vm9a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv9#dn1 } ] + - name: Vm10a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv10#dn1 } ] + - name: Vm11a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv11#dn1 } ] + - name: Vm12a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv12#dn1 } ] + - name: Vm13a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv13#dn1 } ] + - name: Vm14a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv14#dn1 } ] + - name: Vm15a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv15#dn1 } ] + - name: Vm16a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv16#dn1 } ] + - name: Vm1b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv1#dn2 } ] + - name: Vm2b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv2#dn2 } ] + - name: Vm3b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv3#dn2 } ] + - name: Vm4b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv4#dn2 } ] + - name: Vm5b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv5#dn2 } ] + - name: Vm6b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv6#dn2 } ] + - name: Vm7b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv7#dn2 } ] + - name: Vm8b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv8#dn2 } ] + - name: Vm9b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv9#dn2 } ] + - name: Vm10b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv10#dn2 } ] + - name: Vm11b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv11#dn2 } ] + - name: Vm12b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv12#dn2 } ] + - name: Vm13b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv13#dn2 } ] + - name: Vm14b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv14#dn2 } ] + - name: Vm15b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv15#dn2 } ] + - name: Vm16b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv16#dn2 } ] + +node_configs: + - name: Ext1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.254/32" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65999" + -c " bgp router-id 10.255.0.254" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Spine1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.1/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Spine2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.2/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65002" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.11/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65011" + -c " bgp router-id 10.255.0.11" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.12/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65012" + -c " bgp router-id 10.255.0.12" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.13/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65013" + -c " bgp router-id 10.255.0.13" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.14/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65014" + -c " bgp router-id 10.255.0.14" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + + - name: Tor1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.31/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65031" + -c " bgp router-id 10.255.0.31" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.32/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65032" + -c " bgp router-id 10.255.0.32" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.33/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65033" + -c " bgp router-id 10.255.0.33" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.34/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65034" + -c " bgp router-id 10.255.0.34" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor5 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.35/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65035" + -c " bgp router-id 10.255.0.35" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor6 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.36/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65036" + -c " bgp router-id 10.255.0.36" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor7 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.37/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65037" + -c " bgp router-id 10.255.0.37" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor8 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.38/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65038" + -c " bgp router-id 10.255.0.38" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + + - name: Serv1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.201/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65201" + -c " bgp router-id 10.255.0.201" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.202/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65202" + -c " bgp router-id 10.255.0.202" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.203/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65203" + -c " bgp router-id 10.255.0.203" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.204/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65204" + -c " bgp router-id 10.255.0.204" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv5 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.205/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65205" + -c " bgp router-id 10.255.0.205" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv6 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.206/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65206" + -c " bgp router-id 10.255.0.206" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv7 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.207/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65207" + -c " bgp router-id 10.255.0.207" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv8 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.208/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65208" + -c " bgp router-id 10.255.0.208" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + + - name: Serv9 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.209/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65209" + -c " bgp router-id 10.255.0.209" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv10 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.210/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65210" + -c " bgp router-id 10.255.0.210" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv11 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.211/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65211" + -c " bgp router-id 10.255.0.211" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv12 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.212/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65212" + -c " bgp router-id 10.255.0.212" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv13 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.213/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65213" + -c " bgp router-id 10.255.0.213" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv14 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.214/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65214" + -c " bgp router-id 10.255.0.214" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv15 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.215/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65215" + -c " bgp router-id 10.255.0.215" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv16 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.216/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65216" + -c " bgp router-id 10.255.0.216" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + +test: + - name: p2p + cmds: + - cmd: docker exec Ext1 echo slank + - cmd: echo slankdev slankdev + diff --git a/examples/basic_clos/spec.yaml b/examples/basic_clos/spec.yaml new file mode 100644 index 0000000..6ceacf1 --- /dev/null +++ b/examples/basic_clos/spec.yaml @@ -0,0 +1,1304 @@ + +nodes: + - name: Ext1 + image: slankdev/frr + interfaces: + # - { name: net0, type: direct, args: Internet#net0 } + - { name: dn1, type: direct, args: Spine1#up1 } + - { name: dn2, type: direct, args: Spine2#up1 } + - name: Spine1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#dn1 } + - { name: dn1, type: direct, args: Leaf1#up1 } + - { name: dn2, type: direct, args: Leaf2#up1 } + - { name: dn3, type: direct, args: Leaf3#up1 } + - { name: dn4, type: direct, args: Leaf4#up1 } + - name: Spine2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Ext1#dn2 } + - { name: dn1, type: direct, args: Leaf1#up2 } + - { name: dn2, type: direct, args: Leaf2#up2 } + - { name: dn3, type: direct, args: Leaf3#up2 } + - { name: dn4, type: direct, args: Leaf4#up2 } + - name: Leaf1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn1 } + - { name: up2, type: direct, args: Spine2#dn1 } + - { name: dn1, type: direct, args: Tor1#up1 } + - { name: dn2, type: direct, args: Tor2#up1 } + - { name: dn3, type: direct, args: Tor3#up1 } + - { name: dn4, type: direct, args: Tor4#up1 } + - { name: dn5, type: direct, args: Tor5#up1 } + - { name: dn6, type: direct, args: Tor6#up1 } + - { name: dn7, type: direct, args: Tor7#up1 } + - { name: dn8, type: direct, args: Tor8#up1 } + - name: Leaf2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn2 } + - { name: up2, type: direct, args: Spine2#dn2 } + - { name: dn1, type: direct, args: Tor1#up2 } + - { name: dn2, type: direct, args: Tor2#up2 } + - { name: dn3, type: direct, args: Tor3#up2 } + - { name: dn4, type: direct, args: Tor4#up2 } + - { name: dn5, type: direct, args: Tor5#up2 } + - { name: dn6, type: direct, args: Tor6#up2 } + - { name: dn7, type: direct, args: Tor7#up2 } + - { name: dn8, type: direct, args: Tor8#up2 } + - name: Leaf3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn3 } + - { name: up2, type: direct, args: Spine2#dn3 } + - { name: dn1, type: direct, args: Tor1#up3 } + - { name: dn2, type: direct, args: Tor2#up3 } + - { name: dn3, type: direct, args: Tor3#up3 } + - { name: dn4, type: direct, args: Tor4#up3 } + - { name: dn5, type: direct, args: Tor5#up3 } + - { name: dn6, type: direct, args: Tor6#up3 } + - { name: dn7, type: direct, args: Tor7#up3 } + - { name: dn8, type: direct, args: Tor8#up3 } + - name: Leaf4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Spine1#dn4 } + - { name: up2, type: direct, args: Spine2#dn4 } + - { name: dn1, type: direct, args: Tor1#up4 } + - { name: dn2, type: direct, args: Tor2#up4 } + - { name: dn3, type: direct, args: Tor3#up4 } + - { name: dn4, type: direct, args: Tor4#up4 } + - { name: dn5, type: direct, args: Tor5#up4 } + - { name: dn6, type: direct, args: Tor6#up4 } + - { name: dn7, type: direct, args: Tor7#up4 } + - { name: dn8, type: direct, args: Tor8#up4 } + + - name: Tor1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn1 } + - { name: up2, type: direct, args: Leaf2#dn1 } + - { name: up3, type: direct, args: Leaf3#dn1 } + - { name: up4, type: direct, args: Leaf4#dn1 } + - { name: dn1, type: direct, args: Serv1#up1 } + - { name: dn2, type: direct, args: Serv2#up1 } + - { name: dn3, type: direct, args: Serv3#up1 } + - { name: dn4, type: direct, args: Serv4#up1 } + - name: Tor2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn2 } + - { name: up2, type: direct, args: Leaf2#dn2 } + - { name: up3, type: direct, args: Leaf3#dn2 } + - { name: up4, type: direct, args: Leaf4#dn2 } + - { name: dn1, type: direct, args: Serv1#up2 } + - { name: dn2, type: direct, args: Serv2#up2 } + - { name: dn3, type: direct, args: Serv3#up2 } + - { name: dn4, type: direct, args: Serv4#up2 } + - name: Tor3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn3 } + - { name: up2, type: direct, args: Leaf2#dn3 } + - { name: up3, type: direct, args: Leaf3#dn3 } + - { name: up4, type: direct, args: Leaf4#dn3 } + - { name: dn1, type: direct, args: Serv5#up1 } + - { name: dn2, type: direct, args: Serv6#up1 } + - { name: dn3, type: direct, args: Serv7#up1 } + - { name: dn4, type: direct, args: Serv8#up1 } + - name: Tor4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn4 } + - { name: up2, type: direct, args: Leaf2#dn4 } + - { name: up3, type: direct, args: Leaf3#dn4 } + - { name: up4, type: direct, args: Leaf4#dn4 } + - { name: dn1, type: direct, args: Serv5#up2 } + - { name: dn2, type: direct, args: Serv6#up2 } + - { name: dn3, type: direct, args: Serv7#up2 } + - { name: dn4, type: direct, args: Serv8#up2 } + - name: Tor5 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn5 } + - { name: up2, type: direct, args: Leaf2#dn5 } + - { name: up3, type: direct, args: Leaf3#dn5 } + - { name: up4, type: direct, args: Leaf4#dn5 } + - { name: dn1, type: direct, args: Serv9#up1 } + - { name: dn2, type: direct, args: Serv10#up1 } + - { name: dn3, type: direct, args: Serv11#up1 } + - { name: dn4, type: direct, args: Serv12#up1 } + - name: Tor6 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn6 } + - { name: up2, type: direct, args: Leaf2#dn6 } + - { name: up3, type: direct, args: Leaf3#dn6 } + - { name: up4, type: direct, args: Leaf4#dn6 } + - { name: dn1, type: direct, args: Serv9#up2 } + - { name: dn2, type: direct, args: Serv10#up2 } + - { name: dn3, type: direct, args: Serv11#up2 } + - { name: dn4, type: direct, args: Serv12#up2 } + - name: Tor7 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn7 } + - { name: up2, type: direct, args: Leaf2#dn7 } + - { name: up3, type: direct, args: Leaf3#dn7 } + - { name: up4, type: direct, args: Leaf4#dn7 } + - { name: dn1, type: direct, args: Serv13#up1 } + - { name: dn2, type: direct, args: Serv14#up1 } + - { name: dn3, type: direct, args: Serv15#up1 } + - { name: dn4, type: direct, args: Serv16#up1 } + - name: Tor8 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Leaf1#dn8 } + - { name: up2, type: direct, args: Leaf2#dn8 } + - { name: up3, type: direct, args: Leaf3#dn8 } + - { name: up4, type: direct, args: Leaf4#dn8 } + - { name: dn1, type: direct, args: Serv13#up2 } + - { name: dn2, type: direct, args: Serv14#up2 } + - { name: dn3, type: direct, args: Serv15#up2 } + - { name: dn4, type: direct, args: Serv16#up2 } + + - name: Serv1 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn1 } + - { name: up2, type: direct, args: Tor2#dn1 } + - { name: dn1, type: direct, args: Vm1a#net0 } + - { name: dn2, type: direct, args: Vm1b#net0 } + - name: Serv2 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn2 } + - { name: up2, type: direct, args: Tor2#dn2 } + - { name: dn1, type: direct, args: Vm2a#net0 } + - { name: dn2, type: direct, args: Vm2b#net0 } + - name: Serv3 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn3 } + - { name: up2, type: direct, args: Tor2#dn3 } + - { name: dn1, type: direct, args: Vm3a#net0 } + - { name: dn2, type: direct, args: Vm3b#net0 } + - name: Serv4 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor1#dn4 } + - { name: up2, type: direct, args: Tor2#dn4 } + - { name: dn1, type: direct, args: Vm4a#net0 } + - { name: dn2, type: direct, args: Vm4b#net0 } + - name: Serv5 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn1 } + - { name: up2, type: direct, args: Tor4#dn1 } + - { name: dn1, type: direct, args: Vm5a#net0 } + - { name: dn2, type: direct, args: Vm5b#net0 } + - name: Serv6 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn2 } + - { name: up2, type: direct, args: Tor4#dn2 } + - { name: dn1, type: direct, args: Vm6a#net0 } + - { name: dn2, type: direct, args: Vm6b#net0 } + - name: Serv7 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn3 } + - { name: up2, type: direct, args: Tor4#dn3 } + - { name: dn1, type: direct, args: Vm7a#net0 } + - { name: dn2, type: direct, args: Vm7b#net0 } + - name: Serv8 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor3#dn4 } + - { name: up2, type: direct, args: Tor4#dn4 } + - { name: dn1, type: direct, args: Vm8a#net0 } + - { name: dn2, type: direct, args: Vm8b#net0 } + - name: Serv9 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn1 } + - { name: up2, type: direct, args: Tor6#dn1 } + - { name: dn1, type: direct, args: Vm9a#net0 } + - { name: dn2, type: direct, args: Vm9b#net0 } + - name: Serv10 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn2 } + - { name: up2, type: direct, args: Tor6#dn2 } + - { name: dn1, type: direct, args: Vm10a#net0 } + - { name: dn2, type: direct, args: Vm10b#net0 } + - name: Serv11 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn3 } + - { name: up2, type: direct, args: Tor6#dn3 } + - { name: dn1, type: direct, args: Vm11a#net0 } + - { name: dn2, type: direct, args: Vm11b#net0 } + - name: Serv12 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor5#dn4 } + - { name: up2, type: direct, args: Tor6#dn4 } + - { name: dn1, type: direct, args: Vm12a#net0 } + - { name: dn2, type: direct, args: Vm12b#net0 } + - name: Serv13 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn1 } + - { name: up2, type: direct, args: Tor8#dn1 } + - { name: dn1, type: direct, args: Vm13a#net0 } + - { name: dn2, type: direct, args: Vm13b#net0 } + - name: Serv14 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn2 } + - { name: up2, type: direct, args: Tor8#dn2 } + - { name: dn1, type: direct, args: Vm14a#net0 } + - { name: dn2, type: direct, args: Vm14b#net0 } + - name: Serv15 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn3 } + - { name: up2, type: direct, args: Tor8#dn3 } + - { name: dn1, type: direct, args: Vm15b#net0 } + - { name: dn2, type: direct, args: Vm15b#net0 } + - name: Serv16 + image: slankdev/frr + interfaces: + - { name: up1, type: direct, args: Tor7#dn4 } + - { name: up2, type: direct, args: Tor8#dn4 } + - { name: dn1, type: direct, args: Vm16b#net0 } + - { name: dn2, type: direct, args: Vm16b#net0 } + + - name: Vm1a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv1#dn1 } ] + - name: Vm2a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv2#dn1 } ] + - name: Vm3a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv3#dn1 } ] + - name: Vm4a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv4#dn1 } ] + - name: Vm5a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv5#dn1 } ] + - name: Vm6a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv6#dn1 } ] + - name: Vm7a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv7#dn1 } ] + - name: Vm8a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv8#dn1 } ] + - name: Vm9a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv9#dn1 } ] + - name: Vm10a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv10#dn1 } ] + - name: Vm11a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv11#dn1 } ] + - name: Vm12a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv12#dn1 } ] + - name: Vm13a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv13#dn1 } ] + - name: Vm14a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv14#dn1 } ] + - name: Vm15a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv15#dn1 } ] + - name: Vm16a + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv16#dn1 } ] + - name: Vm1b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv1#dn2 } ] + - name: Vm2b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv2#dn2 } ] + - name: Vm3b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv3#dn2 } ] + - name: Vm4b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv4#dn2 } ] + - name: Vm5b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv5#dn2 } ] + - name: Vm6b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv6#dn2 } ] + - name: Vm7b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv7#dn2 } ] + - name: Vm8b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv8#dn2 } ] + - name: Vm9b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv9#dn2 } ] + - name: Vm10b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv10#dn2 } ] + - name: Vm11b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv11#dn2 } ] + - name: Vm12b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv12#dn2 } ] + - name: Vm13b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv13#dn2 } ] + - name: Vm14b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv14#dn2 } ] + - name: Vm15b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv15#dn2 } ] + - name: Vm16b + image: slankdev/frr + interfaces: [ { name: net0, type: direct, args: Serv16#dn2 } ] + +node_configs: + - name: Ext1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.254/32" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65999" + -c " bgp router-id 10.255.0.254" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Spine1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.1/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Spine2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.2/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65002" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.11/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65011" + -c " bgp router-id 10.255.0.11" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.12/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65012" + -c " bgp router-id 10.255.0.12" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.13/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65013" + -c " bgp router-id 10.255.0.13" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Leaf4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.14/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn5" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn6" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn7" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn8" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65014" + -c " bgp router-id 10.255.0.14" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " neighbor dn5 interface peer-group FABRIC" + -c " neighbor dn6 interface peer-group FABRIC" + -c " neighbor dn7 interface peer-group FABRIC" + -c " neighbor dn8 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + + - name: Tor1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.31/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65031" + -c " bgp router-id 10.255.0.31" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.32/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65032" + -c " bgp router-id 10.255.0.32" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.33/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65033" + -c " bgp router-id 10.255.0.33" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.34/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65034" + -c " bgp router-id 10.255.0.34" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor5 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.35/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65035" + -c " bgp router-id 10.255.0.35" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor6 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.36/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65036" + -c " bgp router-id 10.255.0.36" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor7 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.37/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65037" + -c " bgp router-id 10.255.0.37" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Tor8 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.38/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn3" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int dn4" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65038" + -c " bgp router-id 10.255.0.38" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " neighbor up3 interface peer-group FABRIC" + -c " neighbor up4 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " neighbor dn2 interface peer-group FABRIC" + -c " neighbor dn3 interface peer-group FABRIC" + -c " neighbor dn4 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + + - name: Serv1 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.201/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65201" + -c " bgp router-id 10.255.0.201" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv2 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.202/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65202" + -c " bgp router-id 10.255.0.202" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv3 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.203/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65203" + -c " bgp router-id 10.255.0.203" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv4 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.204/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65204" + -c " bgp router-id 10.255.0.204" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv5 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.205/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65205" + -c " bgp router-id 10.255.0.205" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv6 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.206/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65206" + -c " bgp router-id 10.255.0.206" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv7 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.207/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65207" + -c " bgp router-id 10.255.0.207" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv8 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.208/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65208" + -c " bgp router-id 10.255.0.208" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + + - name: Serv9 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.209/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65209" + -c " bgp router-id 10.255.0.209" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv10 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.210/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65210" + -c " bgp router-id 10.255.0.210" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv11 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.211/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65211" + -c " bgp router-id 10.255.0.211" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv12 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.212/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65212" + -c " bgp router-id 10.255.0.212" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv13 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.213/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65213" + -c " bgp router-id 10.255.0.213" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv14 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.214/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65214" + -c " bgp router-id 10.255.0.214" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv15 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.215/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65215" + -c " bgp router-id 10.255.0.215" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + - name: Serv16 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c "conf t" + -c "int lo" -c "ip addr 10.255.0.216/32" + -c "int up1" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "int up2" -c "ipv6 nd ra-interval 1" -c "no ipv6 nd suppress-ra" + -c "router bgp 65216" + -c " bgp router-id 10.255.0.216" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor up2 interface peer-group FABRIC" + -c " address-family ipv4 unicast" + -c " redistribute connected route-map redis_lo" + -c " exit-address-family" + -c "route-map redis_lo permit 10" + -c " match interface lo" + +test: + - name: p2p + cmds: + - cmd: docker exec Ext1 echo slank + - cmd: echo slankdev slankdev + diff --git a/examples/basic_clos/topo.png b/examples/basic_clos/topo.png new file mode 100644 index 0000000..c1e7106 Binary files /dev/null and b/examples/basic_clos/topo.png differ diff --git a/examples/basic_clos/topo.v0.0.0.png b/examples/basic_clos/topo.v0.0.0.png new file mode 100644 index 0000000..10e612d Binary files /dev/null and b/examples/basic_clos/topo.v0.0.0.png differ diff --git a/examples/basic_clos/topo.v0.0.1.png b/examples/basic_clos/topo.v0.0.1.png new file mode 100644 index 0000000..0c65e38 Binary files /dev/null and b/examples/basic_clos/topo.v0.0.1.png differ diff --git a/examples/basic_clos/topo.v0.0.2.png b/examples/basic_clos/topo.v0.0.2.png new file mode 100644 index 0000000..578c110 Binary files /dev/null and b/examples/basic_clos/topo.v0.0.2.png differ diff --git a/examples/basic_clos/topo.v0.0.3.png b/examples/basic_clos/topo.v0.0.3.png new file mode 100644 index 0000000..c1e7106 Binary files /dev/null and b/examples/basic_clos/topo.v0.0.3.png differ diff --git a/examples/basic_conntrack/connection_sync/Makefile b/examples/basic_conntrack/connection_sync/Makefile new file mode 100644 index 0000000..d25fb4a --- /dev/null +++ b/examples/basic_conntrack/connection_sync/Makefile @@ -0,0 +1,8 @@ + +NAME=N1 +log_N1: + while :; do \ + docker exec $(NAME) vtysh -c 'conf te' -c 'log file /tmp/frr.log'; \ + docker exec -it $(NAME) tail -f /tmp/frr.log; \ + sleep 1 ; done + diff --git a/examples/basic_conntrack/connection_sync/README.md b/examples/basic_conntrack/connection_sync/README.md new file mode 100644 index 0000000..641a142 --- /dev/null +++ b/examples/basic_conntrack/connection_sync/README.md @@ -0,0 +1,12 @@ + +# Connection Sync with conntrackd and keepalived + +``` +tn upconf | sudo sh +``` + + + + + + diff --git a/examples/basic_conntrack/connection_sync/spec.yaml b/examples/basic_conntrack/connection_sync/spec.yaml new file mode 100644 index 0000000..ffb4cec --- /dev/null +++ b/examples/basic_conntrack/connection_sync/spec.yaml @@ -0,0 +1,166 @@ + +nodes: + + - name: C1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: S1#net0, } + - name: C2 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: S2#net0, } + + - name: S1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: C1#net0, } + - { name: net1, type: direct, args: N1#net0, } + - { name: net2, type: direct, args: N2#net0, } + - name: S2 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: C2#net0, } + - { name: net1, type: direct, args: N1#net1, } + - { name: net2, type: direct, args: N2#net1, } + + - name: N1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: S1#net1, } + - { name: net1, type: direct, args: S2#net1, } + - { name: fab0, type: direct, args: N2#fab0, } + - name: N2 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: S1#net2, } + - { name: net1, type: direct, args: S2#net2, } + - { name: fab0, type: direct, args: N1#fab0, } + +node_configs: + + - name: C1 + cmds: + - cmd: ip addr add 8.8.8.8/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 1" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + -c "!" + -c "do write" + - cmd: sh -c "echo It works > index.html" + - cmd: nohup python3 -m http.server 80 & + - name: C2 + cmds: + - cmd: ip addr add 10.0.0.1/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 2" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + -c "!" + -c "do write" + + - name: S1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 3" + -c " bgp router-id 10.255.0.3" + -c " bgp bestpath as-path multipath-relax" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " neighbor net1 interface peer-group FABRIC" + -c " neighbor net2 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + -c "!" + -c "do write" + + - name: S2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 4" + -c " bgp router-id 10.255.0.4" + -c " bgp bestpath as-path multipath-relax" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor net0 interface peer-group FABRIC" + -c " neighbor net1 interface peer-group FABRIC" + -c " neighbor net2 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " exit-address-family" + -c "!" + -c "do write" + + - name: N1 + cmds: + - cmd: ip addr add 99.0.0.1/24 dev fab0 + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 5" + -c " bgp router-id 10.255.0.5" + -c " bgp bestpath as-path multipath-relax" + -c " neighbor net0 interface remote-as external" + -c " neighbor net1 interface remote-as external" + -c " !" + -c " address-family ipv4 unicast" + -c " network 0.0.0.0/0" + -c " redistribute connected" + -c " neighbor net0 route-map MAP1 out" + -c " neighbor net1 route-map MAP2 out" + -c " exit-address-family" + -c "!" + -c "route-map MAP1 permit 1" + -c " match ip address prefix-list PLIST1" + -c "!" + -c "route-map MAP2 permit 1" + -c " match ip address prefix-list PLIST2" + -c "!" + -c "ip prefix-list PLIST1 seq 5 permit 20.0.0.0/8 ge 24" + -c "ip prefix-list PLIST2 seq 5 permit 0.0.0.0/0" + -c "!" + -c "do write" + + - cmd: ip addr add 20.0.0.1/32 dev lo + - cmd: ip addr add 20.0.0.2/32 dev lo + - cmd: iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j SNAT -p tcp --to-source 20.0.0.1:10000-20008 + + - name: N2 + cmds: + - cmd: ip addr add 99.0.0.2/24 dev fab0 + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip addr add 20.0.0.1/32 dev lo + - cmd: ip addr add 20.0.0.2/32 dev lo + - cmd: iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j SNAT -p tcp --to-source 20.0.0.1:10000-20008 + diff --git a/examples/basic_coredns/blacklist/Corefile.NS1 b/examples/basic_coredns/blacklist/Corefile.NS1 new file mode 100644 index 0000000..a8b6ae1 --- /dev/null +++ b/examples/basic_coredns/blacklist/Corefile.NS1 @@ -0,0 +1,17 @@ +.:53 { + errors + log + forward . 8.8.8.8 +} + +ichihara.org { + etcd ichihara.org { + path /dns-server01 + endpoint http://10.0.0.100:2379 + } +} + +emacs.org { +} +sublimetext.com { +} diff --git a/examples/basic_coredns/blacklist/README.md b/examples/basic_coredns/blacklist/README.md new file mode 100644 index 0000000..f258074 --- /dev/null +++ b/examples/basic_coredns/blacklist/README.md @@ -0,0 +1,18 @@ + +# CoreDNS example (very simple blacklist) + +![](topo.png) + +- Blacklisted + - emacs.org + - sublimetext.com + +``` +docker exec R1 nslookup slank.dev +docker exec R1 nslookup test1.ichihara.org +docker exec R1 nslookup test2.ichihara.org + +docker exec R1 nslookup www.vim.org +docker exec R1 nslookup emacs.org +docker exec R1 nslookup sublimetext.com +``` diff --git a/examples/basic_coredns/blacklist/spec.yaml b/examples/basic_coredns/blacklist/spec.yaml new file mode 100644 index 0000000..1bec650 --- /dev/null +++ b/examples/basic_coredns/blacklist/spec.yaml @@ -0,0 +1,77 @@ + +postinit: + - cmds: + - cmd: docker cp Corefile.NS1 NS1:/Corefile + # - cmd: docker cp Corefile.NS2 NS2:/Corefile + # - cmd: docker cp Corefile.NS3 NS3:/Corefile + +nodes: + - name: S1 + image: slankdev/coredns:centos-7 + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: NS1#net0 } + - { name: net2, type: direct, args: NS2#net0 } + - { name: net3, type: direct, args: NS3#net0 } + - { name: net4, type: direct, args: KVS#net0 } + + - name: R1 + image: slankdev/coredns:centos-7 + interfaces: + - { name: net0, type: direct, args: S1#net0 } + + - name: KVS + image: slankdev/etcd:centos-7 + interfaces: + - { name: net0, type: direct, args: S1#net4 } + + - name: NS1 + image: slankdev/coredns:centos-7 + net_base: bridge + interfaces: + - { name: net0, type: direct, args: S1#net1 } + - name: NS2 + image: slankdev/coredns:centos-7 + net_base: bridge + interfaces: + - { name: net0, type: direct, args: S1#net2 } + - name: NS3 + image: slankdev/coredns:centos-7 + net_base: bridge + interfaces: + - { name: net0, type: direct, args: S1#net3 } + +node_configs: + + - name: S1 + cmds: + - cmd: ip link add br0 type bridge + - cmd: ip link set br0 up + - cmd: ip link set net0 master br0 + - cmd: ip link set net1 master br0 + - cmd: ip link set net2 master br0 + - cmd: ip link set net3 master br0 + - cmd: ip link set net4 master br0 + + - name: KVS + cmds: + - cmd: ip addr add 10.0.0.100/24 dev net0 + - cmd: >- + nohup etcd --listen-peer-urls="http://10.0.0.100:2380" + --listen-client-urls="http://10.0.0.100:2379" + --advertise-client-urls="http://10.0.0.100:2379" & + - cmd: sleep 3 + - cmd: etcdctl --endpoints="http://10.0.0.100:2379" put /dns-server01/org/ichihara/test1/server01 '{"host":"99.1.0.1","port":80}' + - cmd: etcdctl --endpoints="http://10.0.0.100:2379" put /dns-server01/org/ichihara/test1/server02 '{"host":"99.1.0.2","port":80}' + - cmd: etcdctl --endpoints="http://10.0.0.100:2379" put /dns-server01/org/ichihara/test2/server01 '{"host":"99.2.0.2","port":80}' + + - name: NS1 + cmds: + - cmd: ip addr add 10.0.0.254/24 dev net0 + - cmd: nohup coredns -conf /Corefile & + + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: sh -c 'echo nameserver 10.0.0.254 > /etc/resolv.conf' + diff --git a/examples/basic_coredns/blacklist/topo.png b/examples/basic_coredns/blacklist/topo.png new file mode 100644 index 0000000..2614390 Binary files /dev/null and b/examples/basic_coredns/blacklist/topo.png differ diff --git a/examples/basic_ebgp/spec.yaml b/examples/basic_ebgp/spec.yaml new file mode 100644 index 0000000..5be971f --- /dev/null +++ b/examples/basic_ebgp/spec.yaml @@ -0,0 +1,126 @@ + +# DESCRIPTION: BGP network using FRR +# +# INIT: +# cns spec.yaml init | sudo sh +# cns spec.yaml conf | sudo sh +# cns spec.yaml test | sudo sh +# +# FINI: +# cns spec.yaml fini | sudo sh +# +# TOPO: +# +# vlan1:10.0.0.0/24 +# .1(net0) .2(net0) +# R0(AS100)------------------R1(AS200) +# (net1).1| |.1(net1) +# | | +# vlan1:10.1.0.0/24 | | vlan1:10.2.0.0/24 +# | | +# (net0).2| |.2(net0) +# R2(AS300) R3(AS400) +# (net1).1| |.1(net1) +# | | +# vlan1:10.3.0.0/24 | | vlan1:10.4.0.0/24 +# | | +# (net0).2| |.2(net0) +# C0 C1 +# + +nodes: + - name: R0 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R2#net0 } + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R0#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R0#net1 } + - { name: net1, type: direct, args: C0#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: C1#net0 } + + - name: C0 + image: slankdev/ubuntu:16.04 + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - name: C1 + image: slankdev/ubuntu:16.04 + interfaces: + - { name: net0, type: direct, args: R3#net1 } + +node_configs: + - name: R0 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 10.1.0.1/24 dev net1 + - cmd: >- + vtysh -c "conf t" + -c "router bgp 100" + -c "bgp router-id 1.1.1.1" + -c "neighbor 10.0.0.2 remote-as 200" + -c "neighbor 10.1.0.2 remote-as 300" + -c "network 10.1.0.0/24" + -c "network 10.1.2.0/24" + - name: R1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip addr add 10.2.0.1/24 dev net1 + - cmd: >- + vtysh -c "conf t" + -c "router bgp 200" + -c "bgp router-id 2.2.2.2" + -c "neighbor 10.0.0.1 remote-as 100" + -c "neighbor 10.2.0.2 remote-as 400" + -c "network 10.2.0.0/24" + -c "network 10.2.4.0/24" + - name: R2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.1.0.2/24 dev net0 + - cmd: ip addr add 10.3.0.1/24 dev net1 + - cmd: >- + vtysh -c "conf t" + -c "router bgp 300" + -c "bgp router-id 3.3.3.3" + -c "neighbor 10.1.0.1 remote-as 100" + -c "network 10.3.0.0/24" + - name: R3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.2.0.2/24 dev net0 + - cmd: ip addr add 10.4.0.1/24 dev net1 + - cmd: >- + vtysh -c "conf t" + -c "router bgp 400" + -c "bgp router-id 4.4.4.4" + -c "neighbor 10.2.0.1 remote-as 200" + -c "network 10.4.0.0/24" + + - name: C0 + cmds: + - cmd: ip addr add 10.3.0.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 10.3.0.1 + - name: C1 + cmds: + - cmd: ip addr add 10.4.0.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 10.4.0.1 + +test: + - cmds: + - cmd: docker exec C0 ping -c2 10.4.0.2 + diff --git a/examples/basic_ecmp/README.md b/examples/basic_ecmp/README.md new file mode 100644 index 0000000..1b9f3a2 --- /dev/null +++ b/examples/basic_ecmp/README.md @@ -0,0 +1,2 @@ + +![](topo.jpeg) diff --git a/examples/basic_ecmp/scale.diff b/examples/basic_ecmp/scale.diff new file mode 100644 index 0000000..a7a597f --- /dev/null +++ b/examples/basic_ecmp/scale.diff @@ -0,0 +1,56 @@ +diff --git a/examples/basic_ecmp/spec.yaml b/examples/basic_ecmp/spec.yaml +index c2c0bd2..79ab538 100644 +--- a/examples/basic_ecmp/spec.yaml ++++ b/examples/basic_ecmp/spec.yaml +@@ -38,6 +38,16 @@ nodes: + interfaces: + - { name: net0, type: direct, args: R3#net1 } + ++ - name: R4 ++ image: slankdev/frr ++ interfaces: ++ - { name: net0, type: bridge, args: B0 } ++ - { name: net1, type: direct, args: S4#net0 } ++ - name: S4 ++ image: tmp ++ interfaces: ++ - { name: net0, type: direct, args: R4#net1 } ++ + switches: + - name: B0 + interfaces: +@@ -45,6 +55,7 @@ switches: + - { name: net0, type: container, args: R1 } + - { name: net0, type: container, args: R2 } + - { name: net0, type: container, args: R3 } ++ - { name: net0, type: container, args: R4 } + + node_configs: + - name: S0 +@@ -123,6 +134,26 @@ node_configs: + - cmd: sh -c "echo S3 > index.html" + - cmd: nohup python3 -m http.server 80 & + ++ - name: R4 ++ cmds: ++ - cmd: /usr/lib/frr/frr start ++ - cmd: ip addr add 10.255.0.40/32 dev lo ++ - cmd: ip addr add 10.0.0.40/24 dev net0 ++ - cmd: ip addr add 192.168.0.1/24 dev net1 ++ - cmd: ip route replace default via 10.0.0.1 ++ - cmd: >- ++ vtysh -c 'conf t' ++ -c 'router bgp 100' ++ -c ' bgp router-id 10.255.0.40' ++ -c ' neighbor 10.0.0.1 remote-as 100' ++ -c ' network 192.168.0.2/32' ++ - name: S4 ++ cmds: ++ - cmd: ip addr add 192.168.0.2/24 dev net0 ++ - cmd: ip route replace default via 192.168.0.1 ++ - cmd: sh -c "echo S4 > index.html" ++ - cmd: nohup python3 -m http.server 80 & ++ + test: + - cmds: + # local link diff --git a/examples/basic_ecmp/spec.yaml b/examples/basic_ecmp/spec.yaml new file mode 100644 index 0000000..21ac0ce --- /dev/null +++ b/examples/basic_ecmp/spec.yaml @@ -0,0 +1,153 @@ +# http://www.asciiflow.com + +nodes: + - name: S0 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R0#net1 } + - name: R0 + image: slankdev/frr + interfaces: + - { name: net1, type: direct, args: S0#net0 } + - { name: net0, type: bridge, args: B0 } + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + - { name: net1, type: direct, args: S1#net0 } + - name: S1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + - { name: net1, type: direct, args: S2#net0 } + - name: S2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + - { name: net1, type: direct, args: S3#net0 } + - name: S3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R3#net1 } + +switches: + - name: B0 + interfaces: + - { name: net0, type: container, args: R0 } + - { name: net0, type: container, args: R1 } + - { name: net0, type: container, args: R2 } + - { name: net0, type: container, args: R3 } + +node_configs: + - name: S0 + cmds: + - cmd: ip addr add 10.1.0.2/24 dev net0 + - cmd: ip route replace default via 10.1.0.1 + - name: R0 + cmds: + - cmd: sysctl -w 'net.ipv4.fib_multipath_hash_policy=1' + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.255.0.1/32 dev lo + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 10.1.0.1/24 dev net1 + - cmd: >- + vtysh -c 'conf t' + -c 'router bgp 100' + -c ' bgp router-id 10.255.0.1' + -c ' neighbor 10.0.0.10 remote-as 100' + -c ' neighbor 10.0.0.20 remote-as 100' + -c ' neighbor 10.0.0.30 remote-as 100' + - cmd: vtysh -c "do write mem" + - name: R1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.255.0.10/32 dev lo + - cmd: ip addr add 10.0.0.10/24 dev net0 + - cmd: ip addr add 192.168.0.1/24 dev net1 + - cmd: ip route replace default via 10.0.0.1 + - cmd: >- + vtysh -c 'conf t' + -c 'router bgp 100' + -c ' bgp router-id 10.255.0.10' + -c ' neighbor 10.0.0.1 remote-as 100' + -c ' network 192.168.0.2/32' + - name: S1 + cmds: + - cmd: ip addr add 192.168.0.2/24 dev net0 + - cmd: ip route replace default via 192.168.0.1 + - cmd: sh -c "echo S1 > index.html" + - cmd: nohup python3 -m http.server 80 & + - name: R2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.255.0.20/32 dev lo + - cmd: ip addr add 10.0.0.20/24 dev net0 + - cmd: ip addr add 192.168.0.1/24 dev net1 + - cmd: ip route replace default via 10.0.0.1 + - cmd: >- + vtysh -c 'conf t' + -c 'router bgp 100' + -c ' bgp router-id 10.255.0.20' + -c ' neighbor 10.0.0.1 remote-as 100' + -c ' network 192.168.0.2/32' + - name: S2 + cmds: + - cmd: ip addr add 192.168.0.2/24 dev net0 + - cmd: ip route replace default via 192.168.0.1 + - cmd: sh -c "echo S2 > index.html" + - cmd: nohup python3 -m http.server 80 & + - name: R3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.255.0.30/32 dev lo + - cmd: ip addr add 10.0.0.30/24 dev net0 + - cmd: ip addr add 192.168.0.1/24 dev net1 + - cmd: ip route replace default via 10.0.0.1 + - cmd: >- + vtysh -c 'conf t' + -c 'router bgp 100' + -c ' bgp router-id 10.255.0.30' + -c ' neighbor 10.0.0.1 remote-as 100' + -c ' network 192.168.0.2/32' + - name: S3 + cmds: + - cmd: ip addr add 192.168.0.2/24 dev net0 + - cmd: ip route replace default via 192.168.0.1 + - cmd: sh -c "echo S3 > index.html" + - cmd: nohup python3 -m http.server 80 & + +test: + - cmds: + # local link + - cmd: docker exec S0 ping -c2 10.1.0.1 + - cmd: docker exec S1 ping -c2 192.168.0.1 + - cmd: docker exec S2 ping -c2 192.168.0.1 + - cmd: docker exec S3 ping -c2 192.168.0.1 + - cmd: docker exec R0 ping -c2 10.1.0.2 + - cmd: docker exec R0 ping -c2 10.0.0.10 + - cmd: docker exec R0 ping -c2 10.0.0.20 + - cmd: docker exec R0 ping -c2 10.0.0.30 + - cmd: docker exec R1 ping -c2 192.168.0.2 + - cmd: docker exec R1 ping -c2 10.0.0.1 + - cmd: docker exec R1 ping -c2 10.0.0.10 + - cmd: docker exec R1 ping -c2 10.0.0.20 + - cmd: docker exec R1 ping -c2 10.0.0.30 + - cmd: docker exec R2 ping -c2 10.0.0.1 + - cmd: docker exec R2 ping -c2 10.0.0.10 + - cmd: docker exec R2 ping -c2 10.0.0.20 + - cmd: docker exec R2 ping -c2 10.0.0.30 + - cmd: docker exec R3 ping -c2 10.0.0.1 + - cmd: docker exec R3 ping -c2 10.0.0.10 + - cmd: docker exec R3 ping -c2 10.0.0.20 + - cmd: docker exec R3 ping -c2 10.0.0.30 + # remote link + - cmd: docker exec S0 ping -c2 192.168.0.2 + diff --git a/examples/basic_ecmp/topo.jpeg b/examples/basic_ecmp/topo.jpeg new file mode 100644 index 0000000..bc7465b Binary files /dev/null and b/examples/basic_ecmp/topo.jpeg differ diff --git a/examples/basic_evpn/README.md b/examples/basic_evpn/README.md new file mode 100644 index 0000000..7cabc9e --- /dev/null +++ b/examples/basic_evpn/README.md @@ -0,0 +1,5 @@ + +# EVPN + +![](./topo.png) + diff --git a/examples/basic_evpn/spec.yaml b/examples/basic_evpn/spec.yaml new file mode 100644 index 0000000..1945ae1 --- /dev/null +++ b/examples/basic_evpn/spec.yaml @@ -0,0 +1,270 @@ + +nodes: + - name: RR + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: BB_SW } + + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: BB_SW } + - { name: net1, type: direct, args: C1#net0 } + - { name: net2, type: direct, args: C2#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: BB_SW } + - { name: net1, type: direct, args: C3#net0 } + - { name: net2, type: direct, args: C4#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: BB_SW } + - { name: net1, type: direct, args: C5#net0 } + - { name: net2, type: direct, args: C6#net0 } + + - name: C1 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R1#net1 } ] + - name: C2 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R1#net2 } ] + - name: C3 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R2#net1 } ] + - name: C4 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R2#net2 } ] + - name: C5 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R3#net1 } ] + - name: C6 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R3#net2 } ] + +switches: + - name: BB_SW + interfaces: + - { name: net0, type: container, args: R1 } + - { name: net0, type: container, args: R2 } + - { name: net0, type: container, args: R3 } + - { name: net0, type: container, args: RR } + +node_configs: + - name: RR + cmds: + + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:ff:00:00 + - cmd: /usr/lib/frr/frr start + + - cmd: >- + vtysh -c "conf t" + -c "int lo" + -c " ip address 10.255.0.254/32" + -c " exit" + -c "int net0" + -c " ip address 10.0.0.254/24" + -c " exit" + -c "ip route 10.255.0.1/32 10.0.0.1" + -c "ip route 10.255.0.2/32 10.0.0.2" + -c "ip route 10.255.0.3/32 10.0.0.3" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.254" + -c " neighbor 10.255.0.1 remote-as internal" + -c " neighbor 10.255.0.1 update-source lo" + -c " neighbor 10.255.0.2 remote-as internal" + -c " neighbor 10.255.0.2 update-source lo" + -c " neighbor 10.255.0.3 remote-as internal" + -c " neighbor 10.255.0.3 update-source lo" + -c " address-family ipv4 unicast" + -c " neighbor 10.255.0.1 activate" + -c " neighbor 10.255.0.1 route-reflector-client" + -c " neighbor 10.255.0.2 activate" + -c " neighbor 10.255.0.2 route-reflector-client" + -c " neighbor 10.255.0.3 activate" + -c " neighbor 10.255.0.3 route-reflector-client" + -c " exit-address-family" + -c " address-family l2vpn evpn" + -c " neighbor 10.255.0.1 activate" + -c " neighbor 10.255.0.1 route-reflector-client" + -c " neighbor 10.255.0.2 activate" + -c " neighbor 10.255.0.2 route-reflector-client" + -c " neighbor 10.255.0.3 activate" + -c " neighbor 10.255.0.3 route-reflector-client" + -c " advertise-all-vni" + -c " exit-address-family" + + - name: R1 + cmds: + + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:aa:01:00 + - cmd: ip link set net1 address 52:54:00:aa:01:01 + - cmd: ip link set net2 address 52:54:00:aa:01:02 + - cmd: /usr/lib/frr/frr start + + - cmd: ip link add br100 type bridge + - cmd: ip link set dev br100 up + - cmd: ip addr add 10.100.0.1/16 dev br100 + - cmd: >- + ip link add vxlan100 type vxlan id 100 + dstport 4789 local 10.255.0.1 + + - cmd: ip link add br200 type bridge + - cmd: ip link set dev br200 up + - cmd: ip addr add 10.200.0.1/16 dev br200 + - cmd: >- + ip link add vxlan200 type vxlan id 200 + dstport 4789 local 10.255.0.1 + + - cmd: ip link set dev net1 master br100 + - cmd: ip link set dev net1 promisc on + - cmd: ip link set dev net1 up + - cmd: ip link set dev vxlan100 master br100 + - cmd: ip link set dev vxlan100 promisc on + - cmd: ip link set dev vxlan100 up + + - cmd: ip link set dev net2 master br200 + - cmd: ip link set dev net2 promisc on + - cmd: ip link set dev net2 up + - cmd: ip link set dev vxlan200 master br200 + - cmd: ip link set dev vxlan200 promisc on + - cmd: ip link set dev vxlan200 up + + - cmd: >- + vtysh -c "conf t" + -c "int lo" + -c " ip address 10.255.0.1/32" + -c " exit" + -c "int net0" + -c " ip address 10.0.0.1/24" + -c " exit" + -c "ip route 10.255.0.254/32 10.0.0.254" + -c "ip route 10.255.0.2/32 10.0.0.2" + -c "ip route 10.255.0.3/32 10.0.0.3" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.1" + -c " neighbor 10.255.0.254 remote-as internal" + -c " neighbor 10.255.0.254 update-source lo" + -c " address-family l2vpn evpn" + -c " neighbor 10.255.0.254 activate" + -c " advertise-all-vni" + -c " exit-address-family" + + - name: R2 + cmds: + + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:aa:02:00 + - cmd: ip link set net1 address 52:54:00:aa:02:01 + - cmd: ip link set net2 address 52:54:00:aa:02:02 + - cmd: /usr/lib/frr/frr start + + - cmd: ip link add br100 type bridge + - cmd: ip link set dev br100 up + - cmd: ip addr add 10.100.0.2/16 dev br100 + - cmd: >- + ip link add vxlan100 type vxlan id 100 + dstport 4789 local 10.255.0.2 + + - cmd: ip link add br200 type bridge + - cmd: ip link set dev br200 up + - cmd: ip addr add 10.200.0.2/16 dev br200 + - cmd: >- + ip link add vxlan200 type vxlan id 200 + dstport 4789 local 10.255.0.2 + + - cmd: ip link set dev net1 master br100 + - cmd: ip link set dev net1 promisc on + - cmd: ip link set dev net1 up + - cmd: ip link set dev vxlan100 master br100 + - cmd: ip link set dev vxlan100 promisc on + - cmd: ip link set dev vxlan100 up + + - cmd: ip link set dev net2 master br200 + - cmd: ip link set dev net2 promisc on + - cmd: ip link set dev net2 up + - cmd: ip link set dev vxlan200 master br200 + - cmd: ip link set dev vxlan200 promisc on + - cmd: ip link set dev vxlan200 up + + - cmd: >- + vtysh -c "conf t" + -c "int lo" + -c " ip address 10.255.0.2/32" + -c " exit" + -c "int net0" + -c " ip address 10.0.0.2/24" + -c " exit" + -c "ip route 10.255.0.254/32 10.0.0.254" + -c "ip route 10.255.0.1/32 10.0.0.1" + -c "ip route 10.255.0.3/32 10.0.0.3" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.2" + -c " neighbor 10.255.0.254 remote-as internal" + -c " neighbor 10.255.0.254 update-source lo" + -c " address-family l2vpn evpn" + -c " neighbor 10.255.0.254 activate" + -c " advertise-all-vni" + -c " exit-address-family" + + - name: R3 + cmds: + + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:aa:03:00 + - cmd: ip link set net1 address 52:54:00:aa:03:01 + - cmd: ip link set net2 address 52:54:00:aa:03:02 + - cmd: /usr/lib/frr/frr start + + - cmd: >- + vtysh -c "conf t" + -c "int lo" + -c " ip address 10.255.0.3/32" + -c " exit" + -c "int net0" + -c " ip address 10.0.0.3/24" + -c " exit" + -c "ip route 10.255.0.254/32 10.0.0.254" + -c "ip route 10.255.0.1/32 10.0.0.1" + -c "ip route 10.255.0.2/32 10.0.0.2" + -c "router bgp 65001" + -c " bgp router-id 10.255.0.3" + -c " neighbor 10.255.0.254 remote-as internal" + -c " neighbor 10.255.0.254 update-source lo" + -c " address-family l2vpn evpn" + -c " neighbor 10.255.0.254 activate" + -c " advertise-all-vni" + -c " exit-address-family" + + - name: C1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:bb:01:00 + - cmd: ip addr add 10.100.1.1/16 dev net0 + - name: C2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:bb:02:00 + - cmd: ip addr add 10.200.1.2/16 dev net0 + - name: C3 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:bb:03:00 + - cmd: ip addr add 10.100.2.3/16 dev net0 + - name: C4 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip link set net0 address 52:54:00:bb:04:00 + - cmd: ip addr add 10.200.2.4/16 dev net0 + +# test: +# - cmds: +# - cmd: docker exec R0 ping -c2 10.0.0.2 +# - cmd: docker exec R0 ping -c2 2.2.2.2 +# - cmd: docker exec R1 ping -c2 1.1.1.1 +# - cmd: docker exec C0 ping -c2 192.168.0.20 +# - cmd: docker exec C1 ping -c2 192.168.0.2 + diff --git a/examples/basic_evpn/topo.png b/examples/basic_evpn/topo.png new file mode 100644 index 0000000..9989dd9 Binary files /dev/null and b/examples/basic_evpn/topo.png differ diff --git a/examples/basic_exabgp/Makefile b/examples/basic_exabgp/Makefile new file mode 100644 index 0000000..cb374ee --- /dev/null +++ b/examples/basic_exabgp/Makefile @@ -0,0 +1,15 @@ + +exabgp: + exabgp ./exabgp.conf + +PCAP_PATH=/vagrant +getcapture: + tcpdump -ni net0 -w $(PCAP_PATH)/in.pcap & + exabgp ./exabgp.conf & + sleep 2 + killall tcpdump + killall python3 + +show: + docker exec R1 vtysh -c 'sh bgp ipv4 uni' + diff --git a/examples/basic_exabgp/README.md b/examples/basic_exabgp/README.md new file mode 100644 index 0000000..3fe0c47 --- /dev/null +++ b/examples/basic_exabgp/README.md @@ -0,0 +1,12 @@ + +# ExaBGP test + +``` +tn upconf | sudo sh +docker_mount_netns R2 ns0 +ip netns exec ns0 bash +make //execute exabgp +make getcapture //execute exabgp and pcap. +``` + + diff --git a/examples/basic_exabgp/daemons.R1 b/examples/basic_exabgp/daemons.R1 new file mode 100755 index 0000000..9b998b3 --- /dev/null +++ b/examples/basic_exabgp/daemons.R1 @@ -0,0 +1,80 @@ +# This file tells the frr package which daemons to start. +# +# Sample configurations for these daemons can be found in +# /usr/share/doc/frr/examples/. +# +# ATTENTION: +# +# When activating a daemon for the first time, a config file, even if it is +# empty, has to be present *and* be owned by the user and group "frr", else +# the daemon will not be started by /etc/init.d/frr. The permissions should +# be u=rw,g=r,o=. +# When using "vtysh" such a config file is also needed. It should be owned by +# group "frrvty" and set to ug=rw,o= though. Check /etc/pam.d/frr, too. +# +# The watchfrr and zebra daemons are always started. +# +bgpd=yes +ospfd=no +ospf6d=no +ripd=no +ripngd=no +isisd=no +pimd=no +ldpd=no +nhrpd=no +eigrpd=no +babeld=no +sharpd=no +pbrd=no +bfdd=no +fabricd=no +vrrpd=no + +# +# If this option is set the /etc/init.d/frr script automatically loads +# the config via "vtysh -b" when the servers are started. +# Check /etc/pam.d/frr if you intend to use "vtysh"! +# +vtysh_enable=yes +zebra_options=" -A 127.0.0.1 -s 90000000" +bgpd_options=" -A 127.0.0.1" +ospfd_options=" -A 127.0.0.1" +ospf6d_options=" -A ::1" +ripd_options=" -A 127.0.0.1" +ripngd_options=" -A ::1" +isisd_options=" -A 127.0.0.1" +pimd_options=" -A 127.0.0.1" +ldpd_options=" -A 127.0.0.1" +nhrpd_options=" -A 127.0.0.1" +eigrpd_options=" -A 127.0.0.1" +babeld_options=" -A 127.0.0.1" +sharpd_options=" -A 127.0.0.1" +pbrd_options=" -A 127.0.0.1" +staticd_options="-A 127.0.0.1" +bfdd_options=" -A 127.0.0.1" +fabricd_options="-A 127.0.0.1" +vrrpd_options=" -A 127.0.0.1" + +# configuration profile +# +#frr_profile="traditional" +#frr_profile="datacenter" + +# +# This is the maximum number of FD's that will be available. +# Upon startup this is read by the control files and ulimit +# is called. Uncomment and use a reasonable value for your +# setup if you are expecting a large number of peers in +# say BGP. +#MAX_FDS=1024 + +# The list of daemons to watch is automatically generated by the init script. +##watchfrr_options="" + +# for debugging purposes, you can specify a "wrap" command to start instead +# of starting the daemon directly, e.g. to use valgrind on ospfd: +# ospfd_wrap="/usr/bin/valgrind" +# or you can use "all_wrap" for all daemons, e.g. to use perf record: +# all_wrap="/usr/bin/perf record --call-graph -" +# the normal daemon command is added to this at the end. diff --git a/examples/basic_exabgp/exabgp.conf b/examples/basic_exabgp/exabgp.conf new file mode 100644 index 0000000..05c6ad5 --- /dev/null +++ b/examples/basic_exabgp/exabgp.conf @@ -0,0 +1,31 @@ +neighbor 10.0.0.1 { + router-id 2.2.2.2; + local-address 10.0.0.2; + local-as 2; + peer-as 1; + + #capability { + # nexthop true; + #} + + family { + ipv4 unicast; + ipv4 mpls-vpn; + } + + nexthop { + #ipv4 unicast ipv6; + #ipv4 mpls-vpn ipv6; + } + + static { + #route 1.1.1.1/32 next-hop 2.2.2.2; + #route 1.1.1.3/32 next-hop 2.2.2.2 bgp-prefix-sid [ 888 ]; + #route 1.1.1.6/32 next-hop 3.3.3.3 bgp-prefix-sid-srv6 ( ipv6 A:: ); + #route 2.2.2.2/32 rd 1:1 nexthop 2.2.2.2 extended-community [0x ] + #route 1.1.1.10/32 next-hop cafe::1; + #route 10.0.0.0/24 rd 65000:1 next-hop 200.10.0.101 extended-community [ 0x0002fde800000001 ] label 3 bgp-prefix-sid-srv6 ( vpn A:: ); + #route 10.0.0.0/24 rd 65000:1 next-hop 200.10.0.101 extended-community [ 0x0002fde800000001 ] label 3 bgp-prefix-sid-srv6 ( l3vpn A:: ); + route 10.0.0.0/24 rd 1:1 next-hop cafe::1 extended-community [ 0x0002fde800000001 ] label 3 bgp-prefix-sid-srv6 ( l3vpn 2001:1::10 ); + } +} diff --git a/examples/basic_exabgp/exabgp.conf.R2 b/examples/basic_exabgp/exabgp.conf.R2 new file mode 100644 index 0000000..95f3d38 --- /dev/null +++ b/examples/basic_exabgp/exabgp.conf.R2 @@ -0,0 +1,11 @@ +neighbor 10.0.0.1 { + router-id 2.2.2.2; + local-address 10.0.0.2; + local-as 2; + peer-as 1; + #graceful-restart; + + static { + route 8.8.8.8/32 next-hop 10.0.0.2; + } +} diff --git a/examples/basic_exabgp/frr.conf.R1 b/examples/basic_exabgp/frr.conf.R1 new file mode 100644 index 0000000..c98bdeb --- /dev/null +++ b/examples/basic_exabgp/frr.conf.R1 @@ -0,0 +1,22 @@ +hostname R1 +log file /tmp/frr.log +! +int net0 + ip address 10.0.0.1/24 + no shutdown +! +router bgp 1 + bgp router-id 1.1.1.1 + neighbor 10.0.0.2 remote-as 2 + neighbor 10.0.0.2 capability extended-nexthop + ! + address-family ipv4 unicast + redistribute kernel + exit-address-family + ! + address-family ipv4 vpn + neighbor 10.0.0.2 activate + exit-address-family +! +line vty +! diff --git a/examples/basic_exabgp/spec.yaml b/examples/basic_exabgp/spec.yaml new file mode 100644 index 0000000..c05de48 --- /dev/null +++ b/examples/basic_exabgp/spec.yaml @@ -0,0 +1,28 @@ + +postinit: + - cmds: + - cmd: docker cp daemons.R1 R1:/etc/frr/daemons + - cmd: docker cp frr.conf.R1 R1:/etc/frr/frr.conf + - cmd: docker cp exabgp.conf.R2 R2:/root/exabgp.conf + +nodes: + - name: R1 + # image: slankdev/centos-frr-dev:7 + image: slankdev/frr:centos-7-latest + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/exabgp + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: sysctl -w 'net.ipv6.conf.net0.disable_ipv6=0' + - cmd: /usr/lib/frr/frrinit.sh start + - name: R2 + cmds: + - cmd: sysctl -w 'net.ipv6.conf.net0.disable_ipv6=0' + - cmd: ip addr add 10.0.0.2/24 dev net0 + diff --git a/examples/basic_gre/README.md b/examples/basic_gre/README.md new file mode 100644 index 0000000..1616128 --- /dev/null +++ b/examples/basic_gre/README.md @@ -0,0 +1,11 @@ + +# GRE + +![](topo.jpeg) + +``` +modprobe ip_gre +ip tunnel add mode gre remote local ttl +ip link set mtu up +ip addr add / dev +``` diff --git a/examples/basic_gre/spec.yaml b/examples/basic_gre/spec.yaml new file mode 100644 index 0000000..486742a --- /dev/null +++ b/examples/basic_gre/spec.yaml @@ -0,0 +1,180 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R4#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: R5#net0 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: R6#net0 } + - name: R5 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R3#net1 } + - name: R6 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R4#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.255.0.1/32 dev lo + - cmd: ip addr add 10.0.0.1/30 dev net0 + - cmd: ip addr add 10.0.0.5/30 dev net1 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'router ospf' + -c ' ospf router-id 10.255.0.1' + -c ' network 10.255.0.1/32 area 0' + -c ' network 10.0.0.0/30 area 0' + -c ' network 10.0.0.4/30 area 0' + - name: R2 + cmds: + - cmd: ip addr add 10.255.0.2/32 dev lo + - cmd: ip addr add 10.0.0.2/30 dev net0 + - cmd: ip addr add 10.0.0.9/30 dev net1 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'router ospf' + -c ' ospf router-id 10.255.0.2' + -c ' network 10.255.0.2/32 area 0' + -c ' network 10.0.0.0/30 area 0' + -c ' network 10.0.0.8/30 area 0' + - name: R3 + cmds: + - cmd: ip addr add 10.255.0.3/32 dev lo + - cmd: ip addr add 10.0.0.6/30 dev net0 + - cmd: ip addr add 10.0.0.13/30 dev net1 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'ip route 10.0.0.8/30 10.0.0.5' ## This is IMPORTANT..? + -c 'router ospf' + -c ' ospf router-id 10.255.0.3' + -c ' network 10.255.0.3/32 area 0' + -c ' network 10.0.0.4/30 area 0' + -c ' network 10.0.0.12/30 area 0' + -c ' network 20.0.0.0/30 area 0' + - cmd: ip tunnel add gre1 mode gre remote 10.255.0.4 local 10.255.0.3 ttl 10 + - cmd: ip link set gre1 up + - cmd: ip addr add 20.0.0.1/30 dev gre1 + - name: R4 + cmds: + - cmd: ip addr add 10.255.0.4/32 dev lo + - cmd: ip addr add 10.0.0.10/30 dev net0 + - cmd: ip addr add 10.0.0.17/30 dev net1 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'ip route 10.0.0.4/30 10.0.0.9' ## This is IMPORTANT..? + -c 'router ospf' + -c ' ospf router-id 10.255.0.4' + -c ' network 10.255.0.4/32 area 0' + -c ' network 10.0.0.8/30 area 0' + -c ' network 10.0.0.16/30 area 0' + -c ' network 20.0.0.0/30 area 0' + - cmd: ip tunnel add gre1 mode gre remote 10.255.0.3 local 10.255.0.4 ttl 10 + - cmd: ip link set gre1 up + - cmd: ip addr add 20.0.0.2/30 dev gre1 + - name: R5 + cmds: + - cmd: ip addr add 10.255.0.5/32 dev lo + - cmd: ip addr add 10.0.0.14/30 dev net0 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'router ospf' + -c ' ospf router-id 10.255.0.5' + -c ' network 10.255.0.5/32 area 0' + -c ' network 10.0.0.12/30 area 0' + - name: R6 + cmds: + - cmd: ip addr add 10.255.0.6/32 dev lo + - cmd: ip addr add 10.0.0.18/30 dev net0 + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'router ospf' + -c ' ospf router-id 10.255.0.6' + -c ' network 10.255.0.6/32 area 0' + -c ' network 10.0.0.16/30 area 0' + +test: + - name: p2p + cmds: + - cmd: docker exec R1 ping -c2 10.0.0.1 + - cmd: docker exec R1 ping -c2 10.0.0.2 + - cmd: docker exec R1 ping -c2 10.0.0.5 + - cmd: docker exec R1 ping -c2 10.0.0.6 + - cmd: docker exec R2 ping -c2 10.0.0.1 + - cmd: docker exec R2 ping -c2 10.0.0.2 + - cmd: docker exec R2 ping -c2 10.0.0.9 + - cmd: docker exec R2 ping -c2 10.0.0.10 + - cmd: docker exec R3 ping -c2 10.0.0.5 + - cmd: docker exec R3 ping -c2 10.0.0.6 + - cmd: docker exec R3 ping -c2 10.0.0.13 + - cmd: docker exec R3 ping -c2 10.0.0.14 + - cmd: docker exec R4 ping -c2 10.0.0.9 + - cmd: docker exec R4 ping -c2 10.0.0.10 + - cmd: docker exec R4 ping -c2 10.0.0.17 + - cmd: docker exec R4 ping -c2 10.0.0.18 + - cmd: docker exec R5 ping -c2 10.0.0.13 + - cmd: docker exec R5 ping -c2 10.0.0.14 + - cmd: docker exec R6 ping -c2 10.0.0.17 + - cmd: docker exec R6 ping -c2 10.0.0.18 + - name: lo + cmds: + - cmd: docker exec R1 ping -c2 10.255.0.1 + - cmd: docker exec R1 ping -c2 10.255.0.2 + - cmd: docker exec R1 ping -c2 10.255.0.3 + - cmd: docker exec R1 ping -c2 10.255.0.4 + - cmd: docker exec R1 ping -c2 10.255.0.5 + - cmd: docker exec R1 ping -c2 10.255.0.6 + - cmd: docker exec R2 ping -c2 10.255.0.1 + - cmd: docker exec R2 ping -c2 10.255.0.2 + - cmd: docker exec R2 ping -c2 10.255.0.3 + - cmd: docker exec R2 ping -c2 10.255.0.4 + - cmd: docker exec R2 ping -c2 10.255.0.5 + - cmd: docker exec R2 ping -c2 10.255.0.6 + - cmd: docker exec R3 ping -c2 10.255.0.1 + - cmd: docker exec R3 ping -c2 10.255.0.2 + - cmd: docker exec R3 ping -c2 10.255.0.3 + - cmd: docker exec R3 ping -c2 10.255.0.4 + - cmd: docker exec R3 ping -c2 10.255.0.5 + - cmd: docker exec R3 ping -c2 10.255.0.6 + - cmd: docker exec R4 ping -c2 10.255.0.1 + - cmd: docker exec R4 ping -c2 10.255.0.2 + - cmd: docker exec R4 ping -c2 10.255.0.3 + - cmd: docker exec R4 ping -c2 10.255.0.4 + - cmd: docker exec R4 ping -c2 10.255.0.5 + - cmd: docker exec R4 ping -c2 10.255.0.6 + - cmd: docker exec R5 ping -c2 10.255.0.1 + - cmd: docker exec R5 ping -c2 10.255.0.2 + - cmd: docker exec R5 ping -c2 10.255.0.3 + - cmd: docker exec R5 ping -c2 10.255.0.4 + - cmd: docker exec R5 ping -c2 10.255.0.5 + - cmd: docker exec R5 ping -c2 10.255.0.6 + - cmd: docker exec R6 ping -c2 10.255.0.1 + - cmd: docker exec R6 ping -c2 10.255.0.2 + - cmd: docker exec R6 ping -c2 10.255.0.3 + - cmd: docker exec R6 ping -c2 10.255.0.4 + - cmd: docker exec R6 ping -c2 10.255.0.5 + - cmd: docker exec R6 ping -c2 10.255.0.6 + + diff --git a/examples/basic_gre/topo.jpeg b/examples/basic_gre/topo.jpeg new file mode 100644 index 0000000..b7ccbb1 Binary files /dev/null and b/examples/basic_gre/topo.jpeg differ diff --git a/examples/basic_haproxy/README.md b/examples/basic_haproxy/README.md new file mode 100644 index 0000000..0691c0f --- /dev/null +++ b/examples/basic_haproxy/README.md @@ -0,0 +1,25 @@ +# HAProxy demonstration + +![](./topo.png) + +**How to test**
+P1 is configured HAProxy container as-a TCP proxy. +You can check the behabiour of proxy when you run +the curl command to access 10.0.0.1(P1's address) on C1. +``` +$ cd /path/to/here +$ tn upconf | sudo sh +... +$ docker exec C1 curl -s 10.0.0.1 +S1 +$ docker exec C1 curl -s 10.0.0.1 +S2 +$ docker exec C1 curl -s 10.0.0.1 +S3 +$ docker exec C1 curl -s 10.0.0.1 +S4 +$ docker exec C1 curl -s 10.0.0.1 +S1 +$ docker exec C1 curl -s 10.0.0.1 +S2 +``` diff --git a/examples/basic_haproxy/spec.yaml b/examples/basic_haproxy/spec.yaml new file mode 100644 index 0000000..967ff37 --- /dev/null +++ b/examples/basic_haproxy/spec.yaml @@ -0,0 +1,92 @@ + +nodes: + - name: C1 + image: slankdev/sandbox + interfaces: + - { name: net0, type: direct, args: P1#net0 } + - name: P1 + image: slankdev/sandbox + interfaces: + - { name: net0, type: direct, args: C1#net0 } + - { name: net1, type: bridge, args: SW } + - name: S1 + image: slankdev/sandbox + interfaces: [ { name: net0, type: bridge, args: SW } ] + - name: S2 + image: slankdev/sandbox + interfaces: [ { name: net0, type: bridge, args: SW } ] + - name: S3 + image: slankdev/sandbox + interfaces: [ { name: net0, type: bridge, args: SW } ] + - name: S4 + image: slankdev/sandbox + interfaces: [ { name: net0, type: bridge, args: SW } ] + +switches: + - name: SW + interfaces: + - { name: net1, type: docker, args: P1 } + - { name: net0, type: docker, args: S1 } + - { name: net0, type: docker, args: S2 } + - { name: net0, type: docker, args: S3 } + - { name: net0, type: docker, args: S4 } + +node_configs: + - name: C1 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - name: P1 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 10.1.0.254/24 dev net1 + - cmd: bash -c "echo 'global ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' daemon ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' ' >> /root/haproxy.conf" + - cmd: bash -c "echo 'defaults ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' log global ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' mode tcp ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' ' >> /root/haproxy.conf" + - cmd: bash -c "echo 'frontend main ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' bind *:80 ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' default_backend static ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' ' >> /root/haproxy.conf" + - cmd: bash -c "echo 'backend static ' >> /root/haproxy.conf" + - cmd: bash -c "echo ' server S1 10.1.0.1:80 check' >> /root/haproxy.conf" + - cmd: bash -c "echo ' server S2 10.1.0.2:80 check' >> /root/haproxy.conf" + - cmd: bash -c "echo ' server S3 10.1.0.3:80 check' >> /root/haproxy.conf" + - cmd: bash -c "echo ' server S4 10.1.0.4:80 check' >> /root/haproxy.conf" + - cmd: haproxy -f /root/haproxy.conf + + - name: S1 + cmds: + - cmd: ip addr add 10.1.0.1/24 dev net0 + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - name: S2 + cmds: + - cmd: ip addr add 10.1.0.2/24 dev net0 + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - name: S3 + cmds: + - cmd: ip addr add 10.1.0.3/24 dev net0 + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + - name: S4 + cmds: + - cmd: ip addr add 10.1.0.4/24 dev net0 + - cmd: sh -c "cat /etc/hostname > index.html" + - cmd: nohup python3 -m http.server 80 & + +test: + - name: p2p + cmds: + - cmd: docker exec C1 ping -c2 10.0.0.1 + - cmd: docker exec C1 ping -c2 10.0.0.2 + - cmd: docker exec P1 ping -c2 10.0.0.1 + - cmd: docker exec P1 ping -c2 10.0.0.2 + - cmd: docker exec P1 ping -c2 10.1.0.1 + - cmd: docker exec P1 ping -c2 10.1.0.2 + - cmd: docker exec P1 ping -c2 10.1.0.3 + - cmd: docker exec P1 ping -c2 10.1.0.4 + diff --git a/examples/basic_haproxy/topo.png b/examples/basic_haproxy/topo.png new file mode 100644 index 0000000..dfeeef6 Binary files /dev/null and b/examples/basic_haproxy/topo.png differ diff --git a/examples/basic_ibgp_rr/spec.yaml b/examples/basic_ibgp_rr/spec.yaml new file mode 100644 index 0000000..56ed305 --- /dev/null +++ b/examples/basic_ibgp_rr/spec.yaml @@ -0,0 +1,181 @@ + +# DESCRIPTION: +# Basic iBGP RR test using and FRR +# create reachability with loopback with OSPF +# +# INIT: +# cns spec.yaml init | sudo sh +# cns spec.yaml conf | sudo sh +# cns spec.yaml test | sudo sh +# FINI: +# cns spec.yaml fini | sudo sh +# TOPO: +# 10.0.0.0/24 .1(net0) +# B0----+-----------------+-----------------+------RR0(255.1.0.1) +# | | | +# |.10(net0) |.11(net0) |.12(net0) +# R0(255.10.0.1) R1(255.11.0.1) R2(255.12.0.1) +# |.1(net1) |.1(net1) |.1(net1) +# | | | +# |192.168.10.0/24 |192.168.11.0/24 |192.168.12.0/24 +# | | | +# |.2(net0) |.2(net0) |.2(net0) +# C0 C1 C2 +# + +nodes: + - name: RR0 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + + - name: R0 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + - { name: net1, type: direct, args: C0#net0 } + - name: C0 + image: slankdev/ubuntu:16.04 + interfaces: + - { name: net0, type: direct, args: R0#net1 } + + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + - { name: net1, type: direct, args: C1#net0 } + - name: C1 + image: slankdev/ubuntu:16.04 + interfaces: + - { name: net0, type: direct, args: R1#net1 } + + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: bridge, args: B0 } + - { name: net1, type: direct, args: C2#net0 } + - name: C2 + image: slankdev/ubuntu:16.04 + interfaces: + - { name: net0, type: direct, args: R2#net1 } + +switches: + - name: B0 + interfaces: + - { name: net0, type: container, args: RR0 } + - { name: net0, type: container, args: R0 } + - { name: net0, type: container, args: R1 } + - { name: net0, type: container, args: R2 } + +node_configs: + - name: RR0 + cmds: + - cmd: >- + vtysh -c "conf t" + -c "interface lo" -c "ip address 10.255.0.1/32" -c "exit" + -c "interface net0" -c "ip address 10.0.0.1/24" -c "exit" + -c "router ospf" + -c " network 10.255.0.1/32 area 0" + -c " network 10.0.0.0/24 area 0" + -c "exit" + -c "router bgp 100" + -c " bgp router-id 10.255.0.1" + -c " neighbor 10.255.0.10 remote-as 100" + -c " neighbor 10.255.0.10 update-source lo" + -c " neighbor 10.255.0.11 remote-as 100" + -c " neighbor 10.255.0.11 update-source lo" + -c " neighbor 10.255.0.12 remote-as 100" + -c " neighbor 10.255.0.12 update-source lo" + -c " address-family ipv4 unicast" + -c " neighbor 10.255.0.10 route-reflector-client" + -c " neighbor 10.255.0.11 route-reflector-client" + -c " neighbor 10.255.0.12 route-reflector-client" + -c " exit-address-family" + -c "exit" + + - name: R0 + cmds: + - cmd: >- + vtysh -c "conf t" + -c "interface lo" -c "ip address 10.255.0.10/32" -c "exit" + -c "interface net0" -c "ip address 10.0.0.10/24" -c "exit" + -c "interface net1" -c "ip address 192.168.10.1/24" -c "exit" + -c "router ospf" + -c " network 10.255.0.10/32 area 0" + -c " network 10.0.0.0/24 area 0" + -c "exit" + -c "router bgp 100" + -c " bgp router-id 10.255.0.10" + -c " neighbor 10.255.0.1 remote-as 100" + -c " neighbor 10.255.0.1 update-source lo" + -c " network 192.168.10.0/24" + -c "exit" + + - name: R1 + cmds: + - cmd: >- + vtysh -c "conf t" + -c "interface lo" -c "ip address 10.255.0.11/32" -c "exit" + -c "interface net0" -c "ip address 10.0.0.11/24" -c "exit" + -c "interface net1" -c "ip address 192.168.11.1/24" -c "exit" + -c "router ospf" + -c " network 10.255.0.11/32 area 0" + -c " network 10.0.0.0/24 area 0" + -c "exit" + -c "router bgp 100" + -c " bgp router-id 10.255.0.11" + -c " neighbor 10.255.0.1 remote-as 100" + -c " neighbor 10.255.0.1 update-source lo" + -c " network 192.168.11.0/24" + -c "exit" + + - name: R2 + cmds: + - cmd: >- + vtysh -c "conf t" + -c "interface lo" -c "ip address 10.255.0.12/32" -c "exit" + -c "interface net0" -c "ip address 10.0.0.12/24" -c "exit" + -c "interface net1" -c "ip address 192.168.12.1/24" -c "exit" + -c "router ospf" + -c " network 10.255.0.12/32 area 0" + -c " network 10.0.0.0/24 area 0" + -c "exit" + -c "router bgp 100" + -c " bgp router-id 10.255.0.12" + -c " neighbor 10.255.0.1 remote-as 100" + -c " neighbor 10.255.0.1 update-source lo" + -c " network 192.168.12.0/24" + -c "exit" + + - name: C0 + cmds: + - cmd: ip addr add 192.168.10.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 192.168.10.1 + - name: C1 + cmds: + - cmd: ip addr add 192.168.11.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 192.168.11.1 + - name: C2 + cmds: + - cmd: ip addr add 192.168.12.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 192.168.12.1 + +test: + - cmds: + - cmd: docker exec RR0 ping -c2 10.255.0.1 + - cmd: docker exec RR0 ping -c2 10.255.0.10 + - cmd: docker exec RR0 ping -c2 10.255.0.11 + - cmd: docker exec RR0 ping -c2 10.255.0.12 + - cmd: docker exec C0 ping -c2 192.168.10.1 + - cmd: docker exec C0 ping -c2 192.168.11.2 + - cmd: docker exec C0 ping -c2 192.168.12.2 + - cmd: docker exec C1 ping -c2 192.168.11.1 + - cmd: docker exec C1 ping -c2 192.168.10.2 + - cmd: docker exec C1 ping -c2 192.168.12.2 + - cmd: docker exec C2 ping -c2 192.168.12.1 + - cmd: docker exec C2 ping -c2 192.168.10.2 + - cmd: docker exec C2 ping -c2 192.168.11.2 + diff --git a/examples/basic_ipip/anycast_tunnel/spec.yaml b/examples/basic_ipip/anycast_tunnel/spec.yaml new file mode 100644 index 0000000..00f77a8 --- /dev/null +++ b/examples/basic_ipip/anycast_tunnel/spec.yaml @@ -0,0 +1,204 @@ + +postinit: + - cmds: + - cmd: docker cp /root/dotfiles/bin/linkstat.py CLOS:/usr/bin/linkstat.py + - cmd: docker cp /root/dotfiles/bin/http_server.py CS:/usr/bin/http_server.py + - cmd: docker cp /root/dotfiles/bin/echo_server.py CS:/usr/bin/echo_server.py + +nodes: + - name: CLOS + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net1, type: direct, args: N1#net0 } + - { name: net2, type: direct, args: N2#net0 } + - { name: net3, type: direct, args: N2#net0 } + - { name: up1, type: direct, args: CS#net0 } + - { name: dn1, type: direct, args: HV1#net0 } + + - name: N1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: CLOS#net1 } + - name: N2 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: CLOS#net2 } + - name: N3 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: CLOS#net3 } + + - name: HV1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: CLOS#dn1 } + - name: CS + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: CLOS#up1 } + +node_configs: + - name: CLOS + cmds: + - cmd: ip addr add 10.255.0.10/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: sysctl -w net.ipv4.fib_multipath_hash_policy=1 + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 10" + -c " bgp router-id 10.255.0.10" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net1 interface peer-group FABRIC" + -c " neighbor net2 interface peer-group FABRIC" + -c " neighbor net3 interface peer-group FABRIC" + -c " neighbor up1 interface peer-group FABRIC" + -c " neighbor dn1 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " network 10.255.0.10/32" + -c " exit-address-family" + + - name: N1 + cmds: + - cmd: ip addr add 10.255.0.1/32 dev lo + - cmd: ip addr add 10.255.0.254/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 1" + -c " bgp router-id 10.255.0.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " network 10.255.0.1/32" + -c " network 10.255.0.254/32" + -c " exit-address-family" + - cmd: ip tunnel add tun-nat2 mode ipip local 10.255.0.1 remote 10.255.0.2 dev net0 + - cmd: ip addr add 10.254.0.1/32 peer 10.254.0.2/32 dev tun-nat2 + - cmd: ip link set tun-nat2 up + - cmd: ip tunnel add tun-nat3 mode ipip local 10.255.0.1 remote 10.255.0.3 dev net0 + - cmd: ip addr add 10.254.0.1/32 peer 10.254.0.3/32 dev tun-nat3 + - cmd: ip link set tun-nat3 up + + - cmd: ip link set tunl0 up + - cmd: iptables -t nat -A POSTROUTING -s 10.255.0.20/32 -j SNAT -p tcp --to-source 10.255.0.254:10000-10063 + + - name: N2 + cmds: + - cmd: ip addr add 10.255.0.2/32 dev lo + - cmd: ip addr add 10.255.0.254/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 2" + -c " bgp router-id 10.255.0.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " network 10.255.0.2/32" + -c " !network 10.255.0.254/32" + -c " exit-address-family" + - cmd: ip tunnel add tun-nat1 mode ipip local 10.255.0.2 remote 10.255.0.1 dev net0 + - cmd: ip addr add 10.254.0.2/32 peer 10.254.0.1/32 dev tun-nat1 + - cmd: ip link set tun-nat1 up + - cmd: ip tunnel add tun-nat3 mode ipip local 10.255.0.2 remote 10.255.0.3 dev net0 + - cmd: ip addr add 10.254.0.2/32 peer 10.254.0.3/32 dev tun-nat3 + - cmd: ip link set tun-nat3 up + + - cmd: ip link set tunl0 up + + - name: N3 + cmds: + - cmd: ip addr add 10.255.0.3/32 dev lo + - cmd: ip addr add 10.255.0.254/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 3" + -c " bgp router-id 10.255.0.3" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " network 10.255.0.3/32" + -c " !network 10.255.0.254/32" + -c " exit-address-family" + - cmd: ip tunnel add tun-nat1 mode ipip local 10.255.0.3 remote 10.255.0.1 dev net0 + - cmd: ip addr add 10.254.0.3/32 peer 10.254.0.1/32 dev tun-nat1 + - cmd: ip link set tun-nat1 up + - cmd: ip tunnel add tun-nat2 mode ipip local 10.255.0.3 remote 10.255.0.2 dev net0 + - cmd: ip addr add 10.254.0.3/32 peer 10.254.0.2/32 dev tun-nat2 + - cmd: ip link set tun-nat2 up + + - cmd: ip link set tunl0 up + + - name: HV1 + cmds: + - cmd: ip addr add 10.255.0.20/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 20" + -c " bgp router-id 10.255.0.20" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " network 10.255.0.20/32" + -c " exit-address-family" + + - cmd: ip tunnel add tun-nat1 mode ipip remote 10.255.0.254 dev net0 + - cmd: ip link set tun-nat1 up + - cmd: ip route add default dev tun-nat1 + + - name: CS + cmds: + - cmd: ip addr add 10.255.0.30/32 dev lo + - cmd: ip addr add 8.8.8.8/32 dev lo + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 30" + -c " bgp router-id 10.255.0.30" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " network 10.255.0.30/32" + -c " network 0.0.0.0/0" + -c " exit-address-family" + + - cmd: nohup /usr/bin/http_server.py & + - cmd: nohup /usr/bin/echo_server.py & diff --git a/examples/basic_ipip/simple/README.md b/examples/basic_ipip/simple/README.md new file mode 100644 index 0000000..bdcf6fa --- /dev/null +++ b/examples/basic_ipip/simple/README.md @@ -0,0 +1,5 @@ + +# IPIP tunnel + +![](topo.png) + diff --git a/examples/basic_ipip/simple/spec.yaml b/examples/basic_ipip/simple/spec.yaml new file mode 100644 index 0000000..ea5fb71 --- /dev/null +++ b/examples/basic_ipip/simple/spec.yaml @@ -0,0 +1,39 @@ + +meta: + namespace: ns_ + +nodes: + - name: R1 + image: slankdev/frr:centos-7-stable-7.0 + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/frr:centos-7-stable-7.0 + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R3 + image: slankdev/frr:centos-7-stable-7.0 + interfaces: + - { name: net0, type: direct, args: R2#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip route add default via 10.0.0.2 + - cmd: ip tunnel add tun0 mode ipip remote 10.1.0.2 local 10.0.0.1 dev net0 + - cmd: ip addr add 1.1.1.1 peer 1.1.1.2 dev tun0 + - cmd: ip link set tun0 up + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip addr add 10.1.0.1/24 dev net1 + - name: R3 + cmds: + - cmd: ip addr add 10.1.0.2/24 dev net0 + - cmd: ip route add default via 10.1.0.1 + - cmd: ip tunnel add tun0 mode ipip remote 10.0.0.1 local 10.1.0.2 dev net0 + - cmd: ip addr add 1.1.1.2 peer 1.1.1.1 dev tun0 + - cmd: ip link set tun0 up + diff --git a/examples/basic_ipip/simple/topo.png b/examples/basic_ipip/simple/topo.png new file mode 100644 index 0000000..cf36aa1 Binary files /dev/null and b/examples/basic_ipip/simple/topo.png differ diff --git a/examples/basic_iptables/napt/README.md b/examples/basic_iptables/napt/README.md new file mode 100644 index 0000000..0b26e8d --- /dev/null +++ b/examples/basic_iptables/napt/README.md @@ -0,0 +1,11 @@ + +# Managed NAPT example + +``` +tn upconf | sudo sh +docker exec -it S1 tcpdump -ni net0 -Qin '(tcp[tcpflags] & tcp-syn)' != 0 +docker exec C1 curl --interface 10.0.0.2 20.0.0.2 +docker exec C1 curl --interface 10.0.0.3 20.0.0.2 +docker exec C1 curl --interface 10.0.0.4 20.0.0.2 +docker exec S1 conntrack -L +``` diff --git a/examples/basic_iptables/napt/spec.yaml b/examples/basic_iptables/napt/spec.yaml new file mode 100644 index 0000000..bee8525 --- /dev/null +++ b/examples/basic_iptables/napt/spec.yaml @@ -0,0 +1,71 @@ + +# DESCRIPTION: NAPT network using FRR +# +# TOPO: +# S0 +# (net0).2| +# | +# WAN:20.0.0.0/24 | +# | +# (net0).1| +# R1(NAPT) +# (net1).1| +# | +# LAN:10.0.0.0/24 | +# | +# (net0).2| +# C0 +# +# INIT: +# cns spec7.yaml init | sudo sh +# ./setup7.sh +# FINI: +# cns spec7.yaml fini | sudo sh +# + +nodes: + - name: R1 + image: slankdev/conntrack + interfaces: + - { name: net0, type: direct, args: S1#net0, } + - { name: net1, type: direct, args: C1#net0, } + - name: S1 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R1#net0, } ] + - name: C1 + image: slankdev/ubuntu:18.04 + interfaces: [ { name: net0, type: direct, args: R1#net1, } ] + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net1 + - cmd: ip addr add 20.0.0.1/24 dev net0 + + ####################### + ## NAT CONFIGURATION ## + ####################### + - cmd: ip addr add 20.0.0.100/24 dev net0 + - cmd: ip addr add 20.0.0.101/24 dev net0 + - cmd: >- + iptables -t nat -A POSTROUTING -s 10.0.0.2/32 + -j SNAT -p tcp --to-source 20.0.0.100:10000-10008 + - cmd: >- + iptables -t nat -A POSTROUTING -s 10.0.0.3/32 + -j SNAT -p tcp --to-source 20.0.0.100:20000-20008 + - cmd: >- + iptables -t nat -A POSTROUTING -s 10.0.0.4/32 + -j SNAT -p tcp --to-source 20.0.0.101:30000-30008 + + - name: S1 + cmds: + - cmd: ip addr add 20.0.0.2/24 dev net0 + - cmd: ip route add default via 20.0.0.1 + - cmd: nohup python3 -m http.server 80 & + - name: C1 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip addr add 10.0.0.3/24 dev net0 + - cmd: ip addr add 10.0.0.4/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + diff --git a/examples/basic_iptables/test/README.md b/examples/basic_iptables/test/README.md new file mode 100644 index 0000000..a8a84a0 --- /dev/null +++ b/examples/basic_iptables/test/README.md @@ -0,0 +1,40 @@ + +# iptables study + +``` +root@R2:/# iptables -L +Chain INPUT (policy ACCEPT) +target prot opt source destination + +Chain FORWARD (policy ACCEPT) +target prot opt source destination +LOG all -- 10.0.0.2 anywhere LOG level warning + +Chain OUTPUT (policy ACCEPT) +target prot opt source destination +``` + +``` +root@R2:/# iptables-save │ +# Generated by iptables-save v1.6.1 on Wed May 15 10:12:54 2019 │ +*filter │ +:INPUT ACCEPT [5:420] │ +:FORWARD ACCEPT [6:504] │ +:OUTPUT ACCEPT [5:420] │ +-A FORWARD -s 10.0.0.2/32 -j LOG │ +COMMIT │ +# Completed on Wed May 15 10:12:54 2019 +``` + +``` +root@R2:/# iptables -A FORWARD -s 10.0.0.2 -j LOG +root@R2:/# iptables -D FORWARD -s 10.0.0.2 -j LOG +``` + +If you want to check the LOG of iptables on network-namespace, +following kernel option helps you. this option enables us, +output netns's log to host's log. +``` +sudo sh -c 'echo 0 > /proc/sys/net/netfilter/nf_log_all_netns' +dmesg +``` diff --git a/examples/basic_iptables/test/spec.yaml b/examples/basic_iptables/test/spec.yaml new file mode 100644 index 0000000..77abdab --- /dev/null +++ b/examples/basic_iptables/test/spec.yaml @@ -0,0 +1,30 @@ + +nodes: + - name: R1 + image: slankdev/sandbox + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/sandbox + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R3 + image: slankdev/sandbox + interfaces: + - { name: net0, type: direct, args: R2#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 20.0.0.1/24 dev net1 + - name: R3 + cmds: + - cmd: ip addr add 20.0.0.2/24 dev net0 + - cmd: ip route add default via 20.0.0.1 + diff --git a/examples/basic_isis/README.md b/examples/basic_isis/README.md new file mode 100644 index 0000000..da69328 --- /dev/null +++ b/examples/basic_isis/README.md @@ -0,0 +1,12 @@ + +# ISIS + +![](topo.png) + +``` +tn upconf | sudo sh +``` + +## Reference + +- http://docs.frrouting.org/en/latest/isisd.html diff --git a/examples/basic_isis/spec.yaml b/examples/basic_isis/spec.yaml new file mode 100644 index 0000000..d80860e --- /dev/null +++ b/examples/basic_isis/spec.yaml @@ -0,0 +1,217 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - { name: net2, type: direct, args: R5#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R4#net0 } + - { name: net2, type: direct, args: R6#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: R4#net1 } + - { name: net2, type: direct, args: R7#net0 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: R3#net1 } + - { name: net2, type: direct, args: R8#net0 } + - name: R5 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net2 } + - name: R6 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net2 } + - name: R7 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R3#net2 } + - name: R8 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R4#net2 } + +node_configs: + - name: R1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int lo' + -c ' ip address 10.255.0.1/32' + -c ' exit' + -c 'int net0' + -c ' ip address 10.0.0.1/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net1' + -c ' ip address 10.0.0.5/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net2' + -c ' ip address 20.1.0.1/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'router isis FOO' + -c ' net 47.0023.0000.0000.0001.00' + -c ' mpls-te on' + -c ' mpls-te router-address 10.255.0.1' + -c ' exit' + + - name: R2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int lo' + -c ' ip address 10.255.0.2/32' + -c ' exit' + -c 'int net0' + -c ' ip address 10.0.0.2/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net1' + -c ' ip address 10.0.0.9/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net2' + -c ' ip address 20.2.0.1/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'router isis FOO' + -c ' net 47.0023.0000.0000.0002.00' + -c ' mpls-te on' + -c ' mpls-te router-address 10.255.0.2' + -c ' exit' + - name: R3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int lo' + -c ' ip address 10.255.0.3/32' + -c ' exit' + -c 'int net0' + -c ' ip address 10.0.0.6/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net1' + -c ' ip address 10.0.0.13/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net2' + -c ' ip address 20.3.0.1/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'router isis FOO' + -c ' net 47.0023.0000.0000.0003.00' + -c ' mpls-te on' + -c ' mpls-te router-address 10.255.0.3' + -c ' exit' + - name: R4 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int lo' + -c ' ip address 10.255.0.4/32' + -c ' exit' + -c 'int net0' + -c ' ip address 10.0.0.10/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net1' + -c ' ip address 10.0.0.14/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'int net2' + -c ' ip address 20.4.0.1/30' + -c ' ip router isis FOO' + -c ' exit' + -c 'router isis FOO' + -c ' net 47.0023.0000.0000.0004.00' + -c ' mpls-te on' + -c ' mpls-te router-address 10.255.0.4' + -c ' exit' + + - name: R5 + cmds: + - cmd: ip addr add 20.1.0.2/24 dev net0 + - cmd: ip route replace default via 20.1.0.1 + - name: R6 + cmds: + - cmd: ip addr add 20.2.0.2/24 dev net0 + - cmd: ip route replace default via 20.2.0.1 + - name: R7 + cmds: + - cmd: ip addr add 20.3.0.2/24 dev net0 + - cmd: ip route replace default via 20.3.0.1 + - name: R8 + cmds: + - cmd: ip addr add 20.4.0.2/24 dev net0 + - cmd: ip route replace default via 20.4.0.1 + +test: + - name: p2p + cmds: + - cmd: docker exec R1 ping -c2 10.0.0.1 + - cmd: docker exec R1 ping -c2 10.0.0.2 + - cmd: docker exec R1 ping -c2 10.0.0.5 + - cmd: docker exec R1 ping -c2 10.0.0.6 + + - cmd: docker exec R2 ping -c2 10.0.0.1 + - cmd: docker exec R2 ping -c2 10.0.0.2 + - cmd: docker exec R2 ping -c2 10.0.0.9 + - cmd: docker exec R2 ping -c2 10.0.0.10 + + - cmd: docker exec R3 ping -c2 10.0.0.5 + - cmd: docker exec R3 ping -c2 10.0.0.6 + - cmd: docker exec R3 ping -c2 10.0.0.13 + - cmd: docker exec R3 ping -c2 10.0.0.14 + + - cmd: docker exec R4 ping -c2 10.0.0.9 + - cmd: docker exec R4 ping -c2 10.0.0.10 + - cmd: docker exec R4 ping -c2 10.0.0.13 + - cmd: docker exec R4 ping -c2 10.0.0.14 + + - cmd: docker exec R5 ping -c2 20.1.0.1 + - cmd: docker exec R5 ping -c2 20.1.0.2 + - cmd: docker exec R6 ping -c2 20.2.0.1 + - cmd: docker exec R6 ping -c2 20.2.0.2 + - cmd: docker exec R7 ping -c2 20.3.0.1 + - cmd: docker exec R7 ping -c2 20.3.0.2 + - cmd: docker exec R8 ping -c2 20.4.0.1 + - cmd: docker exec R8 ping -c2 20.4.0.2 + + - name: remote + cmds: + - cmd: docker exec R5 ping -c2 20.1.0.2 + - cmd: docker exec R5 ping -c2 20.2.0.2 + - cmd: docker exec R5 ping -c2 20.3.0.2 + - cmd: docker exec R5 ping -c2 20.4.0.2 + + - cmd: docker exec R6 ping -c2 20.1.0.2 + - cmd: docker exec R6 ping -c2 20.2.0.2 + - cmd: docker exec R6 ping -c2 20.3.0.2 + - cmd: docker exec R6 ping -c2 20.4.0.2 + + - cmd: docker exec R7 ping -c2 20.1.0.2 + - cmd: docker exec R7 ping -c2 20.2.0.2 + - cmd: docker exec R7 ping -c2 20.3.0.2 + - cmd: docker exec R7 ping -c2 20.4.0.2 + + - cmd: docker exec R8 ping -c2 20.1.0.2 + - cmd: docker exec R8 ping -c2 20.2.0.2 + - cmd: docker exec R8 ping -c2 20.3.0.2 + - cmd: docker exec R8 ping -c2 20.4.0.2 + diff --git a/examples/basic_isis/topo.png b/examples/basic_isis/topo.png new file mode 100644 index 0000000..5b29fc9 Binary files /dev/null and b/examples/basic_isis/topo.png differ diff --git a/examples/basic_ldp/README.md b/examples/basic_ldp/README.md new file mode 100644 index 0000000..c9d378e --- /dev/null +++ b/examples/basic_ldp/README.md @@ -0,0 +1,15 @@ + +# LDP Example + +create basic mpls backbone-network +![](./topo.png) + +``` +host# modprobe mpls_router +host# modprobe mpls_iptunnel +``` + +references +- https://github.com/FRRouting/frr/blob/master/doc/developer/ldpd-basic-test-setup.md +- https://github.com/FRRouting/frr/issues/651 +- http://docs.frrouting.org/en/latest/ldpd.html diff --git a/examples/basic_ldp/spec.yaml b/examples/basic_ldp/spec.yaml new file mode 100644 index 0000000..b3aa6d6 --- /dev/null +++ b/examples/basic_ldp/spec.yaml @@ -0,0 +1,70 @@ + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: sh -c 'enable_seg6_router.py | sh' + - cmd: sh -c 'echo 100000 > /proc/sys/net/mpls/platform_labels' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net0/input' + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf te' + -c 'int lo' + -c ' ip address 10.255.0.1/32' + -c '!' + -c 'int net0' + -c ' ip address 10.0.0.1/24' + -c ' ipv6 address 2001::1/64' + -c '!' + -c 'mpls ldp' + -c ' router-id 10.255.0.1' + -c ' neighbor 10.255.0.2 password slank' + -c ' !' + -c ' address-family ipv4' + -c ' discovery transport-address 10.255.0.1' + -c ' label local advertise explicit-null' + -c ' interface net0' + -c '!' + -c 'ip route 10.255.0.2 10.0.0.2 net0' + + - name: R2 + cmds: + - cmd: sh -c 'enable_seg6_router.py | sh' + - cmd: sh -c 'echo 100000 > /proc/sys/net/mpls/platform_labels' + - cmd: sh -c 'echo 1 > /proc/sys/net/mpls/conf/net0/input' + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf te' + -c 'int lo' + -c ' ip address 10.255.0.2/32' + -c '!' + -c 'int net0' + -c ' ip address 10.0.0.2/24' + -c ' ipv6 address 2001::2/64' + -c '!' + -c 'mpls ldp' + -c ' router-id 10.255.0.2' + -c ' neighbor 10.255.0.1 password slank' + -c ' !' + -c ' address-family ipv4' + -c ' discovery transport-address 10.255.0.2' + -c ' label local advertise explicit-null' + -c ' interface net0' + -c '!' + -c 'ip route 10.255.0.1 10.0.0.1 net0' + +test: + - name: p2p + cmds: + - cmd: echo slankdev slankdev + - cmd: echo slankdev slankdev + diff --git a/examples/basic_mpls/spec.yaml b/examples/basic_mpls/spec.yaml new file mode 100644 index 0000000..e96f042 --- /dev/null +++ b/examples/basic_mpls/spec.yaml @@ -0,0 +1,178 @@ +# DESCRIPTION: Basic MPLS Traffic Engneering +# TEST: +# docker exec C0 ping 192.168.1.2 -I 192.168.0.2 & +# docker exec C0 ping 192.168.1.20 -I 192.168.0.20 & +# docker exec R5 sysctl -w net.ipv4.ip_forward=0 +# +# TOPO: +# +------+ 10.1. +------+ 10.2. +------+ +# | | 0.0/24 .2| |.2 0.0/24 | | +# | C0 | +--+net0| R4 |net1+-+ | C1 | +# | | | | | | | | +# +------+ | +------+ | +------+ +# net0 | | net0 +# +.2 .20 | | +.2 .20 +# | | | | +# | | | | +# 192.168 | | | | 192.168 +# .0.0/24 +.1 +.1 .1+ .1+ .1.0/24 +# net1 net2 net2 net1 +# +------+ +------+ +------+ +------+ +# | |.2 .1| | | |.1 .2| | +# | R0 |net0+---+net1| R2 | | R3 |net1+---+net0| R1 | +# | | 10.3. | | | | 10.4. | | +# +------+ 0.0/24 +------+ +------+ 0.0/24 +------+ +# net0 net0 +# +.1 .1+ +# | | +# | | +# | | +# 10.0. | +------+ |10.0. +# 1.0/24| .2| |.2 |2.0/24 +# +--+net0| R5 |net1+-+ +# | | +# +------+ + + +pre_init: + - cmds: + - cmd: modprobe mpls_router + - cmd: modprobe mpls_gso + - cmd: modprobe mpls_iptunnel + +nodes: + - name: R0 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: C0#net0 } + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R3#net1 } + - { name: net1, type: direct, args: C1#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R5#net0 } + - { name: net1, type: direct, args: R0#net0 } + - { name: net2, type: direct, args: R4#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R5#net1 } + - { name: net1, type: direct, args: R1#net0 } + - { name: net2, type: direct, args: R4#net1 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net2 } + - { name: net1, type: direct, args: R3#net2 } + - name: R5 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: C0 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R0#net1 } + - name: C1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R1#net1 } + + +node_configs: + - name: R0 + cmds: + - cmd: sysctl -w net.ipv4.ip_forward=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.lo.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net0.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net1.input=1 > /dev/null + - cmd: sysctl -w net.mpls.platform_labels=1024 > /dev/null + - cmd: ip addr add 10.3.0.2/24 dev net0 + - cmd: ip addr add 192.168.0.1/24 dev net1 + - cmd: ip route add 192.168.1.0/24 via 10.3.0.1 + - cmd: ip route add 192.168.1.20/32 encap mpls 100 via inet 10.3.0.1 + - name: R1 + cmds: + - cmd: sysctl -w net.ipv4.ip_forward=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.lo.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net0.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net1.input=1 > /dev/null + - cmd: sysctl -w net.mpls.platform_labels=1024 > /dev/null + - cmd: ip addr add 10.4.0.2/24 dev net0 + - cmd: ip addr add 192.168.1.1/24 dev net1 + - cmd: ip route add 192.168.0.0/24 via 10.4.0.1 + - cmd: ip route add 192.168.0.20/32 encap mpls 200 via inet 10.4.0.1 + - name: R2 + cmds: + - cmd: sysctl -w net.ipv4.ip_forward=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.lo.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net0.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net1.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net2.input=1 > /dev/null + - cmd: sysctl -w net.mpls.platform_labels=1024 > /dev/null + - cmd: ip addr add 10.0.1.1/24 dev net0 + - cmd: ip addr add 10.3.0.1/24 dev net1 + - cmd: ip addr add 10.1.0.1/24 dev net2 + - cmd: ip route add 192.168.0.0/24 via 10.3.0.2 + - cmd: ip route add 192.168.1.0/24 via 10.0.1.2 + - cmd: ip -f mpls route add 100 via inet 10.1.0.2 + - name: R3 + cmds: + - cmd: sysctl -w net.ipv4.ip_forward=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.lo.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net0.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net1.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net2.input=1 > /dev/null + - cmd: sysctl -w net.mpls.platform_labels=1024 > /dev/null + - cmd: ip addr add 10.0.2.1/24 dev net0 + - cmd: ip addr add 10.4.0.1/24 dev net1 + - cmd: ip addr add 10.2.0.1/24 dev net2 + - cmd: ip route add 192.168.0.0/24 via 10.0.2.2 + - cmd: ip route add 192.168.1.0/24 via 10.4.0.2 + - cmd: ip -f mpls route add 200 via inet 10.2.0.2 + - name: R4 + cmds: + - cmd: sysctl -w net.ipv4.ip_forward=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.lo.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net0.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net1.input=1 > /dev/null + - cmd: sysctl -w net.mpls.platform_labels=1024 > /dev/null + - cmd: ip addr add 10.1.0.2/24 dev net0 + - cmd: ip addr add 10.2.0.2/24 dev net1 + - cmd: ip route add 192.168.0.0/24 via 10.1.0.1 + - cmd: ip route add 192.168.1.0/24 via 10.2.0.1 + - name: R5 + cmds: + - cmd: sysctl -w net.ipv4.ip_forward=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.lo.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net0.input=1 > /dev/null + - cmd: sysctl -w net.mpls.conf.net1.input=1 > /dev/null + - cmd: sysctl -w net.mpls.platform_labels=1024 > /dev/null + - cmd: ip addr add 10.0.1.2/24 dev net0 + - cmd: ip addr add 10.0.2.2/24 dev net1 + - cmd: ip route add 192.168.0.0/24 via 10.0.1.1 + - cmd: ip route add 192.168.1.0/24 via 10.0.2.1 + - name: C0 + cmds: + - cmd: ip addr add 192.168.0.2/24 dev net0 + - cmd: ip addr add 192.168.0.20/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 192.168.0.1 + - name: C1 + cmds: + - cmd: ip addr add 192.168.1.2/24 dev net0 + - cmd: ip addr add 192.168.1.20/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 192.168.1.1 + +test: + - cmds: + - cmd: docker exec C0 ping 192.168.1.2 -I 192.168.0.2 + - cmd: docker exec C0 ping 192.168.1.20 -I 192.168.0.20 + - cmd: docker exec R5 sysctl -w net.ipv4.ip_forward=0 + + diff --git a/examples/basic_namespace/README.md b/examples/basic_namespace/README.md new file mode 100644 index 0000000..28fbf1f --- /dev/null +++ b/examples/basic_namespace/README.md @@ -0,0 +1,17 @@ + +# Namespace Isolation + +![](./topo.png) + +``` +cd path/to/here +tn -f spec.blue.yaml upconf | sudo sh +tn -f spec.green.yaml upconf | sudo sh +docker ps +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +6d5f9e4d6c51 slankdev/ubuntu:18.04 "/bin/bash" 2 seconds ago Up 1 second green_R2 +92210c5eea85 slankdev/ubuntu:18.04 "/bin/bash" 3 seconds ago Up 2 seconds green_R1 +48a50568c9c1 slankdev/ubuntu:18.04 "/bin/bash" 7 seconds ago Up 6 seconds blue_R2 +86c2c4c9fc52 slankdev/ubuntu:18.04 "/bin/bash" 7 seconds ago Up 7 seconds blue_R1 +``` + diff --git a/examples/basic_namespace/spec.blue.yaml b/examples/basic_namespace/spec.blue.yaml new file mode 100644 index 0000000..211d540 --- /dev/null +++ b/examples/basic_namespace/spec.blue.yaml @@ -0,0 +1,22 @@ + +meta: + namespace: blue_ + +nodes: + - name: R1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + diff --git a/examples/basic_namespace/spec.green.yaml b/examples/basic_namespace/spec.green.yaml new file mode 100644 index 0000000..93d2f3f --- /dev/null +++ b/examples/basic_namespace/spec.green.yaml @@ -0,0 +1,22 @@ + +meta: + namespace: green_ + +nodes: + - name: R1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R1#net0 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + diff --git a/examples/basic_namespace/topo.png b/examples/basic_namespace/topo.png new file mode 100644 index 0000000..859c36e Binary files /dev/null and b/examples/basic_namespace/topo.png differ diff --git a/examples/basic_napt/spec.yaml b/examples/basic_napt/spec.yaml new file mode 100644 index 0000000..8e9a8bd --- /dev/null +++ b/examples/basic_napt/spec.yaml @@ -0,0 +1,80 @@ + +# DESCRIPTION: NAPT network using FRR +# +# TOPO: +# S0 +# (net0).2| +# | +# WAN:20.0.0.0/24 | +# | +# (net0).1| +# R1(NAPT) +# (net1).1| +# | +# LAN:10.0.0.0/24 | +# | +# (net0).2| +# C0 +# +# INIT: +# cns spec7.yaml init | sudo sh +# ./setup7.sh +# FINI: +# cns spec7.yaml fini | sudo sh +# + +nodes: + - name: R0 + image: slankdev/frr + interfaces: + - name: net0 + type: direct + args: S0#net0 + - name: net1 + type: direct + args: C0#net0 + - name: S0 + image: slankdev/ubuntu:16.04 + interfaces: + - name: net0 + type: direct + args: R0#net0 + - name: C0 + image: slankdev/ubuntu:16.04 + interfaces: + - name: net0 + type: direct + args: R0#net1 + +node_configs: + - name: R0 + cmds: + - cmd: >- + vtysh -c "conf t" + -c "interface net0" + -c "ip address 20.0.0.1/24" + -c "exit" + -c "interface net1" + -c "ip address 10.0.0.1/24" + -c "exit" + - cmd: >- + iptables -t nat -A POSTROUTING + -s 10.0.0.0/24 -j MASQUERADE + + - name: S0 + cmds: + - cmd: ip addr add 20.0.0.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 20.0.0.1 + + - name: C0 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip route del default + - cmd: ip route add default via 10.0.0.1 + +test: + - cmds: + - cmd: docker exec C0 ping -c2 20.0.0.2 + - cmd: docker exec -d S0 iperf -s + - cmd: docker exec C0 iperf -c 20.0.0.2 diff --git a/examples/basic_netns/spec.yaml b/examples/basic_netns/spec.yaml new file mode 100644 index 0000000..a97095f --- /dev/null +++ b/examples/basic_netns/spec.yaml @@ -0,0 +1,34 @@ + +nodes: + - name: H0 + type: netns + interfaces: + - { name: net0, type: direct, args: C0#net0 } + - { name: net1, type: direct, args: C1#net0 } + - name: C0 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: H0#net0 } + - name: C1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: H0#net1 } + +node_configs: + - name: H0 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 10.1.0.1/24 dev net1 + - name: C0 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip route replace default via 10.0.0.1 + - name: C1 + cmds: + - cmd: ip addr add 10.1.0.2/24 dev net0 + - cmd: ip route replace default via 10.1.0.1 + +test: + - cmds: + - cmd: echo slankdev + diff --git a/examples/basic_nftables/masquerade/README.md b/examples/basic_nftables/masquerade/README.md new file mode 100644 index 0000000..aa604a8 --- /dev/null +++ b/examples/basic_nftables/masquerade/README.md @@ -0,0 +1,18 @@ + +# nftables study (MASQ) + +check nft is enabled (m is OK) +``` +# cat /boot/config-`uname -r` | grep CONFIG_NF_TABLES +CONFIG_NF_TABLES=m +CONFIG_NF_TABLES_INET=m +CONFIG_NF_TABLES_NETDEV=m +CONFIG_NF_TABLES_IPV4=m +CONFIG_NF_TABLES_ARP=m +CONFIG_NF_TABLES_IPV6=m +CONFIG_NF_TABLES_BRIDGE=m +``` + +- Good reference + - https://knowledge.sakura.ad.jp/22636/ + - https://www.slideshare.net/s1061123/nftables-the-next-generation-firewall-in-linux diff --git a/examples/basic_nftables/masquerade/spec.yaml b/examples/basic_nftables/masquerade/spec.yaml new file mode 100644 index 0000000..dc1fb9a --- /dev/null +++ b/examples/basic_nftables/masquerade/spec.yaml @@ -0,0 +1,41 @@ + +postinit: + - cmds: + - cmd: docker cp ../../../tools/http_server.py R3:/usr/bin + - cmd: docker cp ../../../tools/echo_server.py R3:/usr/bin + +nodes: + - name: R1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R3 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: R2#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 20.0.0.1/24 dev net1 + - cmd: nft create table ip nat + - cmd: nft create chain ip nat prerouting { type nat hook prerouting priority 0 \;} + - cmd: nft create chain ip nat postrouting { type nat hook postrouting priority 0 \;} + - cmd: nft add rule nat postrouting ip saddr 10.0.0.0/24 oif net1 masquerade + + - name: R3 + cmds: + - cmd: ip addr add 20.0.0.2/24 dev net0 + - cmd: nohup http_server.py & + diff --git a/examples/basic_nftables/snat/README.md b/examples/basic_nftables/snat/README.md new file mode 100644 index 0000000..3fe1f72 --- /dev/null +++ b/examples/basic_nftables/snat/README.md @@ -0,0 +1,18 @@ + +# nftables study (SNAT) + +check nft is enabled (m is OK) +``` +# cat /boot/config-`uname -r` | grep CONFIG_NF_TABLES +CONFIG_NF_TABLES=m +CONFIG_NF_TABLES_INET=m +CONFIG_NF_TABLES_NETDEV=m +CONFIG_NF_TABLES_IPV4=m +CONFIG_NF_TABLES_ARP=m +CONFIG_NF_TABLES_IPV6=m +CONFIG_NF_TABLES_BRIDGE=m +``` + +- Good reference + - https://knowledge.sakura.ad.jp/22636/ + - https://www.slideshare.net/s1061123/nftables-the-next-generation-firewall-in-linux diff --git a/examples/basic_nftables/snat/spec.yaml b/examples/basic_nftables/snat/spec.yaml new file mode 100644 index 0000000..22b0a4c --- /dev/null +++ b/examples/basic_nftables/snat/spec.yaml @@ -0,0 +1,41 @@ + +postinit: + - cmds: + - cmd: docker cp ../../../tools/http_server.py R3:/usr/bin + - cmd: docker cp ../../../tools/echo_server.py R3:/usr/bin + +nodes: + - name: R1 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - name: R2 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R3#net0 } + - name: R3 + image: slankdev/conntrack:centos-7 + interfaces: + - { name: net0, type: direct, args: R2#net1 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.2/24 dev net0 + - cmd: ip route add default via 10.0.0.1 + + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.1/24 dev net0 + - cmd: ip addr add 20.0.0.1/24 dev net1 + - cmd: nft create table ip nat + - cmd: nft create chain ip nat prerouting { type nat hook prerouting priority 0 \;} + - cmd: nft create chain ip nat postrouting { type nat hook postrouting priority 0 \;} + - cmd: nft add rule nat postrouting ip protocol tcp snat to 20.0.0.1:100-200 + + - name: R3 + cmds: + - cmd: ip addr add 20.0.0.2/24 dev net0 + - cmd: nohup http_server.py & + diff --git a/examples/basic_ospfv2_bird/README.md b/examples/basic_ospfv2_bird/README.md new file mode 100644 index 0000000..460d154 --- /dev/null +++ b/examples/basic_ospfv2_bird/README.md @@ -0,0 +1,7 @@ + +# Multiple OSPFv3 Instance using Bird + +![](./topo.png) + +``` +``` diff --git a/examples/basic_ospfv2_bird/bird/R1_bird.conf b/examples/basic_ospfv2_bird/bird/R1_bird.conf new file mode 100644 index 0000000..dc9398c --- /dev/null +++ b/examples/basic_ospfv2_bird/bird/R1_bird.conf @@ -0,0 +1,33 @@ +router id 10.255.0.1; + +protocol device { +} + +protocol kernel { + learn; + export all; + import all; +} + +protocol ospf instance_A { + router id 10.255.0.1; + export all; + import all; + area 0.0.0.0 { + interface "net0" { + hello 10; + wait 40; + type ptp; + }; + interface "net1" { + hello 10; + wait 40; + type ptp; + }; + interface "net2" { + hello 10; + wait 40; + type ptp; + }; + }; +} diff --git a/examples/basic_ospfv2_bird/bird/R2_bird.conf b/examples/basic_ospfv2_bird/bird/R2_bird.conf new file mode 100644 index 0000000..a398f6c --- /dev/null +++ b/examples/basic_ospfv2_bird/bird/R2_bird.conf @@ -0,0 +1,29 @@ +router id 10.255.0.2; + +protocol device { +} + +protocol kernel { + learn; + export all; + import all; +} + +protocol ospf instance_A { + router id 10.255.0.2; + export all; + import all; + area 0.0.0.0 { + interface "net0" { + hello 10; + wait 40; + type ptp; + }; + interface "net1" { + hello 10; + wait 40; + type ptp; + }; + }; +} + diff --git a/examples/basic_ospfv2_bird/bird/R3_bird.conf b/examples/basic_ospfv2_bird/bird/R3_bird.conf new file mode 100644 index 0000000..6054b47 --- /dev/null +++ b/examples/basic_ospfv2_bird/bird/R3_bird.conf @@ -0,0 +1,34 @@ +router id 10.255.0.3; + +protocol device { +} + +protocol kernel { + learn; + export all; + import all; +} + +protocol ospf instance_A { + router id 10.255.0.3; + export all; + import all; + area 0.0.0.0 { + interface "net0" { + hello 10; + wait 40; + type ptp; + }; + interface "net1" { + hello 10; + wait 40; + type ptp; + }; + interface "net2" { + hello 10; + wait 40; + type ptp; + }; + }; +} + diff --git a/examples/basic_ospfv2_bird/bird/R4_bird.conf b/examples/basic_ospfv2_bird/bird/R4_bird.conf new file mode 100644 index 0000000..f1b3c7a --- /dev/null +++ b/examples/basic_ospfv2_bird/bird/R4_bird.conf @@ -0,0 +1,34 @@ +router id 10.255.0.4; + +protocol device { +} + +protocol kernel { + learn; + export all; + import all; +} + +protocol ospf instance_A { + router id 10.255.0.4; + export all; + import all; + area 0.0.0.0 { + interface "net0" { + hello 10; + wait 40; + type ptp; + }; + interface "net1" { + hello 10; + wait 40; + type ptp; + }; + interface "net2" { + hello 10; + wait 40; + type ptp; + }; + }; +} + diff --git a/examples/basic_ospfv2_bird/spec.yaml b/examples/basic_ospfv2_bird/spec.yaml new file mode 100644 index 0000000..6be6747 --- /dev/null +++ b/examples/basic_ospfv2_bird/spec.yaml @@ -0,0 +1,119 @@ + +postinit: + - cmds: + - cmd: docker cp bird/R1_bird.conf R1:/etc/bird/bird.conf + - cmd: docker cp bird/R2_bird.conf R2:/etc/bird/bird.conf + - cmd: docker cp bird/R3_bird.conf R3:/etc/bird/bird.conf + - cmd: docker cp bird/R4_bird.conf R4:/etc/bird/bird.conf + +nodes: + - name: R1 + image: tmp + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - { name: net2, type: direct, args: S1#net0 } + - name: R2 + image: tmp + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R4#net0 } + - name: R3 + image: tmp + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: R4#net1 } + - { name: net2, type: direct, args: S3#net0 } + - name: R4 + image: tmp + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: R3#net1 } + - { name: net2, type: direct, args: S4#net0 } + - name: S1 + image: tmp + interfaces: + - { name: net0, type: direct, args: R1#net2 } + - name: S3 + image: tmp + interfaces: + - { name: net0, type: direct, args: R3#net2 } + - name: S4 + image: tmp + interfaces: + - { name: net0, type: direct, args: R4#net2 } + +node_configs: + - name: R1 + cmds: + - cmd: ip addr add 10.0.0.1/30 dev net0 + - cmd: ip addr add 10.0.0.9/30 dev net1 + - cmd: ip addr add 10.0.0.17/30 dev net2 + - cmd: ip addr add 10.255.0.1/32 dev lo + - cmd: mkdir -p /run/bird + - cmd: bird -c /etc/bird/bird.conf + - name: R2 + cmds: + - cmd: ip addr add 10.0.0.2/30 dev net0 + - cmd: ip addr add 10.0.0.13/30 dev net1 + - cmd: ip addr add 10.255.0.2/32 dev lo + - cmd: mkdir -p /run/bird + - cmd: bird -c /etc/bird/bird.conf + - name: R3 + cmds: + - cmd: ip addr add 10.0.0.10/30 dev net0 + - cmd: ip addr add 10.0.0.5/30 dev net1 + - cmd: ip addr add 10.0.0.21/30 dev net2 + - cmd: ip addr add 10.255.0.3/32 dev lo + - cmd: mkdir -p /run/bird + - cmd: bird -c /etc/bird/bird.conf + - name: R4 + cmds: + - cmd: ip addr add 10.0.0.14/30 dev net0 + - cmd: ip addr add 10.0.0.6/30 dev net1 + - cmd: ip addr add 10.0.0.25/30 dev net2 + - cmd: ip addr add 10.255.0.4/32 dev lo + - cmd: mkdir -p /run/bird + - cmd: bird -c /etc/bird/bird.conf + - name: S1 + cmds: + - cmd: ip addr add 10.0.0.18/30 dev net0 + - cmd: ip route replace default via 10.0.0.17 + - name: S3 + cmds: + - cmd: ip addr add 10.0.0.22/30 dev net0 + - cmd: ip route replace default via 10.0.0.21 + - name: S4 + cmds: + - cmd: ip addr add 10.0.0.26/30 dev net0 + - cmd: ip route replace default via 10.0.0.25 + +test: + - name: p2p + cmds: + - cmd: docker exec R1 ping -c2 10.0.0.1 + - cmd: docker exec R1 ping -c2 10.0.0.2 + - cmd: docker exec R1 ping -c2 10.0.0.9 + - cmd: docker exec R1 ping -c2 10.0.0.10 + - cmd: docker exec R1 ping -c2 10.0.0.17 + - cmd: docker exec R1 ping -c2 10.0.0.18 + + - cmd: docker exec R2 ping -c2 10.0.0.1 + - cmd: docker exec R2 ping -c2 10.0.0.2 + - cmd: docker exec R2 ping -c2 10.0.0.13 + - cmd: docker exec R2 ping -c2 10.0.0.14 + + - cmd: docker exec R3 ping -c2 10.0.0.9 + - cmd: docker exec R3 ping -c2 10.0.0.10 + - cmd: docker exec R3 ping -c2 10.0.0.5 + - cmd: docker exec R3 ping -c2 10.0.0.6 + - cmd: docker exec R3 ping -c2 10.0.0.21 + - cmd: docker exec R3 ping -c2 10.0.0.22 + + - cmd: docker exec R4 ping -c2 10.0.0.13 + - cmd: docker exec R4 ping -c2 10.0.0.14 + - cmd: docker exec R4 ping -c2 10.0.0.5 + - cmd: docker exec R4 ping -c2 10.0.0.6 + - cmd: docker exec R4 ping -c2 10.0.0.25 + - cmd: docker exec R4 ping -c2 10.0.0.26 + diff --git a/examples/basic_ospfv2_bird/topo.png b/examples/basic_ospfv2_bird/topo.png new file mode 100644 index 0000000..a8c8dcf Binary files /dev/null and b/examples/basic_ospfv2_bird/topo.png differ diff --git a/examples/basic_ospfv2_frr/README.md b/examples/basic_ospfv2_frr/README.md new file mode 100644 index 0000000..3ea4c6d --- /dev/null +++ b/examples/basic_ospfv2_frr/README.md @@ -0,0 +1,6 @@ + +# OSPFv2 using FRR + +![](./topo.png) + + diff --git a/examples/basic_ospfv2_frr/spec.yaml b/examples/basic_ospfv2_frr/spec.yaml new file mode 100644 index 0000000..4c489a9 --- /dev/null +++ b/examples/basic_ospfv2_frr/spec.yaml @@ -0,0 +1,126 @@ + +# DESCRIPTION: OSPF network using FRR +# INIT: +# cns spec.yaml init | sudo sh +# cns spec.yaml conf | sudo sh +# cns spec.yaml test | sudo sh +# FINI: +# cns spec.yaml fini | sudo sh +# TOPO: +# + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - { name: net2, type: direct, args: S1#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R4#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: R4#net1 } + - { name: net2, type: direct, args: S3#net0 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: R3#net1 } + - { name: net2, type: direct, args: S4#net0 } + - name: S1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R1#net2 } + - name: S3 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R3#net2 } + - name: S4 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R4#net2 } + +node_configs: + - name: S1 + cmds: + - cmd: ip addr add 10.0.0.18/30 dev net0 + - cmd: ip route replace default via 10.0.0.17 + - name: S3 + cmds: + - cmd: ip addr add 10.0.0.22/30 dev net0 + - cmd: ip route replace default via 10.0.0.21 + - name: S4 + cmds: + - cmd: ip addr add 10.0.0.26/30 dev net0 + - cmd: ip route replace default via 10.0.0.25 + - name: R1 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.1/30 dev net0 + - cmd: ip addr add 10.0.0.9/30 dev net1 + - cmd: ip addr add 10.0.0.17/30 dev net2 + - cmd: >- + vtysh -c "conf t" + -c "router ospf" + -c " network 10.0.0.0/30 area 0" + -c " network 10.0.0.8/30 area 0" + -c " network 10.0.0.16/30 area 0" + - name: R2 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.2/30 dev net0 + - cmd: ip addr add 10.0.0.13/30 dev net1 + - cmd: >- + vtysh -c "conf t" + -c "router ospf" + -c " network 10.0.0.0/30 area 0" + -c " network 10.0.0.12/30 area 0" + - name: R3 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.10/30 dev net0 + - cmd: ip addr add 10.0.0.5/30 dev net1 + - cmd: ip addr add 10.0.0.21/30 dev net2 + - cmd: >- + vtysh -c "conf t" + -c "router ospf" + -c " network 10.0.0.8/30 area 0" + -c " network 10.0.0.4/30 area 0" + -c " network 10.0.0.20/30 area 0" + - name: R4 + cmds: + - cmd: /usr/lib/frr/frr start + - cmd: ip addr add 10.0.0.14/30 dev net0 + - cmd: ip addr add 10.0.0.6/30 dev net1 + - cmd: ip addr add 10.0.0.25/30 dev net2 + - cmd: >- + vtysh -c "conf t" + -c "router ospf" + -c " network 10.0.0.12/30 area 0" + -c " network 10.0.0.4/30 area 0" + -c " network 10.0.0.24/30 area 0" + +test: + - cmds: + # P2P Link test + - cmd: docker exec S1 ping -c2 10.0.0.17 + - cmd: docker exec S3 ping -c2 10.0.0.21 + - cmd: docker exec S4 ping -c2 10.0.0.25 + - cmd: docker exec R1 ping -c2 10.0.0.2 + - cmd: docker exec R1 ping -c2 10.0.0.10 + - cmd: docker exec R1 ping -c2 10.0.0.18 + - cmd: docker exec R2 ping -c2 10.0.0.1 + - cmd: docker exec R2 ping -c2 10.0.0.14 + - cmd: docker exec R3 ping -c2 10.0.0.9 + - cmd: docker exec R3 ping -c2 10.0.0.6 + - cmd: docker exec R3 ping -c2 10.0.0.21 + - cmd: docker exec R4 ping -c2 10.0.0.13 + - cmd: docker exec R4 ping -c2 10.0.0.5 + - cmd: docker exec R4 ping -c2 10.0.0.26 + diff --git a/examples/basic_ospfv2_frr/topo.png b/examples/basic_ospfv2_frr/topo.png new file mode 100644 index 0000000..a8c8dcf Binary files /dev/null and b/examples/basic_ospfv2_frr/topo.png differ diff --git a/examples/basic_ospfv3_bird_multiple_instance/R3_bird6.conf b/examples/basic_ospfv3_bird_multiple_instance/R3_bird6.conf new file mode 100644 index 0000000..8d6150a --- /dev/null +++ b/examples/basic_ospfv3_bird_multiple_instance/R3_bird6.conf @@ -0,0 +1,81 @@ +router id 10.255.0.3; + +protocol device dev0 { +} + +protocol kernel ker0 { + learn; + export all; + import all; +} + +table red; +protocol kernel ker1 { + learn; + export all; + import all; + table red; + kernel table 10; +} + +table blu; +protocol kernel ker2 { + learn; + export all; + import all; + table blu; + kernel table 20; +} + +protocol direct dir1 { + table red; + interface "net0"; + interface "net2"; +} + +protocol direct dir2 { + table blu; + interface "net1"; + interface "net3"; +} + +protocol ospf ored { + vrf "red"; + table red; + router id 10.255.0.30; + export all; + import all; + area 0.0.0.0 { + interface "net0" { + hello 10; + wait 40; + type ptp; + }; + interface "net2" { + hello 10; + wait 40; + type ptp; + }; + }; +} + +protocol ospf oblu { + vrf "blu"; + table blu; + router id 10.255.0.31; + export all; + import all; + area 0.0.0.0 { + interface "net1" { + hello 10; + wait 40; + type ptp; + }; + interface "net3" { + hello 10; + wait 40; + type ptp; + }; + }; +} + diff --git a/examples/basic_ospfv3_bird_multiple_instance/README.md b/examples/basic_ospfv3_bird_multiple_instance/README.md new file mode 100644 index 0000000..8b5dd41 --- /dev/null +++ b/examples/basic_ospfv3_bird_multiple_instance/README.md @@ -0,0 +1,7 @@ + +# OSPFv3 Multiple Instance(VRF) using Bird + +![](./topo.png) + +- the tmp image should include **bird-1.6.6** +- also kernel's version can be perform l3mdev diff --git a/examples/basic_ospfv3_bird_multiple_instance/spec.yaml b/examples/basic_ospfv3_bird_multiple_instance/spec.yaml new file mode 100644 index 0000000..a737127 --- /dev/null +++ b/examples/basic_ospfv3_bird_multiple_instance/spec.yaml @@ -0,0 +1,105 @@ + +postinit: + - cmds: + - cmd: docker exec R3 mkdir -p /etc/bird + - cmd: docker cp R3_bird6.conf R3:/etc/bird/bird6.conf + +nodes: + - name: R1 + image: tmp + interfaces: + - { name: net0, type: direct, args: R3#net0 } + - name: R2 + image: tmp + interfaces: + - { name: net0, type: direct, args: R3#net1 } + - name: R3 + image: tmp + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R2#net0 } + - { name: net2, type: direct, args: R4#net0 } + - { name: net3, type: direct, args: R4#net1 } + - name: R4 + image: tmp + interfaces: + - { name: net0, type: direct, args: R3#net2 } + - { name: net1, type: direct, args: R3#net3 } + +node_configs: + - name: R1 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int net0' + -c ' ipv6 address 2001:111::2/64' + -c ' ipv6 ospf6 network point-to-point' + -c ' exit' + -c 'router ospf6' + -c ' ospf6 router-id 10.255.0.1' + -c ' interface net0 area 0.0.0.0' + -c ' exit' + + - name: R2 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int net0' + -c ' ipv6 address 2001:222::2/64' + -c ' ipv6 ospf6 network point-to-point' + -c ' exit' + -c 'router ospf6' + -c ' ospf6 router-id 10.255.0.2' + -c ' interface net0 area 0.0.0.0' + -c ' exit' + + - name: R3 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: ip link add red type vrf table 10 + - cmd: ip link add blu type vrf table 20 + - cmd: ip link set dev red up + - cmd: ip link set dev blu up + - cmd: ip link set net0 vrf red + - cmd: ip link set net2 vrf red + - cmd: ip link set net1 vrf blu + - cmd: ip link set net3 vrf blu + - cmd: ip -6 addr add 2001:111::1/64 dev net0 + - cmd: ip -6 addr add 2001:222::1/64 dev net1 + - cmd: ip -6 addr add 2001:f10::1/64 dev net2 + - cmd: ip -6 addr add 2001:f11::1/64 dev net3 + - cmd: mkdir -p /run/bird + - cmd: bird6 -c /etc/bird/bird6.conf + + - name: R4 + cmds: + - cmd: sh -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: >- + vtysh -c 'conf t' + -c 'int net0' + -c ' ipv6 address 2001:f10::2/64' + -c ' ipv6 ospf6 network point-to-point' + -c ' exit' + -c 'int net1' + -c ' ipv6 address 2001:f11::2/64' + -c ' ipv6 ospf6 network point-to-point' + -c ' exit' + -c 'router ospf6' + -c ' ospf6 router-id 10.255.0.4' + -c ' interface net0 area 0.0.0.0' + -c ' interface net1 area 0.0.0.0' + -c ' exit' + +test: + - name: p2p + cmds: + # - cmd: docker exec R1 ping -c2 10.0.0.1 + # - cmd: docker exec R1 ping -c2 10.0.0.2 + # - cmd: docker exec R2 ping -c2 10.0.0.1 + # - cmd: docker exec R2 ping -c2 10.0.0.2 + diff --git a/examples/basic_ospfv3_bird_multiple_instance/topo.png b/examples/basic_ospfv3_bird_multiple_instance/topo.png new file mode 100644 index 0000000..f89b8e0 Binary files /dev/null and b/examples/basic_ospfv3_bird_multiple_instance/topo.png differ diff --git a/examples/basic_ospfv3_frr/README.md b/examples/basic_ospfv3_frr/README.md new file mode 100644 index 0000000..b894568 --- /dev/null +++ b/examples/basic_ospfv3_frr/README.md @@ -0,0 +1,6 @@ + +# OSPFv3 using FRR + +![](./topo.png) + + diff --git a/examples/basic_ospfv3_frr/spec.yaml b/examples/basic_ospfv3_frr/spec.yaml new file mode 100644 index 0000000..990d50d --- /dev/null +++ b/examples/basic_ospfv3_frr/spec.yaml @@ -0,0 +1,152 @@ + +# DESCRIPTION: OSPF network using FRR +# INIT: +# cns spec.yaml init | sudo sh +# cns spec.yaml conf | sudo sh +# cns spec.yaml test | sudo sh +# FINI: +# cns spec.yaml fini | sudo sh +# TOPO: +# + +nodes: + - name: R1 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net0 } + - { name: net1, type: direct, args: R3#net0 } + - { name: net2, type: direct, args: S1#net0 } + - name: R2 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - { name: net1, type: direct, args: R4#net0 } + - name: R3 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R1#net1 } + - { name: net1, type: direct, args: R4#net1 } + - { name: net2, type: direct, args: S3#net0 } + - name: R4 + image: slankdev/frr + interfaces: + - { name: net0, type: direct, args: R2#net1 } + - { name: net1, type: direct, args: R3#net1 } + - { name: net2, type: direct, args: S4#net0 } + - name: S1 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R1#net2 } + - name: S3 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R3#net2 } + - name: S4 + image: slankdev/ubuntu:18.04 + interfaces: + - { name: net0, type: direct, args: R4#net2 } + +node_configs: + - name: S1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip -6 addr add 2001:11::2/64 dev net0 + - cmd: ip -6 route replace default via 2001:11::1 + - name: S3 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip -6 addr add 2001:33::2/64 dev net0 + - cmd: ip -6 route replace default via 2001:33::1 + - name: S4 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: ip -6 addr add 2001:44::2/64 dev net0 + - cmd: ip -6 route replace default via 2001:44::1 + - name: R1 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: ip -6 addr add 2001:12::1/64 dev net0 + - cmd: ip -6 addr add 2001:13::1/64 dev net1 + - cmd: ip -6 addr add 2001:11::1/64 dev net2 + - cmd: >- + vtysh -c "conf t" + -c "router ospf6" + -c ' ospf6 router-id 10.255.0.1' + -c " interface net0 area 0.0.0.0" + -c " interface net1 area 0.0.0.0" + -c " interface net2 area 0.0.0.0" + - name: R2 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: ip -6 addr add 2001:12::2/64 dev net0 + - cmd: ip -6 addr add 2001:24::1/64 dev net1 + - cmd: >- + vtysh -c "conf t" + -c "router ospf6" + -c ' ospf6 router-id 10.255.0.2' + -c " interface net0 area 0.0.0.0" + -c " interface net1 area 0.0.0.0" + - name: R3 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: ip -6 addr add 2001:13::2/64 dev net0 + - cmd: ip -6 addr add 2001:34::1/64 dev net1 + - cmd: ip -6 addr add 2001:33::1/64 dev net2 + - cmd: >- + vtysh -c "conf t" + -c "router ospf6" + -c ' ospf6 router-id 10.255.0.3' + -c " interface net0 area 0.0.0.0" + -c " interface net1 area 0.0.0.0" + -c " interface net2 area 0.0.0.0" + - name: R4 + cmds: + - cmd: bash -c "enable_seg6_router.py | sh" + - cmd: /usr/lib/frr/frr start + - cmd: ip -6 addr add 2001:24::2/64 dev net0 + - cmd: ip -6 addr add 2001:34::2/64 dev net1 + - cmd: ip -6 addr add 2001:44::1/64 dev net2 + - cmd: >- + vtysh -c "conf t" + -c "router ospf6" + -c ' ospf6 router-id 10.255.0.4' + -c " interface net0 area 0.0.0.0" + -c " interface net1 area 0.0.0.0" + -c " interface net2 area 0.0.0.0" + +test: + - name: p2p + cmds: + - cmd: docker exec S1 ping -c2 2001:11::1 + - cmd: docker exec S3 ping -c2 2001:33::1 + - cmd: docker exec S4 ping -c2 2001:44::1 + + - cmd: docker exec R1 ping -c2 2001:12::1 + - cmd: docker exec R1 ping -c2 2001:12::2 + - cmd: docker exec R1 ping -c2 2001:13::1 + - cmd: docker exec R1 ping -c2 2001:13::2 + - cmd: docker exec R1 ping -c2 2001:11::1 + - cmd: docker exec R1 ping -c2 2001:11::2 + + - cmd: docker exec R2 ping -c2 2001:12::1 + - cmd: docker exec R2 ping -c2 2001:12::2 + - cmd: docker exec R2 ping -c2 2001:24::1 + - cmd: docker exec R2 ping -c2 2001:24::2 + + - cmd: docker exec R3 ping -c2 2001:13::1 + - cmd: docker exec R3 ping -c2 2001:13::2 + - cmd: docker exec R3 ping -c2 2001:34::1 + - cmd: docker exec R3 ping -c2 2001:34::2 + - cmd: docker exec R3 ping -c2 2001:33::1 + - cmd: docker exec R3 ping -c2 2001:33::2 + + - cmd: docker exec R4 ping -c2 2001:24::1 + - cmd: docker exec R4 ping -c2 2001:24::2 + - cmd: docker exec R4 ping -c2 2001:34::1 + - cmd: docker exec R4 ping -c2 2001:34::2 + - cmd: docker exec R4 ping -c2 2001:44::1 + - cmd: docker exec R4 ping -c2 2001:44::2 + diff --git a/examples/basic_ospfv3_frr/topo.png b/examples/basic_ospfv3_frr/topo.png new file mode 100644 index 0000000..e3bf552 Binary files /dev/null and b/examples/basic_ospfv3_frr/topo.png differ diff --git a/examples/basic_peer/mrt1.bin b/examples/basic_peer/mrt1.bin new file mode 100644 index 0000000..0be0ea6 Binary files /dev/null and b/examples/basic_peer/mrt1.bin differ diff --git a/examples/basic_peer/mrt2.bin b/examples/basic_peer/mrt2.bin new file mode 100644 index 0000000..cf98c57 Binary files /dev/null and b/examples/basic_peer/mrt2.bin differ diff --git a/examples/basic_peer/spec.yaml b/examples/basic_peer/spec.yaml new file mode 100644 index 0000000..f78eff6 --- /dev/null +++ b/examples/basic_peer/spec.yaml @@ -0,0 +1,56 @@ + +precmd: + - cmds: + - cmd: export IMAGE=slankdev/frr:centos-7-stable-7.0 + +nodes: + - name: R0 + image: $IMAGE + interfaces: + - { name: net0, type: direct, args: R1#net0 } + - name: R1 + image: $IMAGE + interfaces: + - { name: net0, type: direct, args: R0#net0 } + +node_configs: + - name: R0 + cmds: + - cmd: sh -c 'enable_seg6_router.py | sh' + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 1" + -c " bgp router-id 1.1.1.1" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " redistribute kernel" + -c " exit-address-family" + + - name: R1 + cmds: + - cmd: sh -c 'enable_seg6_router.py | sh' + - cmd: /usr/lib/frr/frrinit.sh start + - cmd: >- + vtysh -c "conf t" + -c "router bgp 2" + -c " bgp router-id 2.2.2.2" + -c " bgp bestpath as-path multipath-relax" + -c " bgp bestpath compare-routerid" + -c " neighbor FABRIC peer-group" + -c " neighbor FABRIC remote-as external" + -c " neighbor FABRIC capability extended-nexthop" + -c " neighbor net0 interface peer-group FABRIC" + -c " !" + -c " address-family ipv4 unicast" + -c " redistribute connected" + -c " redistribute kernel" + -c " exit-address-family" + diff --git a/examples/basic_pim/README.md b/examples/basic_pim/README.md new file mode 100644 index 0000000..6d6f002 --- /dev/null +++ b/examples/basic_pim/README.md @@ -0,0 +1,48 @@ + +# PIM Multicast Test + +multicast test +``` +iperf -u -s -B 239.1.1.5 -i 1 +iperf -u -c 239.1.1.5 -i -T -t