1832181 Members
2766 Online
110038 Solutions
New Discussion

Problems with ntpd

 
Pepe Jimenez Muñoz
Frequent Advisor

Problems with ntpd

Hi,

the last saturday we change teh system network config to admit two IPs in the same network card.

/etc/rc.config.d/netconf

....
INTERFACE_NAME[0]=lan2
IP_ADDRESS[0]=10.72.0.2
SUBNET_MASK[0]=255.255.224.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]=0

INTERFACE_NAME[1]=lan2:1
IP_ADDRESS[1]=10.72.0.3
SUBNET_MASK[1]=255.255.224.0
BROADCAST_ADDRESS[1]=""
INTERFACE_STATE[1]=""
DHCP_ENABLE[1]=0

INTERFACE_NAME[2]=lan0
IP_ADDRESS[2]=192.10.10.2
SUBNET_MASK[2]=255.255.255.0
BROADCAST_ADDRESS[2]=192.10.10.255
INTERFACE_STATE[2]=up
DHCP_ENABLE[2]=0
........


When we try to start xntpd we get :

Oct 4 12:21:11 nodo2 xntpd[15063]: tickadj = 625, tick = 10000, tvu_maxslew = 61875
Oct 4 12:21:11 nodo2 xntpd[15063]: precision = 11 usec
Oct 4 12:21:11 nodo2 xntpd[15063]: bind() fd 12, family 2, port 123, addr 0a481fff, in_classd=0 f
lags=0 fails: Address already in use

How can I solve this problem...?????

THANKS
ppviso
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor

Re: Problems with ntpd

Hi,

did you reboot your server ?

# check if xntp is still running
# ps -ef | grep ntp

Regards,
Robert-Jan
Pepe Jimenez Muñoz
Frequent Advisor

Re: Problems with ntpd

Yes, my server has benn rebooted.

nodo2 # ps -fea | grep ntp
root 28295 21862 0 13:05:51 pts/0 0:00 grep ntp
nodo2 #

ppviso
RAC_1
Honored Contributor

Re: Problems with ntpd

Your first problem is having two ips on the same subnet mask. Now this may/may not be related to the NTP problem.

NTP uses port udp-123. do you have lsof installed?? If yes, do
lsof -p udp:123 This will tell you which process is using that port.

Also if do not have lsof tool, do
netstat -a|grep 123

Check which processes is using the udp port 123. I think your problem is coming out of having two ips on the same subnet.

Anil
There is no substitute to HARDWORK
SAHA
Honored Contributor

Re: Problems with ntpd

Try changing subnet mask of one interface.

Thanks,
You must PASS failure on way to success !!!
david dalton_1
New Member

Re: Problems with ntpd

Certainly NTPv3 cannot understand this business of "two IP addresses on one interface" when both addresses are on the same subnet. (Probably NTPv4 cannot understand this either.)

At startup, the NTP daemon will get all configured interfaces listed by the system and attempt to bind to port 123 on each one. Since you have:

INTERFACE_NAME[0]=lan2
IP_ADDRESS[0]=10.72.0.2
SUBNET_MASK[0]=255.255.224.0

INTERFACE_NAME[1]=lan2:1
IP_ADDRESS[1]=10.72.0.3
SUBNET_MASK[1]=255.255.224.0

these appear to be the same (addr 0a481fff) due to your subnet mask. Thus the daemon cannot bind to the second one (address already in use).

You might get around this problem by changing the subnet mask (in both instances) to 255.255.255.0, but this is not what I recommend.

Instead, ask yourself this question:

Why am I setting up two IP addresses on the same subnet?

Because of the way routing works in the kernel, all outbound traffic will go to the first interface, never to the second. So your lan2:1 is going to be pretty useless in this configuration. Worse than useless, since it has torpedoed xntpd.

Change your lan2:1 configuration.
Pepe Jimenez Muñoz
Frequent Advisor

Re: Problems with ntpd

Thanks to all.

This morning the HP support tell me:

"Touch /etc/ntp.conf and put server 127.127.1.1 in a line"

And... it´s working now.

Before the /etc/ntp.conf have:

broadcastclient no
server 127.127.1.1
ppviso