한 서버에서 다른 서버의 방화벽이 열려 있는지 확인하기 위해서는 다른 서버의 IP 주소와 포트 주소 그리고 명령어가 필요하다. 다양한 방법이 있겠지만 주로 telnet, curl 명령어를 통하여 확인한다.

telnet 명령어

telnet [ip] [port]

성공 응답

1
2
Trying [ip]...
telnet: connect to address [ip]: Connection refused

실패 응답

1
2
3
Trying [ip]...
Connected to [ip].
Escape character is '^]'.

cf. ping 명령어

curl 명령어

curl -v [ip]:[port]

성공 응답

1
2
3
4
[root@teraone ~]# curl -v telnet://192.168.56.101:8080
* About to connect() to 192.168.56.101 port 8080 (#0)
*   Trying 192.168.56.101...
* Connected to 192.168.56.101 (192.168.56.101) port 8080 (#0)

실패 응답

1
2
3
4
5
6
7
[root@teraone ~]# curl -v telnet://192.168.56.101:1122
* About to connect() to 192.168.56.101 port 1122 (#0)
*   Trying 192.168.56.101...
* Connection refused
* Failed connect to 192.168.56.101:1122; Connection refused
* Closing connection 0
curl: (7) Failed connect to 192.168.56.101:1122; Connection refused

cf. telnet과 curl은 클라이언트에서 통신 여부를 확인할 때 사용한다.

References