[root@h102 ~]# nc -zvn 192.168.100.101 20-25
nc: connect to 192.168.100.101 port 20 (tcp) failed: No route to host
nc: connect to 192.168.100.101 port 21 (tcp) failed: No route to host
Connection to 192.168.100.101 22 port [tcp/*] succeeded!
nc: connect to 192.168.100.101 port 23 (tcp) failed: No route to host
nc: connect to 192.168.100.101 port 24 (tcp) failed: No route to host
nc: connect to 192.168.100.101 port 25 (tcp) failed: No route to host
[root@h102 ~]# nc -zvn 192.168.100.101 3306
Connection to 192.168.100.101 3306 port [tcp/*] succeeded!
[root@h102 ~]#
Option | Comment |
---|---|
-z | 只作扫描,不发数据 |
-n | 不作解析,数字状态 |
-v | 给出详细信息 |
[root@h102 ~]# nc -l 12345
hello
for test
i miss you
^_^
----------
[root@h101 BGPtest]# nc h102 12345
hello
for test
i miss you
^_^
此刻,要确认server端的防火墙对于12345端口是打开的
[root@h102 nc]# echo "abc test" > file.txt
[root@h102 nc]# nc -l 2345 < file.txt
----------
[root@h101 nc]# nc h102 2345 > f.txt
[root@h101 nc]# cat f.txt
abc test
[root@h101 nc]#
[root@h102 nc]# nc -l 2345 > file.txt
----------
[root@h101 nc]# echo "uiuiuiuiui" > f.txt
[root@h101 nc]# nc -v h102 2345 < f.txt
Connection to h102 2345 port [tcp/dbm] succeeded!
[root@h101 nc]#
----------
[root@h102 nc]# cat file.txt
uiuiuiuiui
[root@h102 nc]#
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有