Hi,
i have a working magic mirror using docker on a raspberry pi 3B. It flawlessly works as long as i am in my home network.
This is about to be a present, so my overall goal is to be able to dynamically host an access Point in case no known AP are in range. This way i can have my friend to still access the mirror and configure it without having me come around and trying to fix the network issue he has, when changing his SSID or WPA-Key
When i try to activate hotspot using dietpi-config i get the following result
sudo dietpi-config
[ OK ] DietPi-Config | systemctl start hostapd
[ OK ] DietPi-Config | Desired setting in /boot/dietpi.txt was already set: SOFTWARE_WIFI_HOTSPOT_SSID=magic-mirror
[ OK ] DietPi-Config | Desired setting in /boot/dietpi.txt was already set: SOFTWARE_WIFI_HOTSPOT_CHANNEL=9
[ OK ] DietPi-Config | Desired setting in /boot/dietpi.txt was already set: SOFTWARE_WIFI_HOTSPOT_KEY=SECRET_PHRASE
[ OK ] DietPi-Config | Desired setting in /etc/hostapd/hostapd.conf was already set: ssid=magic-mirror
[ OK ] DietPi-Config | Desired setting in /etc/hostapd/hostapd.conf was already set: channel=9
[ OK ] DietPi-Config | Desired setting in /etc/hostapd/hostapd.conf was already set: wpa_passphrase=SECRET_PHRASE
[ OK ] DietPi-WiFiDB | mkdir -p /etc/wpa_supplicant
[ OK ] DietPi-WiFiDB | eval > /var/lib/dietpi/dietpi-wifi.db
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 0 with SSID "CLEARNET"
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 1 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 2 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 3 with SSID ""
[ INFO ] DietPi-WiFiDB | Applied WiFi DB slot 4 with SSID ""
[ OK ] DietPi-WiFiDB | chown root:root /var/lib/dietpi/dietpi-wifi.db /etc/wpa_supplicant/wpa_supplicant.conf
[ OK ] DietPi-WiFiDB | chmod 600 /var/lib/dietpi/dietpi-wifi.db /etc/wpa_supplicant/wpa_supplicant.conf
[ OK ] DietPi-Config | systemctl stop isc-dhcp-server
[ SUB1 ] DietPi-Set_hardware > wifimodules (enable)
[ INFO ] DietPi-Set_hardware | Please wait, enabling WiFi modules...
[ INFO ] DietPi-Set_hardware | Checking for required APT packages: iw wireless-tools wpasupplicant wireless-regdb
[ OK ] wifimodules enable | Completed
[ INFO ] DietPi-Config | Dropping network connections, please wait...
[ INFO ] DietPi-Config | Restarting network connections, please wait...
[ OK ] DietPi-Config | systemctl daemon-reload
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/b8:27:eb:23:f0:44
Sending on LPF/eth0/b8:27:eb:23:f0:44
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPOFFER of 192.168.1.169 from 192.168.1.1
DHCPREQUEST for 192.168.1.169 on eth0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.169 from 192.168.1.1
bound to 192.168.1.169 -- renewal in 18890 seconds.
[ OK ] DietPi-Config | systemctl start isc-dhcp-server
[ INFO ] DietPi-Config | Reloading networking data, please wait...
[ OK ] DietPi-Config | Network restarted
What’s weird on this, is that the subnet is not what i configured. (should be .42.0/27
subnet not .1.0/27
subnet)
Correct me if i am wrong:
My generali assumption on DHCP
- each subnet can have 0, 1 dhcp servers.
- having multiple dhcp servers will conflict (
authorative
config)
So i guess it is possible to have my actual network (this one useseth0
for simplicity reasons, as i don’t want to lose network connections all the time i am messing around with that config) usingsubnet 192.168.1.0/27
and host a Hotspot usingsubnet 192.168.1.0/27
The hotspot is not hosted though.
All my services seems to be running:
console-setup.service loaded active exited Set console font and keymap
containerd.service loaded active running containerd container runtime
cron.service loaded active running Regular background program processing daemon
dbus.service loaded active running D-Bus System Message Bus
dietpi-postboot.service loaded active exited DietPi-PostBoot
dietpi-preboot.service loaded active exited DietPi-PreBoot
dietpi-ramlog.service loaded active exited DietPi-RAMlog
docker.service loaded active running Docker Application Container Engine
fake-hwclock.service loaded active exited Restore / save the current clock
getty@tty1.service loaded active running Getty on tty1
ifup@eth0.service loaded active exited ifup for eth0
ifup@wlan0.service loaded active exited ifup for wlan0
ifupdown-pre.service loaded active exited Helper to synchronize boot up for ifupdown
isc-dhcp-server.service loaded active running LSB: DHCP server
keyboard-setup.service loaded active exited Set the console keyboard layout
kmod-static-nodes.service loaded active exited Create list of static device nodes for the current kernel
networking.service loaded active exited Raise network interfaces
rngd.service loaded active running Start entropy gathering daemon (rngd)
ssh.service loaded active running OpenBSD Secure Shell server
systemd-fsck-root.service loaded active exited File System Check on Root Device
systemd-fsck@dev-disk-by\x2dpartuuid-2a5aca42\x2d01.service loaded active exited File System Check on /dev/disk/by-partuuid/2a5aca42-01
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running User Login Management
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-sysusers.service loaded active exited Create System Users
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited Coldplug All udev Devices
systemd-udevd.service loaded active running Rule-based Manager for Device Events and Files
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
unattended-upgrades.service loaded active running Unattended Upgrades Shutdown
user-runtime-dir@1000.service loaded active exited User Runtime Directory /run/user/1000
user@1000.service loaded active running User Manager for UID 1000
$ 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 dhcp
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
#dns-nameservers 192.168.1.1
# WiFi
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.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
Not sure if this one conflicts with /etc/network/interfaces
$ cat /etc/network/interfaces.d/wlan0
iface wlan0 inet static
address 192.168.42.99
network 192.168.42.0
netmask 255.255.255.0
broadcast 192.168.42.255
wpa-ssid "magic-mirror"
wpa-psk "SECRET_PHRASE"
wpa-group TKIP CCMP
wpa-key-mgmt WPA-PSK
$cat /etc/dhcp/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
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;
}
Any help appreciated