iptables [-A/-D] INPUT -s [IP/netmask] -d [IP/netmask] -p [tcp/udp/icmp] -j [ACCEPT/DROP/QUEUE(RETURN)] --sport [source port] --dport [dest port]
#입력
iptables -A INPUT -s 192.168.1.1/255.255.255.255 -d 192.168.1.2/255.255.255.255 -p tcp -j ACCEPT --sport all --dport all
#삭제 (똑같은 룰에 -A를 -D로)
iptables -D INPUT -s 192.168.1.1/255.255.255.255 -d 192.168.1.2/255.255.255.255 -p tcp -j ACCEPT --sport all --dport all
-A : 입력
-D : 삭제
-s : source (어디서)
-d : destination (어디로)
-p : 프로토콜
-j ACCEPT : 수락
DROP : 드랍~
QUEUE(RETURN) : 대충 통과하고 다음 룰.....
|