Dietpi issue with Hotspot

Creating a bug report/issue

Required Information

- DietPi version | cat /boot/dietpi/.version
G_DIETPI_VERSION_CORE=8
G_DIETPI_VERSION_SUB=16
G_DIETPI_VERSION_RC=2
G_GITBRANCH=‘master’
G_GITOWNER=‘MichaIng’
G_LIVE_PATCH_STATUS[0]=‘not applicable’

- Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
bullseye 0

- Kernel version | uname -a
Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

- Architecture | dpkg --print-architecture
arm64

- SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
RPi 4 Model B (aarch64)

- Power supply used | (EG: 5V 1A RAVpower)
5V 1A

- SD card used | (EG: SanDisk ultra)
SanDisk Extreme 64Go

Additional Information (if applicable)

  • Software title | Hotspot
  • Was the software title installed freshly or updated/migrated? update
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
    d7d5e504-5697-40f1-a8d8-20a7d39a0e7f
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

**dietpi@DietPi:~$ cat /etc/network/interfaces**
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Ethernet
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.254
#dns-nameservers 9.9.9.9 192.168.0.100

# WiFi
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
#gateway 192.168.0.1
#dns-nameservers 9.9.9.9 149.112.112.112
pre-up iw dev wlan0 set power_save off
post-down iw dev "wlan0 set power_save on

# iptables NAT rules
up iptables-restore < /etc/iptables.ipv4.nat
up ip6tables-restore < /etc/iptables.ipv6.nat

**dietpi@DietPi:~$ cat /etc/default/isc-dhcp-server** 
INTERFACESv4="wlan0"

mai 06 08:37:38 DietPi dhcpd[3911]: No subnet declaration for wlan0 (no IPv4 addresses).
mai 06 08:37:38 DietPi dhcpd[3911]: ** Ignoring requests on wlan0.  If this is not what
mai 06 08:37:38 DietPi dhcpd[3911]:    you want, please write a subnet declaration
mai 06 08:37:38 DietPi dhcpd[3911]:    in your dhcpd.conf file for the network segment
mai 06 08:37:38 DietPi dhcpd[3911]:    to which interface wlan0 is attached. **
mai 06 08:37:38 DietPi dhcpd[3911]: 
mai 06 08:37:38 DietPi dhcpd[3911]: 
mai 06 08:37:38 DietPi dhcpd[3911]: Not configured to listen on any interfaces!
mai 06 08:37:38 DietPi dhcpd[3911]: 
mai 06 08:37:38 DietPi dhcpd[3911]: If you think you have received this message due to a bug rather
mai 06 08:37:38 DietPi dhcpd[3911]: than a configuration issue please read the section on submitting
mai 06 08:37:38 DietPi dhcpd[3911]: bugs on either our web page at www.isc.org or in the README file
mai 06 08:37:38 DietPi dhcpd[3911]: before submitting a bug.  These pages explain the proper
mai 06 08:37:38 DietPi dhcpd[3911]: process and the information we find helpful for debugging.
mai 06 08:37:38 DietPi dhcpd[3911]: 
mai 06 08:37:38 DietPi dhcpd[3911]: exiting.
mai 06 08:37:38 DietPi kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
mai 06 08:37:38 DietPi hostapd[3895]: wlan0: interface state UNINITIALIZED->ENABLED
mai 06 08:37:38 DietPi hostapd[3895]: wlan0: AP-ENABLED
mai 06 08:37:38 DietPi systemd[1]: Started Access point and authentication server for Wi-Fi and Ethernet.


**dietpi@DietPi:~$ ip a**
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:83:31:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.100/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::dea6:32ff:fe83:3128/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:83:31:2c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::dea6:32ff:fe83:312c/64 scope link 
       valid_lft forever preferred_lft forever


IP address on the wlan0 does not remain



**dietpi@DietPi:~$ sudo cat /etc/hostapd/hostapd.conf**
interface=wlan0
driver=nl80211
ssid=DietPi-HotSpot
hw_mode=g
channel=3
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=XXX
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ieee80211n=1
country_code=FR

Extra details

Hi, I use my raspberry pi as a wifi hotspot pihole.
everything worked fine until now. but since a few days following an update I think. the wifi hotpspot is no longer recognized

We had a similar report already :thinking:. Can you show the output of:

cat /etc/dhcp/dhcpd.conf
ifup wlan0
systemctl restart isc-dhcp-server
sleep 3
journalctl -u isc-dhcp-server

Thank MichaIng for your answer.

dietpi@DietPi:~$ cat /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

subnet 192.168.42.0 netmask 255.255.255.0 {
        range 192.168.42.10 192.168.42.50;
        option broadcast-address 192.168.42.255;
        option routers 192.168.42.1;
        option domain-name "local";
        option domain-name-servers 9.9.9.9, 149.112.112.112;
}

dietpi@DietPi:~$ ip a
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:83:31:2c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::dea6:32ff:fe83:312c/64 scope link 
       valid_lft forever preferred_lft forever
dietpi@DietPi:~$ sudo ifup wlan0
dietpi@DietPi:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:83:31:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.100/24 brd 192.168.0.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::dea6:32ff:fe83:3128/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:83:31:2c brd ff:ff:ff:ff:ff:ff
    inet 192.168.42.1/24 brd 192.168.42.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::dea6:32ff:fe83:312c/64 scope link 
       valid_lft forever preferred_lft forever
dietpi@DietPi:~$ 
dietpi@DietPi:~$ sudo systemctl restart isc-dhcp-server
dietpi@DietPi:~$ sleep 3
dietpi@DietPi:~$ sudo journalctl -u isc-dhcp-server
mai 07 17:12:51 DietPi systemd[1]: Starting LSB: DHCP server...
mai 07 17:12:51 DietPi isc-dhcp-server[42028]: Launching IPv4 server only.
mai 07 17:12:51 DietPi dhcpd[42037]: Internet Systems Consortium DHCP Server 4.4.1
mai 07 17:12:51 DietPi dhcpd[42037]: Copyright 2004-2018 Internet Systems Consortium.
mai 07 17:12:51 DietPi dhcpd[42037]: All rights reserved.
mai 07 17:12:51 DietPi dhcpd[42037]: For info, please visit https://www.isc.org/software/dhcp/
mai 07 17:12:51 DietPi dhcpd[42043]: Internet Systems Consortium DHCP Server 4.4.1
mai 07 17:12:51 DietPi dhcpd[42043]: Copyright 2004-2018 Internet Systems Consortium.
mai 07 17:12:51 DietPi dhcpd[42043]: All rights reserved.
mai 07 17:12:51 DietPi dhcpd[42043]: For info, please visit https://www.isc.org/software/dhcp/
mai 07 17:12:51 DietPi dhcpd[42043]: Wrote 1 leases to leases file.
mai 07 17:12:51 DietPi dhcpd[42043]: Server starting service.
mai 07 17:12:53 DietPi isc-dhcp-server[42028]: Starting ISC DHCPv4 server: dhcpd.
mai 07 17:12:53 DietPi systemd[1]: Started LSB: DHCP server.

thank MichaIng it works !

ok the WiFi interface was not up correctly. Does it survive a reboot?

Can you tell me, where the following wifi IP comes from, when dietpi config does its hotspot thing?

cat /etc/network/interfaces
...
# WiFi
...
address 192.168.42.1

192.168.42.0 is the network of my eth0 and 192.168.42.1 collides with the router on the wired network. How can I reconfigure the hotspot network in a dietpi save way?
I already tried to change /etc/dhcp/dhcpd.conf to use another network, but this only results in dhcpd[1675]: No subnet declaration for wlan0 (192.168.42.1). when doint systemctl restart isc-dhcp-server

/etc/network/interfaces is modifiable via dietpi-config7 : network options: Adapters

We use IP range 192.168.42.0 for the hotspot network. Means 192.168.42.1 is the WiFi Hotspot Access point interface address. You would need to manually adjust WiFi interface IP and hotspot + DHCP server configs.

Where would be the best place to set the network manually?
How would I override the entry in /etc/network/interfaces like stated in the same file?

Please modify network settings via: dietpi-config
Or create your own drop-ins in: /etc/network/interfaces.d/

When I copy paste the existing wifi entry to a new file in /etc/network/interfaces.d/mynetwork with a different address, it shows up as a second entry for wlan0 in ip address.

you should be able to adjust configuration directly inside /etc/network/interfaces

is this file save on reboots or on dietpi updates?
running dietpi-config7 : network options: AdaptersApply will for sure rewrite this file.
my nanoPi will run in a remote location with bad physical access to reconfigure network settings :wink:

Or is there a setting somewhere to define the hotspot network address to use?

The file is is not going to change until you reconfigure things.

1 Like