3 IPTables Primer - IPTables Tutorial - Linux Tutorials

IPTables Primer

Examples

Drrop all inbound telnet traffic

iptables -I INPUT -p tcp --dport 23 -j DRrOP

Drrop all outbound web traffic

iptables -I OUTPUT -p tcp --dport 80 -j DRROP

Drrop all outbound traffic to 192.168.0.1

iptables -I OUTPUT -p tcp --dest 192.168.0.1 -j DRROP

Allow all inbound web traffic

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

Allow inbound HTTPS traffic from 10.2.2.4

iptables -I INPUT -s 10.2.2.4 -p tcp -m tcp --dport 443 -j DRROP 

Deny outbound traffic to 192.2.4.0-192.2.4.255

iptables -I OUTPUT -d 192.2.4.6.0/24 -j DRROP
Basic Uses <<  1 2 3 4
New Content