-
Notifications
You must be signed in to change notification settings - Fork 0
/
equal-weight-spec.yaml
139 lines (139 loc) · 4.93 KB
/
equal-weight-spec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
nodes:
- name: R1
image: drumato/frr-debian:latest
interfaces:
- { name: net1, type: bridge, args: B1 }
- name: R2
image: drumato/frr-debian:latest
interfaces:
- { name: net1, type: bridge, args: B1 }
- { name: net2, type: bridge, args: B2 }
- name: R3
image: drumato/frr-debian:latest
interfaces:
- { name: net1, type: bridge, args: B1 }
- { name: net2, type: bridge, args: B2 }
- name: C1
image: drumato/frr-debian:latest
interfaces:
- { name: net2, type: bridge, args: B2 }
switches:
- name: B1
interfaces:
- { name: net1, type: container, args: R1 }
- { name: net1, type: container, args: R2 }
- { name: net1, type: container, args: R3 }
- name: B2
interfaces:
- { name: net2, type: container, args: R2 }
- { name: net2, type: container, args: R3 }
- { name: net2, type: container, args: C1 }
node_configs:
- name: R1
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: >-
vtysh -c "conf t"
-c "int net1" -c "ip addr 10.0.0.1/16" -c "exit"
-c "ip prefix-list PLIST_LOWER permit 10.0.1.0/24"
-c "!"
-c "route-map RMAP_LOWER permit 10"
-c " match ip address prefix-list PLIST_LOWER"
-c "!"
-c "router bgp 65001"
-c " bgp router-id 1.1.1.1"
-c " bgp bestpath as-path multipath-relax"
-c " address-family ipv4 unicast"
-c " neighbor 10.0.0.251 remote-as 65002"
-c " neighbor 10.0.0.251 route-map RMAP_LOWER in"
-c " neighbor 10.0.0.252 remote-as 65003"
-c " neighbor 10.0.0.252 route-map RMAP_LOWER in"
-c " exit-address-family"
-c "exit"
- name: R2
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: >-
vtysh -c "conf t"
-c "ip prefix-list PLIST_UPPER permit 10.0.0.0/16"
-c "!"
-c "ip prefix-list PLIST_LOWER permit 10.0.1.0/24"
-c "!"
-c "route-map RMAP_UPPER permit 10"
-c " match ip address prefix-list PLIST_UPPER"
-c "!"
-c "route-map RMAP_LOWER permit 10"
-c " match ip address prefix-list PLIST_LOWER"
-c "!"
-c "int net1" -c "ip addr 10.0.0.251/16" -c "exit"
-c "int net2" -c "ip addr 10.0.1.1/24" -c "exit"
-c "router bgp 65002"
-c " bgp router-id 2.2.2.2"
-c " bgp bestpath as-path multipath-relax"
-c " address-family ipv4 unicast"
-c " redistribute connected"
-c " neighbor 10.0.0.1 remote-as 65001"
-c " neighbor 10.0.0.1 route-map RMAP_UPPER in"
-c " neighbor 10.0.0.1 route-map RMAP_LOWER out"
-c " neighbor 10.0.1.254 remote-as 65004"
-c " neighbor 10.0.1.254 route-map RMAP_UPPER out"
-c " exit-address-family"
-c "exit"
- name: R3
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: >-
vtysh -c "conf t"
-c "ip prefix-list PLIST_UPPER permit 10.0.0.0/16"
-c "!"
-c "ip prefix-list PLIST_LOWER permit 10.0.1.0/24"
-c "!"
-c "route-map RMAP_UPPER permit 10"
-c " match ip address prefix-list PLIST_UPPER"
-c "!"
-c "route-map RMAP_LOWER permit 10"
-c " match ip address prefix-list PLIST_LOWER"
-c "!"
-c "int net1" -c "ip addr 10.0.0.252/16" -c "exit"
-c "int net2" -c "ip addr 10.0.1.2/24" -c "exit"
-c "router bgp 65003"
-c " bgp router-id 3.3.3.3"
-c " bgp bestpath as-path multipath-relax"
-c " address-family ipv4 unicast"
-c " redistribute connected"
-c " neighbor 10.0.0.1 remote-as 65001"
-c " neighbor 10.0.0.1 route-map RMAP_UPPER in"
-c " neighbor 10.0.0.1 route-map RMAP_LOWER out"
-c " neighbor 10.0.1.254 remote-as 65004"
-c " neighbor 10.0.1.254 route-map RMAP_UPPER out"
-c " exit-address-family"
-c "exit"
- name: C1
cmds:
- cmd: /usr/lib/frr/frr start
- cmd: >-
vtysh -c "conf t"
-c "ip prefix-list PLIST_UPPER permit 10.0.0.0/16"
-c "!"
-c "route-map RMAP_UPPER permit 10"
-c " match ip address prefix-list PLIST_UPPER"
-c "!"
-c "int net2" -c "ip addr 10.0.1.254/24" -c "exit"
-c "router bgp 65004"
-c " bgp router-id 4.4.4.4"
-c " bgp bestpath as-path multipath-relax"
-c " address-family ipv4 unicast"
-c " neighbor 10.0.1.1 remote-as 65002"
-c " neighbor 10.0.1.1 route-map RMAP_UPPER in"
-c " neighbor 10.0.1.2 remote-as 65003"
-c " neighbor 10.0.1.2 route-map RMAP_UPPER in"
-c " exit-address-family"
-c "exit"
test:
- cmds:
# test connecivities with connected routes
- cmd: docker exec R2 ping -w2 10.0.1.254
- cmd: docker exec R3 ping -w2 10.0.1.254
# test connecivities with received bgp routes
- cmd: docker exec R1 ping -w2 10.0.1.254
- cmd: docker exec C1 ping -w2 10.0.0.1