Page MenuHomeVyOS Platform

Sflow - Add Source address parameter
Closed, ResolvedPublicFEATURE REQUEST

Description

When configuring sflow, there's no source-address option. Possible options:

vyos@vyos# set system flow-accounting sflow 
Possible completions:
   agent-address
                sFlow agent IPv4 address
   sampling-rate
                sFlow sampling-rate
+> server       Server to export sFlow [REQUIRED]

When configuring agent-address with ip 203.0.113.100 (assigned to dummy interface) and sflow server 192.0.2.200, reachable through interface eth3 which has IP 198.51.100.1, I can see traffic on remote router as next:

12:06:09.531886 IP 198.51.100.1.47322 > 192.0.2.200.6343: sFlowv5, IPv4 agent 203.0.113.100, agent-id 0, length 48
12:06:09.531886 IP 198.51.100.1.47322 > 192.0.2.200.6343: sFlowv5, IPv4 agent 203.0.113.100, agent-id 0, length 48

This is correct and working as expected.

New request: be able to set source address in sflow. For example:

set system flow-accounting sflow source-address x.x.x.x

So, for example assigning source ip address 203.0.113.100 (in this particular case, source-ip == agent-address), on remote router connection will look like:

12:06:09.531886 IP 203.0.113.100.47322 > 192.0.2.200.6343: sFlowv5, IPv4 agent 203.0.113.100, agent-id 0, length 48
12:06:09.531886 IP 203.0.113.100.47322 > 192.0.2.200.6343: sFlowv5, IPv4 agent 203.0.113.100, agent-id 0, length 48

Details

Difficulty level
Easy (less than an hour)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

KEY:            nfprobe_source_ip
DESC:           Defines the local IP address from which NetFlow datagrams are exported. Only a numerical IPv4/
		IPv6 address is expected. The supplied IP address is required to be already configured on
		one of the interfaces. This parameter is also required for graceful encoding of NetFlow v9
		and IPFIX option scoping.
DEFAULT:	IP address is selected by the Operating System

Required key would be nfprobe_source_ip https://github.com/pmacct/pmacct/blob/master/CONFIG-KEYS#L2242

Viacheslav changed the task status from Open to In progress.Dec 6 2021, 2:45 PM
Viacheslav claimed this task.

The correct key for sflow sfprobe_source_ip
PR https://github.com/vyos/vyos-1x/pull/1099

set interfaces ethernet eth0 address '192.168.122.11/24'
set interfaces ethernet eth0 address '192.168.122.58/24'

set system flow-accounting disable-imt
set system flow-accounting interface 'eth1'
set system flow-accounting sflow server 192.168.122.1 port '6343'
set system flow-accounting sflow source-address '192.168.122.58'

uacctd.conf

vyos@r11-roll# cat /etc/pmacct/uacctd.conf | tail -n 3
sfprobe_receiver[sf_192.168.122.1]: 192.168.122.1:6343
sfprobe_agentip[sf_192.168.122.1]: 192.168.122.11
sfprobe_source_ip[sf_192.168.122.1]: 192.168.122.58
Viacheslav changed the task status from In progress to Needs testing.Dec 6 2021, 5:17 PM
c-po edited projects, added VyOS 1.3 Equuleus (1.3.0); removed VyConf.
c-po changed Difficulty level from Unknown (require assessment) to Easy (less than an hour).
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
c-po moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus (1.3.0) board.