본문 바로가기
OS/Linux

네트워크 정상 통신체크 / linux / telnet / nc / curl / dev/tcp

by 하하IT 2023. 9. 21.

■ 환경

 - linux 환경

 - telnet , nc, curl 등 프로그램 설치된환경

 

■ 목적

 - 출발지에서 목적지까지의 네트워크 통신가능여부 확인용

 

■ 방법

● 목적지 IP : 192.168.0.194

● 목적지 PORT : 9100

구분 통신이 정상적인 상태인 경우 통신이 불가능한 상태인 경우
telnet [root@linux ~]# telnet 192.168.0.194 9100
Trying 192.168.0.194...
Connected to 192.168.0.194.
Escape character is '^]'.

[root@linux ~]# telnet 192.168.0.194 9100
Trying 192.168.0.194...
응답없음

nc [root@linux ~]# nc -zv 192.168.0.194 9100
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.0.194:9100.
Ncat: 0 bytes sent, 0 bytes received in 0.02 seconds.
[root@linux ~]#
[root@linux ~]# nc -zv 192.168.0.194 9100
Ncat: Version 7.50 ( https://nmap.org/ncat )
응답없음

curl [root@linux ~]# curl -v telnet://192.168.0.194:9100/
* About to connect() to 192.168.0.194 port 9100 (#0)
* Trying 192.168.0.194...
* Connected to 192.168.0.194 (192.168.0.194) port 9100 (#0)

[root@linux ~]# curl -v telnet://192.168.0.194:9100/
* About to connect() to 192.168.0.194 port 9100 (#0)
* Trying 192.168.0.194...
응답없음
/dev/tcp [root@linux ~]# echo > /dev/tcp/192.168.0.194/9100
[root@linux ~]# echo $?
0
[root@linux ~]#

[root@linux ~]# echo > /dev/tcp/192.168.0.194/9100
응답없음