1821985 Members
3433 Online
109638 Solutions
New Discussion юеВ

UDP Port 123 in use

 
Ngoh Chean Siung
Super Advisor

UDP Port 123 in use

Hi,

May I know what is the command to check whether UDP Port 123 being utilized? If yes, how to release it?

regards.
7 REPLIES 7
Marcel Boogert_1
Trusted Contributor

Re: UDP Port 123 in use

Check /etc/services. Bij default UDP port 123 is used by the ntp service.

MB.
Bharat Katkar
Honored Contributor

Re: UDP Port 123 in use

Hi,
Use
# netstat -a

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Muthukumar_5
Honored Contributor

Re: UDP Port 123 in use

We can start the check as,

grep -w '132' /etc/services

It will give the service name details.

Check the network status as,

netstat -na | grep -w '132'

It will give informations.

Easy to suggest when don't know about the problem!
rick jones
Honored Contributor

Re: UDP Port 123 in use

The file /etc/services only stores mappings of service names to corresponding port numbers. It neither "reserves" port numbers, nor gives any indication that a given port number is actually in use.

Netstat -a will show if "ntp" is in use, because it will see that there is a socket bound to the port number corresponding to the service name "ntp" but will not show the number "123" itself (you have to add -n) and will not say which process or processes has a socket open bound to port 123 - you have to use lsof for that.
there is no rest for the wicked yet the virtuous have no pillows
Ngoh Chean Siung
Super Advisor

Re: UDP Port 123 in use

Hi,

How to use lsof? I try to man lsof but nothing for this command.

regards.
rick jones
Honored Contributor

Re: UDP Port 123 in use

You have to install lsof "from the net" - either from the HP-UX porting archives, or perhaps the HP Internet Express bits (software.hp.com) or from the original sources. Google or other searches for "lsof" will/should find the sources.

If netstat -an shows there is a socket bound to port 123, given that is indeed the port number assigned to the service provided by NTP, you could simply do a ps -ef | grep ntp and see if the xntpd is running.

If it is, then that would explain why say an attempt to run ntpdate would fail. And if xntpd is running, it should in theory be synced with its time sources, making a run of ntpdate unnecessary. The ntpq command can be used to check on the status of time synchronization, and you can check the syslog file (/var/adm/syslog/syslog.log) for message from the xntpd.
there is no rest for the wicked yet the virtuous have no pillows
Con O'Kelly
Honored Contributor

Re: UDP Port 123 in use

Hi

The following command shows a listing for all ports in use
# lsof -i

Or for specific ports use:
# lsof -i :123

Cheers
Con