FORWARD 체인의 첫 번째 규칙이 흥미 롭습니다. 정책이 DROP 인 경우 왜 이것이 필요한 규칙입니까?
root@tomato:/tmp/home/root# iptables -L --line-numbers
Chain INPUT (policy DROP)
num target prot opt source destination
1 REJECT tcp -- anywhere tomato multiport dports www,https,ssh reject-with tcp-reset
2 REJECT tcp -- anywhere tomato-lan1 multiport dports www,https,ssh reject-with tcp-reset
3 DROP all -- anywhere anywhere state INVALID
4 ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
5 shlimit tcp -- anywhere anywhere tcp dpt:ssh state NEW
6 ACCEPT all -- anywhere anywhere
7 ACCEPT all -- anywhere anywhere
8 ACCEPT all -- anywhere anywhere
Chain FORWARD (policy DROP)
num target prot opt source destination
1 REJECT tcp -- anywhere tomato multiport dports www,https,ssh reject-with tcp-reset
2 REJECT tcp -- anywhere tomato-lan1 multiport dports www,https,ssh reject-with tcp-reset
3 ACCEPT all -- anywhere anywhere
4 ACCEPT all -- anywhere anywhere
5 DROP all -- anywhere anywhere state INVALID
6 ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
7 DROP all -- anywhere anywhere
8 DROP all -- anywhere anywhere
9 wanin all -- anywhere anywhere
10 wanout all -- anywhere anywhere
11 ACCEPT all -- anywhere anywhere
12 ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Chain shlimit (1 references)
num target prot opt source destination
1 all -- anywhere anywhere recent: SET name: shlimit side: source
2 DROP all -- anywhere anywhere recent: UPDATE seconds: 60 hit_count: 4 name: shlimit side: source
Chain wanin (1 references)
num target prot opt source destination
1 ACCEPT tcp -- anywhere oldtimer tcp dpt:3300
Chain wanout (1 references)
num target prot opt source destination
1) 규칙은 더 높은 수준의 설명을 취하는 일부 프로그램에 의해 자동으로 생성됩니다. 규칙이 거기에 나타나기 때문에 "필수"라고 가정하지 마십시오.
2) 규칙이 꼭 필요하지 않더라도 어떤 것이 허용되지 않는다는 것을 명시 적으로 명시하기 위해 규칙을 포함하는 것이 좋습니다.
3) 즉, 테이블 끝에 도달하고 기본 DROP 정책이 적용되기 전에 패킷을 수락하는 다른 규칙이있는 경우 실제로이 규칙을 포함해야 할 수 있습니다.
특히 FORWARD 체인의 규칙 11과 12는 동일 해 보이며 모든 것을 허용하는 것 같습니다 (따라서 나열되지 않은 속성이있을 수 있습니다. -S
대신 시도하십시오 -L
). 실제로 해당하는 경우 기본 정책과 동일합니다. 수락, 그래서 당신은 당신이 삭제하려는 모든 것을 명시 적으로 삭제해야합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다