Reindl Harald writes:
Am 27.01.2013 19:36, schrieb Sam Varshavchik:> Google isn't helping me find the documentation for /etc/sysconfig/network- scripts/* in F18. It brings me to F14's > "Deployment Guide", and browsing TOCs for the F18 documentation doesn't find anything promising.>> My old router, that was running DD-WRT firmware, bit the dust. The stock brand router that replaced it doesn't have > the ability to send NTP for clients via DHCP. I'm trying to figure out if I had drop something into > /etc/sysconfig/network-scripts/ifcfg-*, that'll have the effect of doing that.if you are using ntpd and not chrony:
Yes, I am, but I was not asking how to configure ntp.conf, but how to have dhclient do it for me, with a fake DHCP-provided NTP configuration – similar how to specifying DOMAIN in ifcfg-* sets the domain in /etc/resolv.conf, when the network domain does not come from DHCP.
That is, I have an ntp server on my LAN, but the cheap-ass router does not have the option to set the ntp_servers DHCP options, so that the dhclient can do it automatically. Manually setting it in /etc/ntp.conf means that it stays there when the client roams on another network. That's not fatal, nothing bad will probably happen, but it's still wrong.
After hacking at it, I finally figured out how to do it, it's not directly supported in ifcfg*, and, of course, none of this appears to be documented anywhere, but it is doable. For the benefit of anyone looking to do the same thing, add the following to /etc/sysconfig/network-scripts/ifcfg-wlan0, or create one if it doesn't exist, with the following:
[ -f /etc/sysconfig/network-scripts/"dhcp-${CONNECTION_ID// /_}" ] && \ . /etc/sysconfig/network-scripts/"dhcp-${CONNECTION_ID// /_}" ]Then, create a "dhcp-<NAME>", where <NAME> is the same as the ifcfg-<NAME> for your network, with the following contents:
new_ntp_servers=timehost.example.com Or, whatever your LAN NTP server is.This will be sufficient to harass dhclient into doing this automatically, when I'm on my LAN.
Fairly certain that this will also work with chrony, and it'll unlikely to get clobbered by minor updates, at least until NetworkManager/sysconfig changes drastically.
In case of wired LANs, new_ntp_servers can probably be dropped straight into ifcfg-eth0, but that'll won't work very well when connected to another network, so the right way to do it is by configuring dhcpd, which, unlike the case of a dumb wireless router, is quite doable.
Attachment:
pgpid5jDnyKS9.pgp
Description: PGP signature
-- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org