Page 1 of 1

change access point dhcp range

Posted: 2020/12/29 01:15:40
by vtwin@cox.net
I have added an access point to one of my centos boxes:

nmcli con add type wifi ifname wlp1s0 mode ap con-name wlp1s0 802-11-wireless.ssid MyAPSSID
nmcli con modify wlp1s0 802-11-wireless.band bg connection.autoconnect yes 802-11-wireless-security.key-mgmt wpa-psk
nmcli con modify wlp1s0 802-11-wireless-security.psk MYAPKEY ipv4.addr 192.168.1.0/17 ipv4.method shared
nmcli con up wlp1s0


bringing this interface up launches a dnsmasq session with these parameters:

/usr/sbin/dnsmasq --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --strict-order --listen-address=192.168.1.0 --dhcp-range=192.168.1.10,192.168.1.254,60m --dhcp-lease-max=50 --dhcp-leasefile=/var/lib/NetworkManager/dnsmasq-wlp1s0.leases --pid-file=/run/nm-dnsmasq-wlp1s0.pid --conf-dir=/etc/NetworkManager/dnsmasq-shared.d


Can someone tell me how to change the default IP address range used (e.g. where are these command-line options coming from so I can change the --dhcp-range option) ?

Or, better yet, since I already have a DHCP server on my network, is there a way to simply have the access point obtain its IP addresses for clients from that DHCP server?

Re: change access point dhcp range

Posted: 2020/12/29 12:12:31
by lightman47
My linksys/ciscp routers are in bridged mode and obtain their addresses from my DHCP server.

Re: change access point dhcp range

Posted: 2020/12/31 14:45:44
by vtwin@cox.net
thats good to know but really doesn't answer my question.

Re: change access point dhcp range

Posted: 2020/12/31 15:53:59
by jlehtone
There should be directly editable file in /etc/NetworkManager/system-connections/
Alas, there probably isn't a value that we desire any more than as nmcli option.

The --dhcp-range CLI option for dnsmasq overrides what you could add in file in
/etc/NetworkManager/dnsmasq-shared.d/

I'd say: start the connection without dnsmasq (ipv4.method manual ?)
Then run a separate DHCP (dnsmasq) that you have more control over.

Re: change access point dhcp range

Posted: 2020/12/31 20:25:51
by vtwin@cox.net
jlehtone wrote:
2020/12/31 15:53:59
There should be directly editable file in /etc/NetworkManager/system-connections/
Alas, there probably isn't a value that we desire any more than as nmcli option.
Sadly, there isn't a file anywhere in the /etc/NetworkManager structure which appears to contain this DHCP range or DNSMASQ setup (there's no files whatsoever in the directory you mentioned, which is the 1st place I looked).

I've also looked in /usr/lib/NetworkManager and /var/[lib|run]/NetworkManager
The --dhcp-range CLI option for dnsmasq overrides what you could add in file in
/etc/NetworkManager/dnsmasq-shared.d/
unfortunately I cannot find a file anywhere which sets the options for the dnsmasq session launched by NetworkManager for the wifi access point.

I'd say: start the connection without dnsmasq (ipv4.method manual ?)
Then run a separate DHCP (dnsmasq) that you have more control over.
Not sure this is possible. the connection type is shared as an access point. if I mark it as manual and specify an ip address it doesn't seem tow work.