Home   Profile   Fun
#13 Linux  03.04.2007

The command iptables


Create some very basic firewall rules with iptables. All rules and chains created at the command prompt will be deleted after next reboot. For a permanent use you have to set them in a boot script.

Drop all incoming packets of all protocols from sender (ip address or URL)
iptables -A INPUT -j DROP -s sender

Reject all incoming icmp packets (then the server cannot be pinged)
iptables -A INPUT -p icmp -j REJECT

List all rules of all chains with line numbers
iptables -L --line

Delete rule 1 from chain INPUT
iptables -D INPUT 1

Delete all rules of a chain
iptables -F chainname

Create your own chain to group several rules
iptables -N chainname

Delete a chain
iptables -X chainname


Apache hardening
IDS/IPS systems with Snort
SELinux Training