Page MenuHomeVyOS Platform

Completion and validation don't match for source interface name
Closed, ResolvedPublic

Description

Currently there is a contradiction between suggested completion and constrain check for source interface name.

To demonstrate this first create any VRF e.g.:

set vrf name red table 1000
commit

Now try to see completion for command:

vyos@r1# set system flow-accounting netflow server 10.1.0.2 source-interface
Possible completions:

interface            Interface name
dum0
eth0
eth1
lo

Though red is not shown, it can be set without error unlike non-existing interface like blabla:

vyos@r1# set system flow-accounting netflow server 10.1.0.2 source-interface blabla

Incorrect path /sys/class/net/blabla: no such file or directory



Invalid value
Value validation failed
Set failed

[edit]
vyos@r1# set system flow-accounting netflow server 10.1.0.2 source-interface red
[edit]

Either completion should show VRFs, or constrains check should refuse to accept VRFs.

Part of interface definition in interface-definitions/include/source-interface.xml.i:

<completionHelp>
  <script>${vyos_completion_dir}/list_interfaces</script>
</completionHelp>
<constraint>
  #include <include/constraint/interface-name.xml.i>
</constraint>

Details

Version
-
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Unspecified (please specify)

Event Timeline

hedrok created this object in space S1 VyOS Public.

I think most implementations in VyOS regarding source-interface is referencing physical or logical interfaces and not VRF's even if VRF's is an "interface" in Linux (which can be seen if you do ip a in bash mode).

In your case when you used source-interface red did the service/feature actually work then as expected?

Because even if Linux itself treats VRF's as interfaces when you define source-interface you normally think of a dedicated interface while with VRF's there can be one or more physical and logical interfaces who are part of the same VRF.

I would think that the "proper" fix would be to enforce the same list for the actual source-interface as the tab completion does no matter if VRF's would be approved or not (as in what you suggest they should match :-)