iptables -I INPUT 1 명령에 1을 지정해야 하는 이유

iptables -I INPUT 1 명령에 1을 지정해야 하는 이유

Linux 방화벽을 구성할 때 다음 명령이 있습니다.

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

이 명령에서 1after를 지정해야 하는 이유는 무엇입니까?INPUT

답변1

우리는하지 않습니다:

IPTABLES(8)
iptables 1.4.19.1

이름 iptables — IPv4 패킷 필터링 및 NAT용 관리 도구

요약...

   iptables [-t table] -I chain [rulenum] rule-specification

답변2

다음을 수행할 필요는 없습니다.

vm ~ # iptables -I INPUT -p tcp --dport 80 -j ACCEPT
vm ~ # iptables -L -vn
Chain INPUT (policy ACCEPT 6 packets, 2250 bytes)
 pkts bytes target     prot opt in     out     source               destination         
0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:80

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
vm ~ # 

관련 정보