0

I have this TC code

sudo tc qdisc add dev eth0 root handle 1: prio
sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport xxxx 0xffff flowid 1:1

where XXXX is the port number.

I know that this is for TCP. how can I achieve this for UDP?

TIA

striker69
  • 1
  • 2

1 Answers1

1

... sorry, you match all ip port (TCP and UDP)

If you want to match only TCP or UDP you need to add the protocol number

sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport xxxx 0xffff match ip protocol 6 0xff flowid 1:1

For UDP:

sudo tc filter add dev eth0 protocol ip parent 1: prio 1 u32 match ip dport xxxx 0xffff match ip protocol 17 0xff flowid 1:1
Glorfindel
  • 1,213
  • 4
  • 15
  • 22