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

0

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .