Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3015867
  • 博文数量: 535
  • 博客积分: 15788
  • 博客等级: 上将
  • 技术积分: 6507
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-07 09:11
文章分类

全部博文(535)

文章存档

2016年(1)

2015年(1)

2014年(10)

2013年(26)

2012年(43)

2011年(86)

2010年(76)

2009年(136)

2008年(97)

2007年(59)

分类: LINUX

2009-06-17 15:18:54

netcat,很少用,总把这东西忘了,做个记录,这玩意也有windows版的http://joncraton.org/blog/46
[root@domU-12-33-39-01-6C-F1:~] nc -h
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]
          [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_version]
          [-x proxy_address[:port]] [hostname] [port[s]]
        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 161
b端: nc -u a.a.a.a 161
在b端随便输入字符,看是否能够传到a端。 


通过测试,使用nc传文件要比scp快不少,当然,安全性低了。
a端:nc -l 161 >/opt/test
b端:nc a.a.a.a 161
不要使用udp协议啊,UDP不保证传输的可靠性
阅读(9925) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~