-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: terassyi <[email protected]>
- Loading branch information
Showing
15 changed files
with
325 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,208 @@ | ||
name: sart | ||
topology: | ||
kinds: | ||
linux: | ||
cmd: bash | ||
nodes: | ||
router0: | ||
kind: linux | ||
image: frrouting/frr:v8.4.0 | ||
exec: | ||
- ip addr add 169.254.1.1/24 dev net0 scope link | ||
- ip addr add 169.254.2.1/24 dev net1 scope link | ||
- ip addr add 169.254.3.1/24 dev net2 scope link | ||
- ip addr add 169.254.4.1/24 dev net3 scope link | ||
- ip addr add 192.168.0.1/24 dev net4 scope link | ||
# route for node primary address | ||
- ip route add 172.18.0.6/32 dev net0 | ||
- ip route add 172.18.0.4/32 dev net1 | ||
- ip route add 172.18.0.5/32 dev net2 | ||
- ip route add 172.18.0.3/32 dev net3 | ||
- ip link add dummy0 type dummy | ||
- ip addr add 9.9.9.9/32 dev dummy0 | ||
- ip link set up dev dummy0 | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
# Boiler plate to make FRR work | ||
- touch /etc/frr/vtysh.conf | ||
- sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons | ||
- /usr/lib/frr/frrinit.sh start | ||
# FRR configuration | ||
- >- | ||
vtysh -c 'conf t' | ||
-c 'frr defaults datacenter' | ||
-c '!' | ||
-c 'ip prefix-list LAB-SUBNET permit 10.0.0.0/8 ge 8' | ||
-c '!' | ||
-c 'router bgp 65000' | ||
-c ' bgp router-id 9.9.9.9' | ||
-c ' bgp bestpath as-path multipath-relax' | ||
-c ' neighbor 169.254.1.2 remote-as 65010' | ||
-c ' neighbor 169.254.2.2 remote-as 65020' | ||
-c ' neighbor 169.254.3.2 remote-as 65030' | ||
-c ' neighbor 169.254.4.2 remote-as 65040' | ||
-c ' neighbor 169.254.1.2 update-source dummy0' | ||
-c ' neighbor 169.254.2.2 update-source dummy0' | ||
-c ' neighbor 169.254.3.2 update-source dummy0' | ||
-c ' neighbor 169.254.4.2 update-source dummy0' | ||
-c ' neighbor 169.254.1.2 next-hop-self' | ||
-c ' neighbor 169.254.2.2 next-hop-self' | ||
-c ' neighbor 169.254.3.2 next-hop-self' | ||
-c ' neighbor 169.254.4.2 next-hop-self' | ||
-c '!' | ||
router0-debug: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
network-mode: container:clab-sart-router0 | ||
router1: | ||
kind: linux | ||
image: frrouting/frr:v8.4.0 | ||
exec: | ||
- ip addr add 169.253.1.1/24 dev net0 scope link | ||
- ip addr add 169.253.2.1/24 dev net1 scope link | ||
- ip addr add 169.253.3.1/24 dev net2 scope link | ||
- ip addr add 169.253.4.1/24 dev net3 scope link | ||
- ip addr add 192.168.1.1/24 dev net4 scope link | ||
- ip link add dummy0 type dummy | ||
- ip addr add 7.7.7.7/32 dev dummy0 | ||
- ip link set up dev dummy0 | ||
- ip route add 172.18.0.6/32 dev net0 | ||
- ip route add 172.18.0.4/32 dev net1 | ||
- ip route add 172.18.0.5/32 dev net2 | ||
- ip route add 172.18.0.3/32 dev net3 | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
# Boiler plate to make FRR work | ||
- touch /etc/frr/vtysh.conf | ||
- sed -i -e 's/bgpd=no/bgpd=yes/g' /etc/frr/daemons | ||
- /usr/lib/frr/frrinit.sh start | ||
# FRR configuration | ||
- >- | ||
vtysh -c 'conf t' | ||
-c 'frr defaults datacenter' | ||
-c '!' | ||
-c 'ip prefix-list LAB-SUBNET permit 10.0.0.0/8 ge 8' | ||
-c '!' | ||
-c 'router bgp 65000' | ||
-c ' bgp router-id 7.7.7.7' | ||
-c ' bgp bestpath as-path multipath-relax' | ||
-c ' neighbor 169.253.1.2 remote-as 65010' | ||
-c ' neighbor 169.253.2.2 remote-as 65020' | ||
-c ' neighbor 169.253.3.2 remote-as 65030' | ||
-c ' neighbor 169.253.4.2 remote-as 65040' | ||
-c ' neighbor 169.253.1.2 update-source dummy0' | ||
-c ' neighbor 169.253.2.2 update-source dummy0' | ||
-c ' neighbor 169.253.3.2 update-source dummy0' | ||
-c ' neighbor 169.253.4.2 update-source dummy0' | ||
-c ' neighbor 169.253.1.2 next-hop-self' | ||
-c ' neighbor 169.253.2.2 next-hop-self' | ||
-c ' neighbor 169.253.3.2 next-hop-self' | ||
-c ' neighbor 169.253.4.2 next-hop-self' | ||
-c '!' | ||
router1-debug: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
network-mode: container:clab-sart-router1 | ||
control-plane0: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
network-mode: container:sart-control-plane | ||
exec: | ||
# Enable ECMP | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
# Address for peering | ||
- ip addr add 169.254.1.2/24 dev net0 scope link | ||
- ip addr add 169.253.1.2/24 dev net1 scope link | ||
# Route traffic to the lab through router | ||
- ip route add 172.18.0.4/32 src 172.18.0.6 nexthop via 169.254.1.1 weight 1 nexthop via 169.253.1.1 weight 1 | ||
- ip route add 172.18.0.5/32 src 172.18.0.6 nexthop via 169.254.1.1 weight 1 nexthop via 169.253.1.1 weight 1 | ||
- ip route add 172.18.0.3/32 src 172.18.0.6 nexthop via 169.254.1.1 weight 1 nexthop via 169.253.1.1 weight 1 | ||
- ip route add 192.168.0.0/24 via 169.254.1.1 dev net0 | ||
- ip route add 192.168.1.0/24 via 169.253.1.1 dev net1 | ||
- ip route add 6.6.6.6/32 via 169.254.1.1 dev net0 | ||
- ip route add 9.9.9.9/32 via 169.254.1.1 dev net0 | ||
- ip route add 7.7.7.7/32 via 169.253.1.1 dev net1 | ||
worker0: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
network-mode: container:sart-worker | ||
exec: | ||
# Enable ECMP | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
# Address for peering | ||
- ip addr add 169.254.2.2/24 dev net0 scope link | ||
- ip addr add 169.253.2.2/24 dev net1 scope link | ||
# Route traffic to the lab through router | ||
- ip route add 172.18.0.6/32 src 172.18.0.4 nexthop via 169.254.2.1 weight 1 nexthop via 169.253.2.1 weight 1 | ||
- ip route add 172.18.0.5/32 src 172.18.0.4 nexthop via 169.254.2.1 weight 1 nexthop via 169.253.2.1 weight 1 | ||
- ip route add 172.18.0.3/32 src 172.18.0.4 nexthop via 169.254.2.1 weight 1 nexthop via 169.253.2.1 weight 1 | ||
- ip route add 192.168.0.0/24 via 169.254.2.1 dev net0 | ||
- ip route add 192.168.1.0/24 via 169.253.2.1 dev net1 | ||
- ip route add 6.6.6.6/32 via 169.254.2.1 dev net0 | ||
- ip route add 9.9.9.9/32 via 169.254.2.1 dev net0 | ||
- ip route add 7.7.7.7/32 via 169.253.2.1 dev net1 | ||
worker1: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
network-mode: container:sart-worker2 | ||
exec: | ||
# Enable ECMP | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
# Address for peering | ||
- ip addr add 169.254.3.2/24 dev net0 scope link | ||
- ip addr add 169.253.3.2/24 dev net1 scope link | ||
# Route traffic to the lab through router | ||
- ip route add 172.18.0.6/32 src 172.18.0.5 nexthop via 169.254.3.1 weight 1 nexthop via 169.253.3.1 weight 1 | ||
- ip route add 172.18.0.4/32 src 172.18.0.5 nexthop via 169.254.3.1 weight 1 nexthop via 169.253.3.1 weight 1 | ||
- ip route add 172.18.0.3/32 src 172.18.0.5 nexthop via 169.254.3.1 weight 1 nexthop via 169.253.3.1 weight 1 | ||
- ip route add 192.168.0.0/24 via 169.254.3.1 dev net0 | ||
- ip route add 192.168.1.0/24 via 169.253.3.1 dev net1 | ||
- ip route add 6.6.6.6/32 via 169.254.3.1 dev net0 | ||
- ip route add 9.9.9.9/32 via 169.254.3.1 dev net0 | ||
- ip route add 7.7.7.7/32 via 169.253.3.1 dev net1 | ||
worker2: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
network-mode: container:sart-worker3 | ||
exec: | ||
# Enable ECMP | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
# Address for peering | ||
- ip addr add 169.254.4.2/24 dev net0 scope link | ||
- ip addr add 169.253.4.2/24 dev net1 scope link | ||
# Route traffic to the lab through router | ||
- ip route add 172.18.0.6/32 src 172.18.0.3 nexthop via 169.254.4.1 weight 1 nexthop via 169.253.4.1 weight 1 | ||
- ip route add 172.18.0.4/32 src 172.18.0.3 nexthop via 169.254.4.1 weight 1 nexthop via 169.253.4.1 weight 1 | ||
- ip route add 172.18.0.5/32 src 172.18.0.3 nexthop via 169.254.4.1 weight 1 nexthop via 169.253.4.1 weight 1 | ||
- ip route add 192.168.0.0/24 via 169.254.4.1 dev net0 | ||
- ip route add 192.168.1.0/24 via 169.253.4.1 dev net1 | ||
- ip route add 6.6.6.6/32 via 169.254.4.1 dev net0 | ||
- ip route add 9.9.9.9/32 via 169.254.4.1 dev net0 | ||
- ip route add 7.7.7.7/32 via 169.253.4.1 dev net1 | ||
client0: | ||
kind: linux | ||
image: nicolaka/netshoot:latest | ||
exec: | ||
- ip addr add 192.168.0.2/24 dev net0 | ||
- ip addr add 192.168.1.2/24 dev net1 | ||
- ip link add dummy0 type dummy | ||
- ip addr add 6.6.6.6/32 dev dummy0 | ||
- ip link set up dev dummy0 | ||
- ip route change default src 6.6.6.6 nexthop via 192.168.0.1 weight 1 | ||
- sysctl -w net.ipv4.fib_multipath_hash_policy=1 | ||
- sysctl -p | ||
links: | ||
- endpoints: ["router0:net0", "control-plane0:net0"] | ||
- endpoints: ["router0:net1", "worker0:net0"] | ||
- endpoints: ["router0:net2", "worker1:net0"] | ||
- endpoints: ["router0:net3", "worker2:net0"] | ||
- endpoints: ["router1:net0", "control-plane0:net1"] | ||
- endpoints: ["router1:net1", "worker0:net1"] | ||
- endpoints: ["router1:net2", "worker1:net1"] | ||
- endpoints: ["router1:net3", "worker2:net1"] | ||
- endpoints: ["router0:net4", "client0:net0"] | ||
- endpoints: ["router1:net4", "client0:net1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.