Operating System - Linux
1827668 Members
3515 Online
109967 Solutions
New Discussion

ntp configuration with multiple interfaces

 
Peter Heinemann
Frequent Advisor

ntp configuration with multiple interfaces

I'm stumped by a problem with ntp on RH 7.3 The system has two nics; eth0 is routed to a private lan, eth1 to a public lan.

static-routes has the appropriate routing controls.

It appears, however, that ntpd insists on making the connection across the public interface (judging by the output from netstat), even though the targeted time server is routed to via the private interface in static-routes.

The 254 subnet is the public one.

udp 0 0 xx.yy.254.zz:ntp *:*
udp 0 0 acutalhost.actualdomain.ntp *:*
udp 0 0 localhost.localdoma:ntp *:*
udp 0 0 *:ntp *:*

Is anyone aware of a directive in ntp.conf or a switch to ntpd to indicate interface? Or additional routing configurations for udp?


Thanks....
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: ntp configuration with multiple interfaces

As far as I know:

ntp is not interface dependent, nor does it have directives.

If its running on the box and there is a route between the daemon server and the time server it will choose the best route.

I generally leave ntpd only one possible route by closing all others with iptables firewall.

Make sure the port is open only on the private lan (or intended lan) and then run ntpq -p to test communications.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Don_89
Trusted Contributor

Re: ntp configuration with multiple interfaces

If you are using hostnames in the ntp.conf file, I would suspect it would be a DNS issue if its going out the public interface.

If your using IP's in the ntp.conf file , then its probably a routing issue.Is the internal NTP server on the same segment as the RH 7.3 box?

Post your hosts file, ntp.conf, ifconfig, routing table and we should be able to figure it out..

BTW, we have a internal NTP server, I always run NTPDATE from cron with the NTP IP address, 3x a day..
Peter Heinemann
Frequent Advisor

Re: ntp configuration with multiple interfaces

Turns out that netstat was returning incomplete information; I found through tcpdump that the timeserver was being queried. Just didn't show up either netstat nor in messages.