VMWare/Cygwin/Sockets环境下Netcat异常
我很高兴在 XP 上托管的 VMWare 盒子中运行 Ubuntu Linux。
我的 Linux 应用程序打开您的基本服务器套接字端口,我将 netcat (nc) 作为客户端连接到该端口,以侦听我为“真实”客户端放置在该套接字上的流量。 一切都好。
但是,当我在 XP 端打开 Cygwin shell 并从那里运行 nc 时,它似乎无法连接到我的应用程序的服务器套接字。
不过,为了验证连接性,如果我在 Linux/VMWare 环境中将 nc 作为服务器运行 (nc -l -p 3694
),Cygwin 上的 nc 可以毫无问题地连接到它并来回传输数据(IP 地址不是 localhost,而是 DHCP 分配的地址)。
总结一下:
Linux App -- Linux nc : Works
Linux App -- Cygwin nc : Does not work
Linux nc (svr) -- Cygwin nc : Works
I'm happily running Ubuntu Linux in a VMWare box hosted on XP.
My Linux application opens up your basic server socket port, to which I connect netcat (nc) as a client to listen in on the traffic I'm putting on that socket for the "real" clients. All's well.
However, when I open up a Cygwin shell on the XP side and run nc from there it appears to be unable to connect to my application's server socket.
To verify connectivity, though, if I run nc as a server (nc -l -p 3694
) in the Linux/VMWare environment, nc on Cygwin has no trouble connecting to it and transferring data back and forth (the IP address is not localhost, it's the one assigned by DHCP).
To summarize:
Linux App -- Linux nc : Works
Linux App -- Cygwin nc : Does not work
Linux nc (svr) -- Cygwin nc : Works
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用的是哪个 netcat 代码? 至少一种变体存在已知问题......
Which netcat code are you using? At least one variant has known issues...
是否有可能您将访客网络设置为 NAT,因此无法连接到虚拟机中侦听的网络?
Is it possible you have the guest network set to NAT and therefore things can't connect to something listening in the VM?