Restrict DHCP lease range using NetworkManager "Shared to other computers"

by patricktokeeffe   Last Updated October 09, 2019 18:02 PM

My computer has wireless internet access and I successfully share its connection using the built-in "Shared to other computers" feature of Network Manager:

enter image description here

However, I'm only serving a single host (via cross-over cable) and because DHCP is used, the IP address of my host is indeterminate. I can't save ssh or VNC connections because the route will change without warning.

  • Can I restrict the DHCP range of shared connections to a single address?

My downstream host is Untouchable - it's outside my scope to change its network configuration. What I need is more control over how Network Manager launches dnsmasq to support the internet connection sharing. It seems to do so entirely with command line parameters:

[email protected]:~$ ps ax | grep dnsmasq
  817 ?        S      0:00 /usr/sbin/dnsmasq --conf-file --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=10.42.0.1 --dhcp-range=10.42.0.10,10.42.0.254,60m --dhcp-option=option:router,10.42.0.1 --dhcp-lease-max=50 --pid-file=/var/run/nm-dnsmasq-enxb827eb017088.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared.d
 1013 ?        S      0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.1.1 --cache-size=0 --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
 6987 pts/2    S+     0:00 grep --color=auto dnsmasq


Related Questions


Updated April 30, 2017 00:02 AM

Updated October 24, 2017 11:02 AM

Updated April 04, 2018 23:02 PM

Updated November 25, 2016 08:00 AM

Updated September 29, 2018 16:02 PM