Iptables study notes
Three filtered points (chains):
Ingress INPUT
Export OUTPUT
Forward FORWARD
Handling method:
DROP
ACCEPT
REJECT
LOG
-A-- append
-D-- delete
-I-- insert
-R-- replace
-L-- list
-F-- flush
-Z-- zero
-N-- new
-x-- delete-chain
-p-- policy
-E-- rename-chain
-p-- proto
-s-- source
-d-- destination
-I-- in-interface
-j-- jump
-m-- maatch
-n-- numeric
-o-- out-interface
-t-- table
Iptables-An INPUT-p ipmp-j DROP
Iptables-An INPUT-p tcp-d (target ip)-- dport 21-j DORP
Iptables-L-n view
Iptables-F clear # clear before configuration
Determine the purpose of the server, for example:
Hhtp server, only open 80, in addition, easy to manage open 22
Iptables-An INPUT-p tcp [- d 10.0.0.8]-- dport 22-j ACCEPT
Iptables-An OUTPUT-p tcp [- s 10.0.0.8]-- sport 22-j ACCEPT
Iptables-P INPUT DROP
Iptables-P FORWARD DROP
Iptables-P OUTPUT DROP
Iptables-L-n
Iptables-An INPUT-p tcp [- d 10.0.0.8]-- dport 80-j ACCEPT
Iptables-An OUTPUT-p tcp [- s 10.0.0.8]-- sport 80-j ACCEPT
Service iptables save = = iptables-save > / etc/sysconfig/iptables