How to bind to fixed TCP port ( nc -l 7000) [solved]

Topics about the networking software (ssh, nfs, samba, ...). No questions about network drivers there.
henry6742
Posts: 2
Joined: 25 Jun 2013, 22:24

How to bind to fixed TCP port ( nc -l 7000) [solved]

Postby henry6742 » 25 Jun 2013, 22:47

Hi,
I issued a command 'nc -l 7000' on SystemRescueCD 3.7.
The listening port is different that what I specified.
Could anyone giving me a pointer?

[email protected] /root % nc -l 7000&
[email protected] /root % netstat -luntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:42602 0.0.0.0:* LISTEN 3299/nc

Thanks.

gernot
Posts: 1127
Joined: 07 Apr 2010, 16:19

Re: How to bind to fixed TCP port ( nc -l 7000)

Postby gernot » 26 Jun 2013, 04:24

The correct syntax is "nc -l -p 7000"

Gernot

henry6742
Posts: 2
Joined: 25 Jun 2013, 22:24

Re: How to bind to fixed TCP port ( nc -l 7000)

Postby henry6742 » 26 Jun 2013, 04:42

gernot wrote:The correct syntax is "nc -l -p 7000"

Gernot


It works. Thanks a lot.
I have been used "nc -l <port>" for long time. My bad. I should check the netcat usages.


Return to “Networking (except PXE booting)”

Who is online

Users browsing this forum: No registered users and 1 guest