Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Aug 6 '12 at 21:01

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.