Skip to content

Commit 5576bf5

Browse files
committed
Cumulus_NVUE: Add gateway support
* Anycast ipv4 (ipv6 also configured if provided, module officially only supports ipv4) * VRRPv3 ipv4 and ipv6 * Comment out ipv6 addresses in VRRP test case (requires OSPFv3 which Cumulus NVUE does not support) * Add VRRP ipv6 test case (issue with multiple ipv6 default routes popping up)
1 parent a1755c8 commit 5576bf5

File tree

5 files changed

+166
-4
lines changed

5 files changed

+166
-4
lines changed

docs/module/gateway.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ The module is supported on these platforms:
2525
| Cisco CSR 1000v ||||
2626
| Cisco IOSv/IOSvL2 ||||
2727
| Cisco Nexus OS ||||
28-
| Cumulus Linux ||||
28+
| Cumulus Linux 4.x ||||
29+
| Cumulus 5.x (NVUE) ||||
2930
| Dell OS10 |[](caveats-os10) |[](caveats-os10) |[](caveats-os10) |
3031
| FRRouting ||||
3132
| Nokia SR OS ||||
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{% if gateway.anycast is defined %}
2+
- set:
3+
router:
4+
vrr:
5+
enable: on
6+
{% endif %}
7+
{% if gateway.vrrp is defined %}
8+
- set:
9+
router:
10+
vrrp:
11+
enable: on
12+
{% endif %}
13+
14+
{% for intf in interfaces if intf.gateway is defined %}
15+
{% if loop.first %}
16+
- set:
17+
interface:
18+
{% endif %}
19+
{{ intf.ifname }}:
20+
ip:
21+
{% if intf.gateway.protocol=='anycast' %}
22+
vrr:
23+
address:
24+
{% for af in 'ipv4','ipv6' if af in intf.gateway %}
25+
{{ intf.gateway[af] }}: {}
26+
{% endfor %}
27+
enable: on
28+
mac-address: {{ intf.gateway.anycast.mac|hwaddr('linux') }}
29+
state:
30+
up: {}
31+
{% elif intf.gateway.protocol=='vrrp' %}
32+
vrrp:
33+
enable: on
34+
virtual-router:
35+
'{{ intf.gateway.vrrp.group }}':
36+
address:
37+
{% for af in 'ipv4','ipv6' if af in intf.gateway %}
38+
{{ intf.gateway[af]|ipaddr('address') }}: {}
39+
{% endfor %}
40+
preempt: {{ 'on' if intf.gateway.vrrp.preempt|default(True) else 'off' }}
41+
{% if intf.gateway.vrrp.priority is defined %}
42+
priority: {{ intf.gateway.vrrp.priority }}
43+
{% endif %}
44+
{% endif %}
45+
{% endfor %}

netsim/devices/cumulus_nvue.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ features:
3232
local_as: True
3333
local_as_ibgp: True
3434
vrf_local_as: False
35+
gateway:
36+
protocol: [ anycast, vrrp ]
3537
lag:
3638
passive: False
3739
mlag:

tests/integration/gateway/01-anycast.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
message: |
3-
This lab tests the anycast gateway functionality. It checks whether the
3+
This lab tests the anycast gateway IPv4 functionality. It checks whether the
44
anycast IP is active, whether it has the correct MAC address, and whether the
55
first device in the forwarding path intercepts the packets with the shared MAC
66
address.
@@ -43,13 +43,13 @@ links:
4343
r1:
4444
prefix:
4545
ipv4: 172.16.33.0/24
46-
ipv6: 2001:db8:cafe:33::/64
46+
# ipv6: 2001:db8:cafe:33::/64 # implies OSPFv3, which is not supported by some devices nor used in validation below
4747

4848
- d2:
4949
r2:
5050
prefix:
5151
ipv4: 172.16.44.0/24
52-
ipv6: 2001:db8:cafe:44::/64
52+
# ipv6: 2001:db8:cafe:44::/64
5353

5454
- r1-r2-h3
5555

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
message: |
3+
This lab tests IPv6 VRRP configuration. It checks whether the
4+
device-under-test (DUT) forwards traffic sent to the VRRP IP/MAC address,
5+
whether it has correct VRRP priority, and whether the preemption mechanism
6+
works.
7+
8+
module: [ gateway ]
9+
10+
groups:
11+
probes:
12+
device: eos
13+
provider: clab
14+
members: [ r2 ]
15+
hosts:
16+
device: linux
17+
provider: clab
18+
members: [ h1, h2 ]
19+
20+
gateway.protocol: vrrp
21+
gateway.id: 42
22+
gateway.vrrp.group: 17
23+
24+
nodes:
25+
dut:
26+
r2:
27+
h1:
28+
h2:
29+
30+
links:
31+
- h1:
32+
dut:
33+
gateway.vrrp.priority: 30
34+
r2:
35+
gateway.vrrp.priority: 20
36+
gateway: True
37+
prefix.ipv6: 2001:db8:bad:cafe::/64
38+
- dut:
39+
r2:
40+
h2:
41+
prefix.ipv6: 2002:db8:bad:cafe::/64
42+
43+
validate:
44+
r2_eth1_down:
45+
description: Remove R2 from the VRRP LAN
46+
nodes: [ r2 ]
47+
config:
48+
template: ifdown
49+
variable.ifstate: 'down'
50+
pass: R2 has been disconnected from the VRRP LAN
51+
stop_on_error: True
52+
ra:
53+
description: Check RA-generated default route
54+
wait: 30
55+
wait_msg: Waiting for RA message to generate the default route
56+
nodes: [ h1, h2 ]
57+
plugin: default6()
58+
stop_on_error: True
59+
ping_vrrp:
60+
description: Verify VRRP v6 is enabled on DUT
61+
wait: 10
62+
nodes: [ h1 ]
63+
plugin: ping('h2',af='ipv6')
64+
r2_eth1_up:
65+
description: Add R2 to the VRRP LAN
66+
nodes: [ r2 ]
67+
config:
68+
template: ifdown
69+
variable.ifstate: 'up'
70+
pass: R2 has been reconnected to the VRRP LAN
71+
stop_on_error: True
72+
r2_vrrp_backup:
73+
description: Verify that R2 is in the backup state
74+
wait: 10
75+
nodes: [ r2 ]
76+
show:
77+
frr: vrrp interface {{ interfaces[0].ifname }} json
78+
eos: vrrp | json
79+
valid:
80+
frr: result[0].v6.status == 'Backup'
81+
eos: virtualRouters[0].state == 'backup'
82+
r2_vrrp_prio:
83+
nodes: [ r2 ]
84+
pass: R2 VRRP priority has been increased to 80
85+
config:
86+
template: vrrp-priority
87+
variable.vrrp_prio: 80
88+
r2_vrrp_master:
89+
description: Verify that R2 took over as master (VRRP priority on DUT is lower than 80)
90+
wait: 10
91+
nodes: [ r2 ]
92+
show:
93+
frr: vrrp interface {{ interfaces[0].ifname }} json
94+
eos: vrrp | json
95+
valid:
96+
frr: result[0].v6.status == 'Master'
97+
eos: virtualRouters[0].state == 'master'
98+
r2_vrrp_prio_low:
99+
nodes: [ r2 ]
100+
pass: R2 VRRP priority has been lowered to 20
101+
config:
102+
template: vrrp-priority
103+
variable.vrrp_prio: 20
104+
dut_preempt:
105+
description: Verify that DUT preempts R2 when its priority is lowered
106+
wait: 10
107+
nodes: [ r2 ]
108+
show:
109+
frr: vrrp interface {{ interfaces[0].ifname }} json
110+
eos: vrrp | json
111+
valid:
112+
frr: result[0].v6.status == 'Backup'
113+
eos: virtualRouters[0].state == 'backup'
114+
level: warning

0 commit comments

Comments
 (0)