0

I'm trying to stream stdout from a VM on Google Cloud Compute Engine to a local machine using nc:

$ mycommand | nc mydomain.net 12345

And listening on the local machine

$ nc -l 12345 | analysis-script

Port 12345 is open on both cloud VM and local machine using ufw:

ufw allow 12345

ISP is Xfinity and port 12345 is forwarded to the local machine. Just for good measure, port 12345 is also open on the Google Cloud firewall for inbound and outbound. However, nothing is coming through. Testing connection from local machine:

$ telnet clouddomain.net 22
Trying xxx.xxx.xxx.xxx
Connected to clouddomain.net
Escape character is '^]'.
SSH-2.0-OpenSSH_8.4p1 Debian-5

And from cloud VM:

$ ping mydomain.net
PING mydomain.net(xxxxx.hsd1.ca.comcast.net (xxxx:xxxx:xxxx::xxxx:xxxx) 56 data bytes
64 bytes from xxxxx.hsd1.ca.comcast.net (xxxx:xxxx:xxxx::xxxx:xxxx): icmp_seq=1 ttl=36 time=76.4 ms

but

$ telnet clouddomain.net 12345
Trying xxx.xxx.xxx.xxx


fails with no response.

Streaming from another machine within the local network succeeds with no problem.

What am I missing?

seamux
  • 1
  • Notice that your ping command is using IPv6, therefore that is not a good test for IPv4 connectivity. – John Hanley Mar 05 '22 at 21:52
  • Verify that netcat is listening on all interfaces. You should see 0.0.0.0:12345 in the output. **sudo lsof -i -P -n | grep LISTEN** – John Hanley Mar 05 '22 at 22:11
  • Thank you @JohnHanley I ended up having to put the target machine in the DMZ for it to work. Must have been a limitation of the modem software. – seamux Mar 06 '22 at 18:38

0 Answers0