![iptables -I INPUT 1 명령에 1을 지정해야 하는 이유](https://linux55.com/image/8204/iptables%20-I%20INPUT%201%20%EB%AA%85%EB%A0%B9%EC%97%90%201%EC%9D%84%20%EC%A7%80%EC%A0%95%ED%95%B4%EC%95%BC%20%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0.png)
Linux 방화벽을 구성할 때 다음 명령이 있습니다.
iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
이 명령에서 1
after를 지정해야 하는 이유는 무엇입니까?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 ~ #