TCP connection to my host's public IP address using Linux netcat

0

I need to make a TCP connection to my machine through an application that needs only the public IP address and port to connect.

I have been able to do it in Windows, but I need to do it in Linux also.

I have used the nc command to open the port I want, and I have been able to connect to it with the command nc localhost port.

But I want to test it with the public IP instead of localhost. I have also tried to connect with telnet without success.

I have done port forwarding from my router and if I got this well, the inbound connections to the public IP:port are redirected to my LAN IP:port right?

The outpout of nc 'my public ip' port says connection refused.

My firewall is off.

Any ideas? How can I test it?

ar ar ar

Posted 2012-08-06T18:58:52.920

Reputation: 1

Answers

0

On your linux do a nc -l 1234 to listen on port 1234. Your router must forward that port to your box. See the manpage for nc for the client/server section.

ott--

Posted 2012-08-06T18:58:52.920

Reputation: 1 911