Page MenuHomeVyOS Platform

Show policy route not working when no interface is configured
Closed, ResolvedPublicBUG

Description

Show policy route not working if no interface configured.

How to replicate in 1.4:

vyos@vyos# set policy route FILTER-WEB rule 1000 destination port 80
[edit]
vyos@vyos# set policy route FILTER-WEB rule 1000 protocol tcp
[edit]
vyos@vyos# set policy route FILTER-WEB rule 1000 set table 100
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# run show policy route FILTER-WEB
Ruleset Information


IPv4 Policy Route "FILTER-WEB"
Traceback (most recent call last):

File "/usr/libexec/vyos/op_mode/policy_route.py", line 145, in <module>
  show_policy_name(args.name, args.ipv6)
File "/usr/libexec/vyos/op_mode/policy_route.py", line 124, in show_policy_name
  output_policy_route(name, policy, ipv6)
File "/usr/libexec/vyos/op_mode/policy_route.py", line 64, in output_policy_route
  if route_conf['interface']:
     ~~~~~~~~~~^^^^^^^^^^^^^

KeyError: 'interface'

[edit]
vyos@vyos#

After interface configuration:

vyos@vyos# set policy route FILTER-WEB interface eth4
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# run show policy route FILTER-WEB
Ruleset Information


IPv4 Policy Route "FILTER-WEB"

Active on: eth4

Rule  Action    Protocol

1000  set       tcp

[edit]
vyos@vyos#

Comparison with 1.3.3:
vyos@vyos# set policy route FILTER-WEB rule 1000 destination port 80
[edit]
vyos@vyos# set policy route FILTER-WEB rule 1000 protocol tcp
[edit]
vyos@vyos# set policy route FILTER-WEB rule 1000 set table 100
[edit]
vyos@vyos# commit
[edit]
vyos@vyos# run show policy route FILTER-WEB


Rulesets Information

IPv4 Policy Route "FILTER-WEB":

Inactive - Not applied to any interfaces or zones.

rule action proto packets bytes


1000 set tcp 0 0

condition - saddr 0.0.0.0/0 daddr 0.0.0.0/0 tcp dpt:80

1000000 drop all 0 0

condition - saddr 0.0.0.0/0 daddr 0.0.0.0/0

[edit]
vyos@vyos#

Details

Version
VyOS 1.4-rolling-202306280317
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)