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

Difficulty level
Unknown (require assessment)
Version
VyOS 1.4-rolling-202306280317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

The policy route works only with an interface (inbound direction) and doesn't work otherwise.
It's always been like this.

But yes, it is op-mode bug

Viacheslav changed the task status from Open to In progress.Jul 2 2023, 3:57 PM
Viacheslav claimed this task.
Viacheslav moved this task from Need Triage to Finished on the VyOS 1.4 Sagitta board.