Brian Utterback writes:
> I would also like to be able to get an NTP server through DHCP, but
> I need to talk to the NWAM and DHCP people about that.
That'd be pretty nice. To do it, just use:
/sbin/dhcpinfo NTPservs
If DHCP is running with a primary interface, you'll get an exit code
of 0 and a list of numeric IP addresses (one per line, ordinary
decimal dotted-quad format) on standard output. The list will be
empty if the DHCP server isn't providing addresses. If it's not
running, you'll get an exit code of 2 and a "connect: Connection
refused" error message on stderr.
You can query individual DHCP sessions by using "-i" to identify the
interface name, and using either "ifconfig -a" or SIOCGIFCONF to
locate the IFF_DHCP interfaces. That might be a wise thing to do, as
you'll end up maximizing the number of servers you have available to
you, which ought to be a good thing for NTP, as well as locating
active interfaces that do _not_ run DHCP (and thus would be candidates
for multicast or broadcast attempts).
For bonus points, you could query:
/sbin/dhcpinfo -v6 SNTPServers
... to get a list of IPv6 SNTP servers. There doesn't seem to be a
DHCPv6 option to get NTP servers (?). There's also a brand-new set of
options for timezone, but we don't support those yet, and I doubt that
NTP would be interested. ;-}
--
James Carlson, Solaris Networking <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
_______________________________________________
networking-discuss mailing list
[email protected]