Skip to content

Commit 45867b8

Browse files
committed
JunOS: fix vrf default originate
1 parent 89bd468 commit 45867b8

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

netsim/devices/junos.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def default_originate_check(node: Box, topology: Box) -> None:
151151
for ngb in vdata.get('bgp.neighbors', []):
152152
if ngb.get('default_originate', False):
153153
vdata.bgp._junos_default_originate = True
154+
# node flag required for creating policy
155+
#node.bgp._junos_default_originate = True
154156
break
155157

156158
def policy_aspath_quirks(node: Box, topology: Box) -> None:

tests/integration/bgp.session/04-default-originate.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ message:
22
This lab tests the BGP default route origination. The DUT should advertise a
33
default route to X1.
44

5-
plugin: [ bgp.session ]
5+
plugin: [ bgp.session, test.vrf_check ]
66
module: [ bgp ]
77

8+
defaults.sources.extra: [ ../wait_times.yml, ../warnings.yml ]
9+
810
groups:
911
probes:
1012
device: frr
1113
provider: clab
12-
members: [ x1 ]
14+
members: [ x1, x2 ]
1315

1416
defaults.bgp.as: 65000
1517
bgp.advertise_loopback: false
@@ -20,15 +22,25 @@ addressing:
2022
lan:
2123
ipv6: 2001:db8:4::/48
2224

25+
vrfs:
26+
tenant:
27+
2328
nodes:
2429
dut:
30+
module: [ bgp, vrf ]
2531
x1:
2632
bgp.as: 65100
33+
x2:
34+
bgp.as: 65200
2735

2836
links:
2937
- dut:
3038
bgp.default_originate: true
3139
x1:
40+
- dut:
41+
bgp.default_originate: true
42+
vrf: tenant
43+
x2:
3244

3345
validate:
3446
ebgp_v4:
@@ -55,3 +67,27 @@ validate:
5567
wait_msg: Waiting for BGP convergence
5668
nodes: [ x1 ]
5769
plugin: bgp_prefix('::/0',af='ipv6')
70+
vrf_ebgp_v4:
71+
description: Check IPv4 EBGP sessions with DUT (vrf)
72+
wait_msg: Waiting for EBGP session establishment
73+
wait: ebgp_session
74+
nodes: [ x2 ]
75+
plugin: bgp_neighbor(node.bgp.neighbors,'dut')
76+
vrf_ebgp_v6:
77+
description: Check IPv6 EBGP sessions with DUT (vrf)
78+
wait_msg: Waiting for EBGP session establishment
79+
wait: ebgp_session
80+
nodes: [ x2 ]
81+
plugin: bgp_neighbor(node.bgp.neighbors,'dut',af='ipv6')
82+
vrf_def_ipv4:
83+
description: Check whether DUT (vrf) advertises IPv4 default route to X2
84+
wait: bgp_scan_time
85+
wait_msg: Waiting for BGP convergence
86+
nodes: [ x2 ]
87+
plugin: bgp_prefix('0.0.0.0/0')
88+
vrf_def_ipv6:
89+
description: Check whether (vrf) DUT advertises IPv6 default route to X2
90+
wait: bgp_scan_time
91+
wait_msg: Waiting for BGP convergence
92+
nodes: [ x2 ]
93+
plugin: bgp_prefix('::/0',af='ipv6')

0 commit comments

Comments
 (0)