免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2676 | 回复: 0
打印 上一主题 下一主题

使用nc检测udp端口是否可以正常通讯 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-06-17 15:18 |只看该作者 |倒序浏览

                                                                                                netcat,很少用,总把这东西忘了,做个记录,这玩意也有windows版的。[root@domU-12-33-39-01-6C-F1:~] nc -husage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]          [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]          [-x proxy_address[:port]] [hostname] [port]        Command Summary:                -4              Use IPv4                -6              Use IPv6                -D              Enable the debug socket option                -d              Detach from stdin                -h              This help text                -i secs         Delay interval for lines sent, ports scanned                -k              Keep inbound sockets open for multiple connects                -l              Listen mode, for inbound connects                -n              Suppress name/port resolutions                -p port         Specify local port for remote connects                -r              Randomize remote ports                -s addr         Local source address                -T ToS          Set IP Type of Service                -C              Send CRLF as line-ending                -t              Answer TELNET negotiation                -U              Use UNIX domain socket                -u              UDP mode                -v              Verbose                -w secs         Timeout for connects and final net reads                -X proto        Proxy protocol: "4", "5" (SOCKS) or "connect"                -x addr[:port]  Specify proxy address and port                -z              Zero-I/O mode [used for scanning]        Port numbers can be individual or ranges: lo-hi [inclusive]
用来测试upd端口是否正常a端:nc -ul 161b端: nc -u a.a.a.a 161在b端随便输入字符,看是否能够传到a端。
通过测试,使用nc传文件要比scp快不少,当然,安全性低了。a端:nc -l 161 >/opt/testb端:nc a.a.a.a 161 不要使用udp协议啊,UDP[color="#000102"]不保证传输的可靠性
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/32831/showart_1967265.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP