LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   UDP port (https://www.linuxquestions.org/questions/linux-newbie-8/udp-port-644777/)

answerme 05-26-2008 02:08 AM

UDP port
 
How to configure UDP port in linux I meant how can find out UDP port

reddazz 05-26-2008 02:39 AM

Can you provide a bit more info about what you are trying to do, because as it is, your question is a bit vague.

Agrouf 05-26-2008 02:42 AM

To know which service use which udp port:
grep /udp /etc/services
To know which udp port is currently in use (which mean a local process is listening on this port):
netstat -au
To know which port is used on remote machine:
nmap -PU remote_machine

pinniped 05-26-2008 02:44 AM

Typical services can be found in a file like /etc/services (at least that's what it is on Debian). This should be the actual mapping for the system you're using. You can also go to iana.org and look up the assigned ports there.

Many services (such as mail), although assigned a port by IANA, can always be reconfigured to use a different port. You need to look at the configuration files of the various services to see what ports they will actually use. In some cases where the port may be hard-coded, you will need to look at the source for your particular service.

There are thousands of little-used servers which will open up ports at just about any address; in such cases you need to look at the configuration and the source.

You can use various network toolkits to see what ports are open for 'listening'.

reddazz 05-26-2008 03:14 AM

Quote:

Typical services can be found in a file like /etc/services (at least that's what it is on Debian)...
The likes of SUSE, Mandriva, Red Hat etc also have the services files in /etc/, so it seems like thats the standard location.

Agrouf 05-26-2008 04:31 AM

/etc/services is present on AIX, HP-UX, BSD and many unices and unix-like systems. It's the standard way I believe (althgouth I don't know the iso number or the norm it fulfills).
Anyway, the question was indeed vague. 'configuring' UDP port doesn't really mean anything, and neither does 'finding out'. Maybe you could tell us what you are trying to do, or elaborate on what kind of configuration you are asking for?

answerme 06-05-2008 06:48 AM

I want to listen on the SIP UDP port 5060 in linux for the connectivity of 2 sip phones .I know UDP port is not listening
Can any one tell how i can configure this specific port

Agrouf 06-05-2008 07:20 AM

A port isn't listening to anything. An application is listening on a port.
The UDP port is the phone number. The phone number isn't listening to anything. If nobody is home, nobody is listening to the phone. What you need is somebody answering the phone when the other one calls and that someone should talk the same language as the caller.
That somebody is an application. Ekiga, for instance, is an application that talks SIP and would gladly answer if someone called on port 5060 to talk SIP.

indeliblestamp 06-05-2008 07:45 AM

If you just want to see whether an application on your box is listening on port 5060, try something like this:
Code:

netstat -nap | grep 5060
If you want to see the actual messages being exchanged, use wireshark.


All times are GMT -5. The time now is 07:30 PM.