특정 PC에서 해당 서버로의 ICMP Protocol로 접속이 안될 때..
글쓴이: heaven2 / 작성시간: 월, 2014/03/17 - 12:15오후
특정 PC에서만 ICMP Protocol로 서버의 특정 포트로 접속할 때 접속이 되지 않습니다.
다른 PC에서는 정상적으로 잘 되구요.
혹시 리눅스 서버의 방화벽 때문인가 싶어 살펴보고 있는데,
iptables 설정에 까막눈이라 설정 상태를 보고도 상황을 모르겠네요.
아래의 설정 상황에서 특정 PC에서만 ICMP로 접속 시 접속 거부가 될 수 있을까요?
특이한 것은, 해당 특정 PC도 한 1주일 정도는 잘 되다가 갑자기 안되기 시작했다는 것입니다.
원인을 몰라 해메고 있습니다. 도와주세요..
[ iptables 현재 상태 ]
[root@FILE01 etc]# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain FORWARD (policy ACCEPT) target prot opt source destination RH-Firewall-1-INPUT all -- anywhere anywhere Chain OUTPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp spts:1024:65535 dpt:ftp ACCEPT tcp -- anywhere anywhere tcp spts:1024:65535 dpt:ftp ACCEPT tcp -- anywhere anywhere tcp spts:1024:65535 dpts:1024:65535 Chain RH-Firewall-1-INPUT (2 references) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT icmp -- anywhere anywhere icmp any ACCEPT esp -- anywhere anywhere ACCEPT ah -- anywhere anywhere ACCEPT udp -- anywhere 224.0.0.251 udp dpt:mdns ACCEPT udp -- anywhere anywhere udp dpt:ipp ACCEPT tcp -- anywhere anywhere tcp dpt:ipp ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http ACCEPT tcp -- anywhere anywhere tcp spt:ftp dpts:1024:65535 ACCEPT tcp -- anywhere anywhere tcp spt:ftp dpts:1024:65535 ACCEPT tcp -- anywhere anywhere tcp spt:http dpts:1024:65535 ACCEPT tcp -- anywhere anywhere tcp spts:1024:65535 dpts:1024:65535 REJECT all -- anywhere anywhere reject-with icmp-host-prohibited [root@FILE01 etc]#
Forums:
interface 장치 이름이 빠져 있어 확답이
interface 장치 이름이 빠져 있어 확답이 어렵습니다.
iptables -S 의 결과를 분석해보세요.
PC->서버
PC->서버로 tracert 때려보세요...
어디서 걸리는지 ,,백본에서 설정이 변경되어서 그럴 경우도 있구요.
PC에서 서버로 nmap돌려보고 telnet 포트로도 접속해보고
ICMP 안된다니 ping도 안되겠지만
어떤 포인트에서 장애가 발생한지 확인하고 대처해야될듯 합니다.
방화벽 제일 마지막 라인이 문제로
방화벽 제일 마지막 라인이 문제로 보입니다.
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
해당 구문은 모든 icmp 메시지를 차단한다는 설정이며, 이때문에 icmp ping 조차 되지 않는 현상으로 보여집니다.
iptables -D 명령으로 해당 구문을 삭제하시거나, 최초 iptables 입력 스크립트에서 해당 라인을 삭제하시면 될것 같습니다.
출처: https://kldp.org/node/97390
---------------------------------
제일 왼쪽이 저입니다 :)
그 구문은 그 위에 열거된 모든 rule chain
그 구문은 그 위에 열거된 모든 rule chain 에 해당되지 않는 상황이 발생했을 때,
모든 프로토콜(all) 에 대해 접속 거부(REJECT) 를 하기 위한 구문이고,
접속 거부 이유(host-prohibited)를 ICMP 를 통해 peer에게 알려주는 부가 기능을 추가한 구문입니다.
애초에
ACCEPT all -- anywhere anywhere
가 rule 의 맨 처음에 있으니, 여기에 만약 인터페이스 지정이 없었다면 방화벽은 없는 것이나 다름 없습니다.
iptables -S 로 보면 각 rule 의 규칙을 좀 더 명확하게 분석할 수 있습니다.
아..... 제가 잘못 분석했네요;;; 정확히
아..... 제가 잘못 분석했네요;;;
정확히 말씀하신 그대로네요.
ㅎㅎㅎㅎ 한수 배우고 갑니다. :)
---------------------------------
제일 왼쪽이 저입니다 :)
댓글 달기