GNOME Bugzilla – Bug 761717
dnsmasq.d for shared connections
Last modified: 2016-04-12 14:08:53 UTC
it seems that there is no way the behavior of dnsmasq can be customized when used for shared connections. this would be required, for example, to set pxe parameters (the full use case is "my laptop is in the wifi, i want to setup another one. i link them up via ethernet, set up a tftp and http server independently of network-manager, and need to insert a line of config into the dnsmasq running on the ethernet interface to make the other laptop boot off mine"). there exist facilities for /etc/NetworkManager/dnsmasq.d/, which gets set as a dnsmasq config directory, but not in the described situation. (looking through other issues, it's most probably used in vpn setups). i'd like to suggest (and would implement if that's the way to go) that either the existing /etc/NetworkManager/dnsmasq.d/ directory or a newly to be introduced /etc/NetworkManager/dnsmasq-shared-connections.d/ be used for additional configuration for dnsmasq in analogy to what is already implemented in dns-manager/nm-dns-dnsmasq.c.
Adding a --conf-dir similar to /etc/NetworkManager/dnsmasq.d/ sounds good. But let's choose a distinct directory. Maybe /etc/NetworkManager/dnsmasq-shared.d/ ?
ok, i'm preparing and testing a patch to that effect.
Created attachment 320933 [details] [review] patch for including /etc/NetworkManager/dnsmasq-shared.d/ this patch applies the --conf-dir= discovery of src/dns-manager/nm-dns-dnsmasq.c to src/dnsmasq-manager/nm-dnsmasq-manager.c, and for example allows adding dhcp options required from booting via PXE.
Looks good to me. Did you actually test it that it works as expected? :)
i did, with a config file named `/etc/NetworkManager/dnsmasq-shared.d/xtux` that contains the lines `enable-tftp \ tftp-root=/tmp/lanbootserver/ \ dhcp-boot=/efi64/syslinux.efi` (abbreviated). if you want to reproduce the tests, i recommend you only use dhcp-boot, as dnsmasq refuses to start if it can't access its tftp-root (as expected, a dnsmasq error message then shows up in the nm logs). tbh i didn't test the behavior when no such directory is prsent; i now did, and it behaves as expected.
patch merged to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a94fb97763af3fe1ce7064687b9f96d0123d2d09 Thanks!!
Wow this fix just went in as I ran into the problem. Glad it's been taken care of already, with me now just having renamed my dnsmasq.d dir and waiting for debian to roll another nm update :)
*** Bug 731074 has been marked as a duplicate of this bug. ***