1832990 Members
2325 Online
110048 Solutions
New Discussion

enable tcp port

 
j773303
Super Advisor

enable tcp port

When I create 99999/test in etc/services, I what to test the connection from client to server. How to I enable 99999 to listen mode, let the client can test the connection? And how to test it? which command can do that? telnet hostname 99999 ???
Hero
5 REPLIES 5
Ricardo Bassoi
Regular Advisor

Re: enable tcp port

Hi,

The /etc/services doesn't enable/disable ports, it provides a way of associating port names with the port number (a bit like /etc/hosts with IP addresses). You don't need to have anything in /etc/services in order to use a port by number.

By the way you can try restarting the inetd with inetd -c

Regards,

Bassoi
If you never try, never will work
Tim Adamson_1
Honored Contributor

Re: enable tcp port

Try a port number under 65535. You can't use a port number that high.
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
U.SivaKumar_2
Honored Contributor

Re: enable tcp port

Hi,

I dont think you can use the port 99999 as the maximum number of ports supported is 65535.

Then coming to your question. To connect to a port you have to run a process ( program written using network/socket function calls ) which is hardcoded to bind to the desired port and should be in LISTEN state to accept connections.

regards,

U.SivaKumar
Innovations are made when conventions are broken
twang
Honored Contributor

Re: enable tcp port

Fro sample program in C for working with sockets, you may look at your system under:
/usr/lib/demos/networking/socket

Caesar_3
Esteemed Contributor

Re: enable tcp port

Hello!

First you can't use this number of port,
choose one that under 65535
Write a small program on C or perl that
will open the port and listend for connection
Then try the telnet

Caesar