외부아이피로 텔넷접속이 안됩니다

외부아이피로 텔넷접속이 안됩니다

kimsufi VPS에서 실행되는 postfix 서버가 있고 여기에 roundcube를 설치했는데 모든 것이 정상입니다. 문제는 다른 서버에서 연결을 시도할 때 시간 초과가 발생한다는 것입니다.

telnet whys.fr 25
Trying 5.196.66.189...
telnet: Unable to connect to remote host: Connection timed out

내 netstat 출력은 다음과 같습니다.

netstat -ntpul | grep 25
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      17643/master    
tcp6       0      0 :::25                   :::*                    LISTEN      17643/master

그리고 현재 iptables 규칙은 다음과 같습니다.

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
fail2ban-ssh  tcp  --  anywhere             anywhere             multiport dports ssh

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

Chain fail2ban-ssh (1 references)
target     prot opt source               destination         
RETURN     all  --  anywhere             anywhere            

localhost의 텔넷이 훌륭하게 작동합니다.

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 whys.fr ESMTP Postfix (Debian/GNU)
ehlo whys.fr
250-whys.fr
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.

서버는 OVH의 데이터 센터에서 호스팅되며 포트 25는 차단되지 않습니다.

nmap -p 25 whys.fr

Starting Nmap 6.47 ( http://nmap.org ) at 2015-02-20 15:16 CET
Nmap scan report for whys.fr (5.196.66.189)
Host is up (0.019s latency).
rDNS record for 5.196.66.189: ns330237.ip-5-196-66.eu
PORT   STATE    SERVICE
25/tcp filtered smtp

Nmap done: 1 IP address (1 host up) scanned in 0.72 seconds

나는 또한 내 IP가 그 중 하나에 있는지 확인하기 위해 메일 스팸 목록을 확인했지만 그렇지 않았습니다.

외부에서 Telnet 25를 수락하려면 어떻게 해야 합니까? 지금은 잘 모르겠지만 이미 SF에서 이에 관한 모든 질문을 봤고 나머지 인터넷에서도 많은 질문을 봤습니다.

답변1

nmap 문서에 따르면:

filtered

Nmap cannot determine whether the port is open because packet filtering prevents
its probes from reaching the port. The filtering could be from a dedicated
firewall device, router rules, or host-based firewall software. These ports
frustrate attackers because they provide so little information. Sometimes they
respond with ICMP error messages such as type 3 code 13 (destination unreachable:
communication administratively prohibited), but filters that simply drop probes
without responding are far more common. This forces Nmap to retry several times
just in case the probe was dropped due to network congestion rather than
filtering. This slows down the scan dramatically.

따라서 귀하의 포트가 단순히 방화벽 어딘가에 의해 차단된 것 같습니다. 어쩌면 지역 ISP일까요? 연결을 시도하면 연결이 이루어지기 때문입니다.

$ telnet whys.fr 25
Trying 5.196.66.189...
Connected to whys.fr.
Escape character is '^]'.
220 whys.fr ESMTP Postfix (Debian/GNU)

안타깝게도 ISP가 클라이언트 컴퓨터의 봇이 스팸을 직접 보내는 것을 방지하기 위해 자체 네트워크 외부의 포트 25에 대한 직접 연결을 차단하는 것은 드문 일이 아닙니다.

답변2

더 진행하기 전에 가장 먼저 할 일은 다음과 같은 도구를 사용하여 포트 25를 끝까지 테스트하는 것입니다.넷캣.

이 도구는 대부분의 Linux 배포판에 표준으로 제공됩니다. 예를 들어 CentOS에서는 포트 25를 릴리스하기 위해 postfix를 중지합니다. 그런 다음 다음과 같이 netcat을 시작합니다.

# nc -l 25

그런 다음 원격 클라이언트에서 다음과 같이 시작합니다.

# nc {ip of remote server} 25

그러면 양쪽 끝에 입력하는 모든 내용이 화면에 반영되거나 표시됩니다. 그렇지 않은 경우 포트가 도중에 차단되는 것입니다.

관련 정보