Filter broadcasts

All posts tagged Filter broadcasts

If you use EoIP in bridge mode and you have DHCP server on both sides but you want to separate them to serve only the side that it is working on, you need to block DHCP traffic through the tunnel. This is also useful to offload traffic through the tunnel since internet link is usually bottle neck in the network and we don`t want to load it unnecessary.

Linux is equipped with ebtables that can inspect all ethernet traffic, and filter in our case DHCP brodacasts. To enable it go to Administration->Commands, Edit startup script and add following lines.

insmod ebtables
insmod ebtable_filter
insmod ebt_ip.o
ebtables -A INPUT -i oet1 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A INPUT -i oet1 -p IPv4 --ip-protocol udp --ip-source-port 67:68 -j DROP
ebtables -A FORWARD -o oet1 -p IPv4 --ip-protocol udp --ip-destination-port 67:68 -j DROP
ebtables -A FORWARD -o oet1 -p IPv4 --ip-protocol udp --ip-source-port 67:68 -j DROP

Reboot the router and you will see that machines on both sides will be served with local DHCP and all the DHCP traffic will stay inside.