Thursday, February 11, 2016

ebtables and iptables

These two commands are basic firewall configuration commands.

Show command help information
iptables -h
ebtables -h

Samples
1) block ip output traffic on port 4002
iptables -A OUTPUT -p ip --dport 4002 -j DROP

2) block ipv4 (udp) forwarding traffic on port 4002 and on mac ID 00:20:c0:01:7c:21
ebtables -A FORWARD -p IPv4 --src 00:20:c0:01:7c:21 --ip-protocol udp --ip-source-port 4002 -j DROP

More information
http://ebtables.netfilter.org/misc/ebtables-man.html
http://ebtables.netfilter.org/examples/basic.html
https://en.wikipedia.org/wiki/Iptables
https://upload.wikimedia.org/wikipedia/commons/3/37/Netfilter-packet-flow.svg


No comments:

Post a Comment