These are some of the basic/common commands used for adding, removing and managing ntuple rules.
Note in the below examples I am using the interface name enp5s0f0
; replace that with the relevant interface you are using.
# ethtool -k enp5s0f0 | grep ntuple
ntuple-filters: on
ethtool -K enp5s0f0 ntuple on
ethtool -K enp5s0f0 ntuple off
ethtool -S enp5s0f0 | grep fdir
ethtool -u enp5s0f0
ethtool -U enp5s0f0 flow-type <type> src-ip <ip> [m <ip_mask>] dst-ip <ip>
[m <ip_mask>] src-port <port> [m <port_mask>] dst-port <port> [m <port_mask>]
action <queue>
ethtool -U enp5s0f0 delete <N>
The output of ethtool --help
gives a list of options available:
ethtool -n|-u|--show-nfc|--show-ntuple DEVNAME Show Rx network flow classification options or rules
[ rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6 [context %d] |
rule %d ]
ethtool -N|-U|--config-nfc|--config-ntuple DEVNAME Configure Rx network flow classification options or rules
rx-flow-hash tcp4|udp4|ah4|esp4|sctp4|tcp6|udp6|ah6|esp6|sctp6 m|v|t|s|d|f|n|r... [context %d] |
flow-type ether|ip4|tcp4|udp4|sctp4|ah4|esp4|ip6|tcp6|udp6|ah6|esp6|sctp6
[ src %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]
[ dst %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]
[ proto %d [m %x] ]
[ src-ip IP-ADDRESS [m IP-ADDRESS] ]
[ dst-ip IP-ADDRESS [m IP-ADDRESS] ]
[ tos %d [m %x] ]
[ tclass %d [m %x] ]
[ l4proto %d [m %x] ]
[ src-port %d [m %x] ]
[ dst-port %d [m %x] ]
[ spi %d [m %x] ]
[ vlan-etype %x [m %x] ]
[ vlan %x [m %x] ]
[ user-def %x [m %x] ]
[ dst-mac %x:%x:%x:%x:%x:%x [m %x:%x:%x:%x:%x:%x] ]
[ action %d ] | [ vf %d queue %d ]
[ context %d ]
[ loc %d]] |
delete %d