Re: network-scripts documentation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux