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

Internet connection lost after starting hotspot in bridged mode #693

Closed mwelsch closed 4 years ago

mwelsch commented 4 years ago

Before submitting an issue Please read this first https://github.com/billz/raspap-webgui/wiki/Reporting-issues

Describe the bug A clear and concise description of what the bug is.

Your environment

Steps to reproduce Tell us how to reproduce this issue. Provide as much detailed information as possible.

I have following Hotspot settings:

Interface:
wlan0
Wireless Mode:
802.11n - 2.4 GHz
Channel:
1
Bridged AP mode:
Yes
Logfile output:
Yes (only activated after things started not working, output is not helpful)
Beacon interval:
100
Country Code:
Austria

Internet is provided over eth0, using 192.168.1.71 as static IP (configured by pivpn)

Expected behavior I expect raspap to start a hotsport with the given SSID and configured security settings, not managing DHCP/DNS or acting as NAT when pressing the Start Hotspot button in the WebUI. I do not expect the IP address of the raspberry to change when turning on Wifi

Actual behavior The connection to my raspberry breaks, because it gets a new ip address assigned. The MAC seems to change, so my Router (at 192.168.1.1) assigns a new ip to the raspberry.

Clients can connect to the raspberry, however they do not receive an ip address, nor do they have internet connection when setting the ip address manually. (Tested with my Windows 10 PC, Android 8 Tablet and Android 10 Smartphone)

Screenshots

image

image

image

billz commented 4 years ago

See this wiki page about Bridged AP mode limitations and VPN clients. Your Pi's IP is changing because your upstream router is the DHCP server. For this reason, the static IP assigned by PiVPN is ignored.

billz commented 4 years ago
$ uname -a
Linux raspberrypi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux

Bridged AP mode enabled, connected several clients, internet speed test nominal, no errors.

[303454.267184] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[303454.479006] br0: port 1(eth0) entered blocking state
[303454.479014] br0: port 1(eth0) entered disabled state
[303454.479220] device eth0 entered promiscuous mode
[303454.950611] rtl8192cu: MAC auto ON okay!
[303454.976768] rtl8192cu: Tx queue select: 0x05
[303455.596938] br0: port 2(wlan0) entered blocking state
[303455.596946] br0: port 2(wlan0) entered disabled state
[303455.597095] device wlan0 entered promiscuous mode
[303456.658500] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[303458.777502] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[303459.005124] br0: port 2(wlan0) entered blocking state
[303459.005136] br0: port 2(wlan0) entered forwarding state
[303459.005278] br0: port 1(eth0) entered blocking state
[303459.005296] br0: port 1(eth0) entered forwarding state
[303459.005617] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
[303464.167421] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready

@Dommel logs or other diagnostic info would be helpful.

billz commented 4 years ago

Above was a quick look at dmesg. syslog captures a bit more detail w/ other services, etc.

bringing br0 up:

Nov  7 07:45:11 raspberrypi dhcpcd[2208]: br0: waiting for carrier
Nov  7 07:45:11 raspberrypi dhcpcd[2208]: br0: carrier acquired
Nov  7 07:45:11 raspberrypi kernel: [303459.005124] br0: port 2(wlan0) entered blocking state
Nov  7 07:45:11 raspberrypi kernel: [303459.005136] br0: port 2(wlan0) entered forwarding state
Nov  7 07:45:11 raspberrypi kernel: [303459.005278] br0: port 1(eth0) entered blocking state
Nov  7 07:45:11 raspberrypi kernel: [303459.005296] br0: port 1(eth0) entered forwarding state
Nov  7 07:45:11 raspberrypi kernel: [303459.005617] IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
Nov  7 07:45:11 raspberrypi systemd-networkd[2175]: br0: Gained carrier
Nov  7 07:45:11 raspberrypi dhcpcd[2208]: br0: IAID 77:93:19:3f
Nov  7 07:45:11 raspberrypi dhcpcd[2208]: br0: adding address fe80::9956:1f48:48ce:7978
Nov  7 07:45:11 raspberrypi avahi-daemon[327]: Joining mDNS multicast group on interface br0.IPv6 with address fe80::9956:1f48:48ce:7978.
Nov  7 07:45:11 raspberrypi avahi-daemon[327]: New relevant interface br0.IPv6 for mDNS.
Nov  7 07:45:11 raspberrypi avahi-daemon[327]: Registering new address record for fe80::9956:1f48:48ce:7978 on br0.*.
Nov  7 07:45:11 raspberrypi dhcpcd[2208]: br0: soliciting a DHCP lease
Nov  7 07:45:11 raspberrypi dhcpcd[2208]: br0: offered 192.168.1.7 from 192.168.1.254
Nov  7 07:45:12 raspberrypi dhcpcd[2208]: br0: soliciting an IPv6 router
Nov  7 07:45:13 raspberrypi systemd-networkd[2175]: br0: Gained IPv6LL
Nov  7 07:45:13 raspberrypi systemd-timesyncd[283]: Network configuration changed, trying to establish connection.
Nov  7 07:45:13 raspberrypi dhcpcd[2208]: br0: Router Advertisement from fe80::224:d4ff:fea0:52e6
Nov  7 07:45:13 raspberrypi dhcpcd[2208]: br0: adding address 2a01:e34:ef85:fbf0:a2ef:78c7:72af:123d/64
Nov  7 07:45:13 raspberrypi avahi-daemon[327]: Leaving mDNS multicast group on interface br0.IPv6 with address fe80::9956:1f48:48ce:7978.
Nov  7 07:45:13 raspberrypi avahi-daemon[327]: Joining mDNS multicast group on interface br0.IPv6 with address 2a01:e34:ef85:fbf0:a2ef:78c7:72af:123d.
Nov  7 07:45:13 raspberrypi avahi-daemon[327]: Registering new address record for 2a01:e34:ef85:fbf0:a2ef:78c7:72af:123d on br0.*.
Nov  7 07:45:13 raspberrypi avahi-daemon[327]: Withdrawing address record for fe80::9956:1f48:48ce:7978 on br0.
Nov  7 07:45:13 raspberrypi dhcpcd[2208]: br0: adding route to 2a01:e34:ef85:fbf0::/64
Nov  7 07:45:13 raspberrypi dhcpcd[2208]: br0: fe80::224:d4ff:fea0:52e6 is reachable again
Nov  7 07:45:13 raspberrypi dhcpcd[2208]: br0: adding default route via fe80::224:d4ff:fea0:52e6
Nov  7 07:45:13 raspberrypi dhcpcd[2208]: br0: probing address 192.168.1.7/24

and connecting a client (iPhone) to the bridged AP on wlan0:

Nov  7 07:49:36 raspberrypi dnsmasq-dhcp[2919]: DHCPDISCOVER(wlan0) c6:▒▒▒▒▒▒▒▒▒▒▒▒▒
Nov  7 07:49:36 raspberrypi dnsmasq-dhcp[2919]: DHCPOFFER(wlan0) 192.168.0.163 c6:▒▒▒▒▒▒▒▒▒▒▒▒▒
Nov  7 07:49:37 raspberrypi dnsmasq-dhcp[2919]: DHCPREQUEST(wlan0) 192.168.0.163 c6:▒▒▒▒▒▒▒▒▒▒▒▒▒ 
Nov  7 07:49:37 raspberrypi dnsmasq-dhcp[2919]: DHCPACK(wlan0) 192.168.0.163 c6:▒▒▒▒▒▒▒▒▒▒▒▒▒ iPhone
billz commented 4 years ago

Log data can be very helpful in context, within reasonable limits.

@Dommel this is making my eyes melt. I'm unable to repro with the default config. have you modified the default settings? if the answer is 'no', read this and create a new issue, filling out the provided template completely.

Dommel commented 4 years ago

Log data can be very helpful in context, within reasonable limits.

@Dommel this is making my eyes melt. I'm unable to repro with the default config. have you modified the default settings? if the answer is 'no', read this and create a new issue, filling out the provided template completely.

I realy have no Idea which logfile and in which format I should provide to you, but just in case that someone will run into the same issue, running the script /var/www/html/installers/toggle-bridged-routed.sh fixed the issue after reboot