使用nc命令检查tcp/udp端口

nc命令检查tcp/udp端口

tcp 端口检查:

#telnet 10.128.0.160 22
Trying 10.128.0.160…
Connected to 10.128.0.160.
Escape character is ‘^]’.
#nc -z 10.128.0.160 22
Connection to 10.128.0.160 22 port [tcp/ssh] succeeded!
#nc -z 10.128.16.9 123

UDP端口检查:

#nc -uz 10.128.0.160 22 #UDP端口22不通
#nc -uz 10.128.16.9 123 #UDP端口123通
Connection to 10.128.16.9 123 port [udp/ntp] succeeded!

nc命令通信:

#nc -l 1234
eee
ccc
#nc 10.128.16.35 1234
eee
ccc

你可能感兴趣的:(linux)