Skip to content

Commit

Permalink
SR Linux: Routing policies cannot be used on route imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Sep 12, 2024
1 parent bc78993 commit f084d8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions netsim/devices/srlinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ features:
activate_af: True
ipv6_lla: True
rfc8950: True
import: [ ospf, isis, connected, vrf ]
import: [ ospf, isis, connected, vrf, no_policy ]
evpn:
irb: True
asymmetrical_irb: True
Expand All @@ -60,7 +60,7 @@ features:
ldp: True # on 7250 IXR only
ospf:
unnumbered: True
import: [ bgp, isis, connected, vrf ]
import: [ bgp, isis, connected, vrf, no_policy ]
default: true
routing:
policy:
Expand Down
12 changes: 11 additions & 1 deletion netsim/modules/_routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,17 @@ def check_import_request(
continue

# Add an import routing policy if needed
node_add_routing_policy(i_dict.get(f'{s_proto}.policy'),node,topology)
i_policy = i_dict.get(f'{s_proto}.policy',None)
if i_policy:
if 'no_policy' in f_import:
log.error(
f'Device {node.device} (node {node.name}) cannot use routing policies ' + \
f'on route imports ({s_proto} => {proto}, policy {i_policy})',
category=log.IncorrectValue,
module=proto)
break
else:
node_add_routing_policy(i_dict.get(f'{s_proto}.policy'),node,topology)

if 'ripv2' in i_dict: # Finally, replace RIPv2 with RIP
i_dict.rip = i_dict.ripv2
Expand Down

0 comments on commit f084d8b

Please sign in to comment.