iptables what does dpt:route mean?

I am seeing these lines when I list like iptables -v -L

pkts bytes target prot opt in out source destination 0 0 DROP udp -- vlan2 any anywhere anywhere udp dpt:route 0 0 DROP udp -- br0 any anywhere anywhere udp dpt:route 0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:route

This seems a bit contradictory to mean because it seems like it is accepting and dropping at the same. The last rule also seems a bit unsafe to me but it was there on the default installation on DD-WRT so I don't think I'm understanding what it's there for in the first place. I couldn't find any documentation on what dpt:route means. Thanks for any clarifications

2

1 Answer

dpt:route means match packets with the destination port associated with the route service. To map a service to a port number take a look at /etc/services. From that we get:

$ cat /etc/services | grep route
route 520/udp router routed # RIP

This seems a bit contradictory to mean because it seems like it is accepting and dropping at the same.

The rules are not contradictory because they have one key difference - the input interface: vlan2, br0 and any for each of the respective rules. So taken together the rules are saying to drop all RIP packets that arrive from vlan2 and br0 but accept RIP packets that arrive from all other interfaces.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like