joaofl / hassio-addons

More add-ons for your Hass.io.
17 stars 22 forks source link

Ping request timeouts once hotspot is turned on #22

Open maivorbim opened 1 year ago

maivorbim commented 1 year ago

Hello, many thanks for the addon which works great, except for one issue.

As soon as I start the hotspot add-on, the host running HA stops responding to ping requests, which return Request Timed out. This in turn breaks the functionality of other integrations I have running in HA.

These are my configuration settings. Home assistant is running on an intel NUC with static IP 192.168.2.10. Home Assistant also acts as DHCP server via Adguard addon. The router is set to 192.168.2.1 and does not act as a DHCP server.

`ssid: NETGEAR wpa_passphrase: password channel: "1" address: 192.168.2.1 netmask: 255.255.255.0 broadcast: 192.168.2.254 interface: wlo2 internet_interface: eno1 allow_internet: true allow_mac_addresses:

This is the log:

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started Starting... Set nmcli managed no /run.sh: line 77: nmcli: command not found Network interface set to wlo2 Deleting iptables MASQUERADE all opt -- in out eno1 0.0.0.0/0 -> 0.0.0.0/0
ACCEPT all opt -- in eno1 out wlo2 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all opt -- in wlo2 out eno1 0.0.0.0/0 -> 0.0.0.0/0
Configuring iptables for NAT MASQUERADE all opt -- in
out eno1 0.0.0.0/0 -> 0.0.0.0/0
ACCEPT all opt -- in eno1 out wlo2 0.0.0.0/0 -> 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all opt -- in wlo2 out eno1 0.0.0.0/0 -> 0.0.0.0/0
Setup hostapd ... Setup interface ... Resseting interfaces ifdown: interface wlo2 not configured Setup udhcpd ... Starting DHCP server... udhcpd: started, v1.35.0 udhcpd: max_leases=100 is too big, setting to 1 udhcpd: can't open '/var/lib/udhcpd/udhcpd.leases': No such file or directory Starting HostAP daemon ... Interface stats: wlo2 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX
inet addr:192.168.2.1 Bcast:192.168.2.254 Mask:255.255.255.0 UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:1263 errors:0 dropped:0 overruns:0 frame:0 TX packets:3329 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:90528 (88.4 KiB) TX bytes:271265 (264.9 KiB) rfkill: Cannot open RFKILL control device wlo2: interface state UNINITIALIZED->HT_SCAN 20/40 MHz operation not permitted on channel pri=1 sec=5 based on overlapping BSSes Fallback to 20 MHz wlo2: interface state HT_SCAN->ENABLED wlo2: AP-ENABLED wlo2: STA XX:XX:XX:XX:XX IEEE 802.11: authenticated wlo2: STA XX:XX:XX:XX:XX IEEE 802.11: associated (aid 1) wlo2: AP-STA-CONNECTED XX:XX:XX:XX:XX wlo2: STA XX:XX:XX:XX:XX RADIUS: starting accounting session 12901CF343EF913F wlo2: STA XX:XX:XX:XX:XX WPA: pairwise key handshake completed (RSN) wlo2: EAPOL-4WAY-HS-COMPLETED XX:XX:XX:XX:XX udhcpd: sending OFFER to 192.168.2.2 udhcpd: sending OFFER to 192.168.2.2 udhcpd: sending ACK to 192.168.2.2

I am guessing it has to do something with firewall/iptables? It seems that once the addon is started HA is refusing to answer to ping requests.

joaofl commented 4 months ago

I just published an initial version of the "hotspot" using the linux-router tool I mentioned. Toggling the internet on/off works for me just fine.

Please have a try: https://github.com/joaofl/hassio-addons/tree/master/linux-router

Feedbacks are welcome.