RaspAP / raspap-webgui

Simple wireless AP setup & management for Debian-based devices
https://raspap.com/
GNU General Public License v3.0
4.47k stars 791 forks source link

Invalid default DHCP configuration for wlan0 interface #1514

Closed esackowitz closed 9 months ago

esackowitz commented 9 months ago

Code of Conduct

Issue reporting checklist

Operating System

Raspberry Pi OS (32-bit) Lite Bookworm

Quick install or Manual setup?

Quick install

Onboard wireless chipset or external adapter?

Onboard wireless chipset

Hardware

Raspberry Pi 4 Model B

RaspAP version

3.0 (Latest)

Other software or services running with RaspAP?

No other software

Contact details (optional)

eric@secureco.com

Bug description

After a clean install of the O/S using Raspberry Pi Imager

Screenshot 2024-02-07 at 6 01 54 PM

then performing all needed updates and following the automated install of RASPAP

Screenshot 2024-02-07 at 6 03 27 PM

Out of the box the default DHCP Server setup on Wlan0 is missing network start and end IP ranges along with lease time and interval. This is an invalid configuration.

image

Any attempt to save as is will fail with error as expected

image

Any attempt at manually entering in the default ranges starting with 10.3.141.50 to 10.3.141.254 and the 12hr lease interval will allow you to save the settings and will confirm as valid, however, those settings do not get applied and the screen will revert to the original invalid config.

Steps to reproduce

  1. Install clean O/S using raspberry Pi imager on SD card (this was done on a MACBook Pro)
  2. Boot Raspberry Pi with that image
  3. Ethernet cable is plugged direct into switch
  4. SSH in and Apply all updates and reboot: sudo apt-get update sudo apt-get full-upgrade sudo reboot
  5. SSH in and Install RaspAP latest release: curl -sL https://install.raspap.com | bash
  6. Open RaspAP console
  7. Observe health and operation
  8. In Hotspot advanced tab - select US for country code
  9. Head over to DHCP server settings
  10. Verify Static IP
  11. Look at DHCP options and note that starting address is set to 1 and the rest of the fields are blank except for DNS server 1 and 2 which are set to 9.9.9.9 and 1.1.1.1 respectively
  12. Select save Settings
  13. You will get errors
  14. Try to enter in the correct Starting and Ending address ranges manually along with metric (10.3.141.50 to 10.3.141.254 and the 12hr lease interval ) image
  15. Save Settings
  16. You will get confirmation that the settings are applied and valid image
  17. The screen reverts to original bad values
  18. Any attempt to connect to hotspot and the device will properly authenticate on SSID but will timeout since no IP address is returned.

Screenshots

No response

Additional context

This raspberry Pi was previously running with RaspAP v2.6.5 on earlier build of O/S Linux 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux and was fully operational as hotspot.

This has been reproduced on 3 other identical raspberry Pi 4's with same issue.

We attempted to downgrade to Version 3.0.2 on same O/S and problem persists. It is specifically something to do with this version of Raspberian,

Relevant log output

Debug log:
Debug log generation started at Wed Feb  7 23:19:39 GMT 2024

System Info
===========
Hardware: Raspberry Pi 4 Model B Rev 1.4
Detected OS: Raspbian GNU/Linux 12 (bookworm) 32-bit
Kernel: Linux secureco2f727eda 6.1.0-rpi8-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux
System Uptime: 0 days, 23 hours, 30 minutes
Memory Usage: 2.89336%

Installed Packages
==================
PHP Version: 8.2.7 (cli) (built: Jul 20 2023 18:02:54) (NTS)
Dnsmasq Version: 2.89
dhcpcd Version: 9.4.1
lighttpd Version: 1.4.69
vnStat Version: 2.10

RaspAP Install
==============
RaspAP Version: 3.0.7
RaspAP Installation Directory: /var/www/html
RaspAP hostapd.ini contents:
WifiInterface = wlan0
LogEnable = 0
WifiAPEnable = 0
BridgedEnable = 0
WifiManaged = wlan0
RaspAP provider.ini: Not present

USB Devices
===========
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

WPA Supplicant
==============
Selected interface 'wlan0'
wpa_state=DISCONNECTED
p2p_device_address=e6:5f:01:09:a2:f8
address=e4:5f:01:09:a2:f8
uuid=f5279195-9d5c-5106-9c41-051c0f6fa5ec

Dnsmasq Contents
================
/etc/dnsmasq.d/090_raspap.conf
/etc/dnsmasq.d/090_wlan0.conf

/etc/dnsmasq.d/090_raspap.conf contents:
# RaspAP default config
log-facility=/var/log/dnsmasq.log
conf-dir=/etc/dnsmasq.d$

/etc/dnsmasq.d/090_wlan0.conf contents:
# RaspAP wlan0 configuration
interface=wlan0
domain-needed
dhcp-range=10.3.141.50,10.3.141.254,255.255.255.0,12h$

Dhcpcd Contents
===============
# RaspAP default configuration
hostname
clientid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname

# RaspAP wlan0 configuration
interface wlan0
static ip_address=10.3.141.1/24
static routers=10.3.141.1
static domain_name_server=9.9.9.9 1.1.1.1

Interfaces
==========
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 noprefixroute
       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 e4:5f:01:09:a2:f6 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.40/24 brd 10.0.0.255 scope global dynamic noprefixroute eth0
       valid_lft 44996sec preferred_lft 44996sec
    inet6 fd69:d487:310:8c42:c31a:f23c:76d9:5c38/64 scope global dynamic noprefixroute
       valid_lft 1628sec preferred_lft 1628sec
    inet6 fe80::9371:5adf:13dd:54e0/64 scope link noprefixroute
       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 e4:5f:01:09:a2:f8 brd ff:ff:ff:ff:ff:ff

Routing Table
=============
default via 10.0.0.1 dev eth0 proto dhcp src 10.0.0.40 metric 100
10.0.0.0/24 dev eth0 proto kernel scope link src 10.0.0.40 metric 100

IW Device Info
==============
phy#0
    Unnamed/non-netdev interface
        wdev 0x2
        addr e6:5f:01:09:a2:f8
        type P2P-device
        txpower 31.00 dBm
    Interface wlan0
        ifindex 3
        wdev 0x1
        addr e4:5f:01:09:a2:f8
        ssid raspi-webgui
        type AP
        channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
        txpower 31.00 dBm

IW Regulatory Info
==================
global
country US: DFS-FCC
    (902 - 904 @ 2), (N/A, 30), (N/A)
    (904 - 920 @ 16), (N/A, 30), (N/A)
    (920 - 928 @ 8), (N/A, 30), (N/A)
    (2400 - 2472 @ 40), (N/A, 30), (N/A)
    (5150 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW
    (5250 - 5350 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW
    (5470 - 5730 @ 160), (N/A, 24), (0 ms), DFS
    (5730 - 5850 @ 80), (N/A, 30), (N/A), AUTO-BW
    (5850 - 5895 @ 40), (N/A, 27), (N/A), NO-OUTDOOR, AUTO-BW, PASSIVE-SCAN
    (5925 - 7125 @ 320), (N/A, 12), (N/A), NO-OUTDOOR, PASSIVE-SCAN
    (57240 - 71000 @ 2160), (N/A, 40), (N/A)

phy#0
country 99: DFS-UNSET
    (2402 - 2482 @ 40), (6, 20), (N/A)
    (2474 - 2494 @ 20), (6, 20), (N/A)
    (5140 - 5360 @ 160), (6, 20), (N/A)
    (5460 - 5860 @ 160), (6, 20), (N/A)

Systemd Services
================
hostapd status:
● hostapd.service - Access point and authentication server for Wi-Fi and Ethernet
     Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-02-07 23:19:00 GMT; 38s ago
       Docs: man:hostapd(8)
    Process: 15915 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
   Main PID: 15916 (hostapd)
      Tasks: 1 (limit: 4915)
        CPU: 29ms
     CGroup: /system.slice/hostapd.service
             └─15916 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

Feb 07 23:19:00 secureco2f727eda systemd[1]: Starting hostapd.service - Access point and authentication server for Wi-Fi and Ethernet...
Feb 07 23:19:00 secureco2f727eda hostapd[15915]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Feb 07 23:19:00 secureco2f727eda hostapd[15915]: wlan0: interface state COUNTRY_UPDATE->ENABLED
Feb 07 23:19:00 secureco2f727eda hostapd[15915]: wlan0: AP-ENABLED
Feb 07 23:19:00 secureco2f727eda systemd[1]: Started hostapd.service - Access point and authentication server for Wi-Fi and Ethernet.

dnsmasq status:
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-02-07 23:19:05 GMT; 34s ago
    Process: 15931 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS)
    Process: 15938 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
    Process: 15946 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
   Main PID: 15945 (dnsmasq)
      Tasks: 1 (limit: 4915)
        CPU: 107ms
     CGroup: /system.slice/dnsmasq.service
             └─15945 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-service --trust-anchor=.,20326,8,2,e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d

Feb 07 23:19:04 secureco2f727eda systemd[1]: Starting dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server...
Feb 07 23:19:05 secureco2f727eda systemd[1]: Started dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server.

dhcpcd status:
● dhcpcd.service - DHCP Client Daemon
     Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled; preset: enabled)
     Active: deactivating (stop-sigterm) (Result: signal) since Wed 2024-02-07 23:19:02 GMT; 36s ago
       Docs: man:dhcpcd(8)
    Process: 15919 ExecStart=/usr/sbin/dhcpcd -b -q (code=exited, status=0/SUCCESS)
   Main PID: 15921 (code=killed, signal=SYS)
      Tasks: 2 (limit: 4915)
        CPU: 31ms
     CGroup: /system.slice/dhcpcd.service
             ├─15922 "dhcpcd: [privileged proxy]"
             └─15923 "dhcpcd: [network proxy]"

Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: dev: loaded udev
Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: DUID 00:01:00:01:2d:55:27:90:e4:5f:01:09:a2:f8
Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: dhcp_vendor: No such process
Feb 07 23:19:02 secureco2f727eda dhcpcd[15919]: dhcp_vendor: No such process
Feb 07 23:19:02 secureco2f727eda systemd[1]: Started dhcpcd.service - DHCP Client Daemon.
Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: wlan0: connected to Access Point:
Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: eth0: IAID 01:09:a2:f6
Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: ps_ctl_listen: read: Success
Feb 07 23:19:02 secureco2f727eda dhcpcd[15922]: ps_ctl_recv: read: Success
Feb 07 23:19:02 secureco2f727eda systemd[1]: dhcpcd.service: Main process exited, code=killed, status=31/SYS

systemd-networkd status:
○ systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; preset: enabled)
     Active: inactive (dead)
TriggeredBy: ○ systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
             man:org.freedesktop.network1(5)

wg-quick@wg0 status:

openvpn-client@client status:

lighttpd status:
● lighttpd.service - Lighttpd Daemon
     Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-02-06 23:49:20 GMT; 23h ago
   Main PID: 842 (lighttpd)
      Tasks: 11 (limit: 4915)
        CPU: 12.005s
     CGroup: /system.slice/lighttpd.service
             ├─  842 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
             ├─  862 /usr/bin/php-cgi
             ├─  863 /usr/bin/php-cgi
             ├─  864 /usr/bin/php-cgi
             ├─  865 /usr/bin/php-cgi
             ├─  866 /usr/bin/php-cgi
             ├─16170 sh -c "sudo /etc/raspap/system/debuglog.sh -i /var/www/html"
             ├─16171 sudo /etc/raspap/system/debuglog.sh -i /var/www/html
             ├─16172 /bin/bash /etc/raspap/system/debuglog.sh -i /var/www/html
             ├─16295 /bin/bash /etc/raspap/system/debuglog.sh -i /var/www/html
             └─16296 systemctl status lighttpd

Feb 07 23:19:17 secureco2f727eda sudo[16037]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=33)
Feb 07 23:19:17 secureco2f727eda lighttpd[16038]: /bin/chmod: cannot access '/tmp/hostapd.log': No such file or directory
Feb 07 23:19:17 secureco2f727eda sudo[16037]: pam_unix(sudo:session): session closed for user root
Feb 07 23:19:25 secureco2f727eda sudo[16098]: www-data : PWD=/var/www/html ; USER=root ; COMMAND=/bin/chmod o+r /var/log/dnsmasq.log
Feb 07 23:19:25 secureco2f727eda sudo[16098]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=33)
Feb 07 23:19:25 secureco2f727eda sudo[16098]: pam_unix(sudo:session): session closed for user root
Feb 07 23:19:39 secureco2f727eda sudo[16171]: www-data : PWD=/var/www/html/ajax/system ; USER=root ; COMMAND=/etc/raspap/system/debuglog.sh -i /var/www/html
Feb 07 23:19:39 secureco2f727eda sudo[16171]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=33)
Feb 07 23:19:39 secureco2f727eda lighttpd[16292]: Unit wg-quick@wg0.service could not be found.
Feb 07 23:19:39 secureco2f727eda lighttpd[16294]: Unit openvpn-client@client.service could not be found.
billz commented 9 months ago

@esackowitz thanks for the very complete and accurate bug report. As a gesture of gratitude, I'd like to offer you Insiders access for your time.

esackowitz commented 9 months ago

@esackowitz thanks for the very complete and accurate bug report. As a gesture of gratitude, I'd like to offer you Insiders access for your time.

You're very welcome. Thank you for the quick turn. Happy to join the insiders.

esackowitz commented 9 months ago

I would be remiss to report that the fix worked in saving the DHCP values, however, DNSMasq wont start. image. Uninstall and reinstall does not solve issue. Still need to confirm on other Pi's. Happy to fill out another issue if you prefer.

billz commented 9 months ago

Please generate a debug log and perform a self-diagnosis before creating a new issue, thanks.