Change subnet of the AutoPi Hotspot

Hi all,
I have been trying to change the subnet of the AutoPi’s own Hotspot, but without success. I would like to change the subnet from to something like The files that appear to be relevant to me are the /etc/dnsmasq.conf, /etc/dnsmasq.hosts and /etc/dhcpcd.conf. The changes I have tried so far in these config files are:

dhcp-range=,,,24h → dhcp-range=,,,24h
On line 18

dnsmasq.hosts: →

static ip_address= → static ip_address=
on line 63

When restarting the dongle I can log onto the hotspot, but can’t communicate with the AutoPi.
This is probably related to me not configuring dnsmasq in a correct way but I don’t understand how. The behavior expected is that the subnet for the uap0 interface is allocated to a new IP-space and that my connecting computer will be given a new IP-address for this subnet.

I know dnsmasq.conf is changed by the SaltStack. This might be the issue? How does one manipulate files in /etc by the use of SaltStack?

I’m using a Gen 2 AutoPi with software version: f0446804 with 4G/LTE capabilities, running AutoPi-core.

Update: When restarting the dnsmasq.service and dhcpcd.service the AutoPi gets the IP-address for the uap0 interface, as well as the address. When connecting with my computer to the AutoPi I get served an IP in the correct IP-address space. But in my routing table there is no defualt gateway. When I try to add or as default gateway it doesn’t work.

Routing table from computer connecting to AutoPi:
~ sudo route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway UG 20600 0 0 wlp6s0 U 600 0 0 wlp6s0
~ sudo route add -host default gw
~ sudo route add -host default gw
SIOCADDRT: Network is unreachable
~ sudo route  7
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface _gateway UGH 0 0 0 wlp6s0
default _gateway UG 20600 0 0 wlp6s0 U 600 0 0 wlp6s0

Update 2:
Unlike the route command ip route show (from iputils2) does show a functioning route, with the correct subnet.

When checking the systemd logs of a boot with the new subnet configured, no errors could be detected. From what I could see in the logs dnsmasq and dhcpcd was functioning and acting properly with the new subnet. But I still can’t SSH or access the web interface for the AutoPi when changing the subnet of uap0.

Hey @sandorstorm!

Have you checked out our new DHCP settings in You can check the documentation for them here.

Best regards


Hi @Nikola,
I have checked these settings and tried them without success. But it makes sense that it wouldn’t work just changing these settings at

As far as I’ve understood these settings change the behavior of the default DHCP-server, dnsmasq for AutoPi-core. The DHCP range setting corresponds to range setting in /etc/dnsmasq.conf and the DNS hosts setting corresponds to the /etc/dnsmasq.hosts.

While these settings will definitely change the subnet provided on the uap0 network interface they won’t change the statically set IP-address for the uap0 interface. From what I can see this IP ( is set in the dhcpcd config file in /etc/dhcpcd.conf. If this isn’t changed to be within the subnet which is provided by dnsmasq it would mean that when connecting to the uap0 WiFi-hotspot the clients would have a default gateway on a different subnet than provided by DHCP-server. That doesn’t work.

Have I understood how the AutoPi-core works correctly? Or does the settings you mentioned automatically change the statically assigned IP-address for uap0 to a correct one?

Best regards,

Hi @sandorstorm

Unfortunately the static ip_address= in dhcpcd.conf is not configurable from at the moment. You can modify it manually but be aware that changes will be reverted during next update of release.


I see. But even when configuring everything manually the change of subnet doesn’t work.
I’m not able to SSH into the AutoPi or access over WiFi.

There is also no indication of errors for dnsmasq or dhcpcd when checking the systemd logs so I’m really stumped what to do?

Best regards,

This may be a red herring, but I took a look through the UI code a while back to see if I could work out how it functioned. I noted at least one occasion (in mainxxxxx.js) where the IP address is hard-coded. On that basis, changing the subnet definition for uap0 is going to break things.

Ah, that explains some things. It would make sense that I would be served a correct IP-address in the subnet when connecting to the hotspot. But not be able to connect to the AutoPi because the software needs a ceartain IP-address set on uap0.

Hmm, maybe I could search through the git-repo of AutoPi-core to find all the instances of hardcoded IP-addresses.

Thank you so much!

Where is mainxxxxx.js located?

mainxxxx.js can be found in the root web directory: /var/www/html

The UI is in a different, private, repo on gitlab. the js is obfuscated.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.