Page MenuHomeVyOS Platform

Sflow with vrf configured does not use vrf to validate agent-address IP from vrf-configured interfaces
Closed, ResolvedPublicBUG


Problem description

Enabling sflow in VyOS is fairly simple process per documentation [1].

However, the sflow agent-address setting:

set system flow-accounting sflow agent-address <address>

Which is useful for identifying the system exporting the sflow data at the sflow collector does not allow for using an IP from a interface belonging to a vrf, if vrf is enabled on sflow via

set system flow-accounting vrf <vrf name>

We get a validation error on commit:

Configured "sflow agent-address <IP> " does not exist in the system!

It appears that src/conf_mode/ does not call is_addr_assigned() with the vrf if this has been configured, to which is_addr_assigned() makes use of the default vrf of None.

Obtaining and passing the vrf to is_addr_assigned() appears to solve the issue.

Directly configuring uacctd.conf with the IP from the vrf interface works just fine.

  1. Steps to reproduce:
  2. Create VRF, put interface in vrf, add IP address to interface
  3. Setup flow-accounting with sflow
set system flow-accounting buffer-size 64
set system flow-accounting disable-imt
set system flow-accounting vrf <vrf name> 
set system flow-accounting interface <interface name>
set system flow-accounting sflow agent-address <IP from vrf/interface>
set system flow-accounting sflow sampling-rate 100
set system flow-accounting sflow server <sflow collector IP>  port 6343

Commit and see error described above
Using an IP from non-vrf interface works but may not be the best describing IP for the sflow agent.



Difficulty level
Easy (less than an hour)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Stricter validation
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav changed the task status from Open to Needs testing.Jul 26 2022, 4:22 PM
Viacheslav assigned this task to df3rry.

Tested locally and receive sflow with agent IP of the configured ip/interface/vrf.