9/4/2023 0 Comments Iptables examplesSuppose you want to bloc traffic some a MAC address instead of an IP address. Using a Network and not only one IP iptables -A INPUT -s 11.22.33.0/24 -j DROPīlock traffic from a specific MAC address Or an specific port iptables -A INPUT -s 11.22.33.44 -p tcp -dport 22 -j DROP If you want to block only on an specific NIC iptables -A INPUT -s 11.22.33.44 -i eth0 -j DROP The last one is more secure, but require more job.īlock IP traffic from an specific IP or Network.īlock from an IP iptables -A INPUT -s 11.22.33.44 -j DROP You can define the default policy as ACCEPT and then deny specific traffic, or define default policies as DROP and then open specific traffic to and/or from your box. You can see the original image here iptables -P INPUT DROP These aforementioned chains, are better explained in this graph that comes from Wikipedia. Iptables let's you configure default policies for chains in the filter table, where INPUT, FORWARD and OUTPUT, are the main ones (or at least the most used). You can do it in the Tables section in the man page of iptablesĭelete specific table liket nat iptables -t nat -F You should consider reading a bit more about tables. You can also list the other tables like: mangle, raw and security. List rules in specific table iptables -L -t nat This is going, list the default table "Filter".Įdit: You may prefer to use iptables -L -vn to get more information, and to see ports as numbers instead of its names. This is a small manual of iptables, I'll show some basic commands, you may need to know to keep your computer secure. Iptables: Small manual and tutorial with some examples and tips
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |