home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.02k stars 29.67k forks source link

HA cant reach some hosts via Wifi #66969

Closed Smo-RBR closed 2 years ago

Smo-RBR commented 2 years ago

The problem

I got a strange network behavoiur. I can ping 10.0.0.3 and other hosts in this 10./8 but not 10.0.0.2 or 10.0.0.19. These hosts are reachable from any other computer in my network. .2 is a AVM Repeater, .19 is a ESP8266 with some sensors. Yesterday, as i startet all worked perfect, but must have been stopped to work overnight. Restartet HA, does not help. Hard repowering the PI does also not help. Restoring my backup from yesterday as it worked: does not help.

From HA UI it says wifi goes via wlan0:

Network
Configure which network adapters integrations will use. Currently this setting only affects multicast traffic. A restart is required for these settings to apply.
Auto Configure
Detected: wlan0 (10.0.0.8/8, 2003:ef:714:bc00:5d02:8b0e:2838:b318/64, fe80::d320:88:b94e:8628/64)

Ifconfig doesnt list wlan0:

[core-ssh ~]$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 02:42:AC:1E:21:01  
          inet addr:172.30.33.1  Bcast:172.30.33.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1680 errors:0 dropped:0 overruns:0 frame:0
          TX packets:762 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:290050 (283.2 KiB)  TX bytes:523214 (510.9 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Anyway, the rasp has net:

[core-ssh ~]$ ping google.com
PING google.com (142.250.186.110): 56 data bytes
64 bytes from 142.250.186.110: seq=0 ttl=118 time=20.238 ms
64 bytes from 142.250.186.110: seq=1 ttl=118 time=22.003 ms
^C
--- google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 20.238/21.120/22.003 ms
[core-ssh ~]$ 

But reaching some hosts fail, some work:

[core-ssh ~]$ ping 10.0.0.2
PING 10.0.0.2 (10.0.0.2): 56 data bytes
^C
--- 10.0.0.2 ping statistics ---
17 packets transmitted, 0 packets received, 100% packet loss
[core-ssh ~]$ ping 10.0.0.3
PING 10.0.0.3 (10.0.0.3): 56 data bytes
64 bytes from 10.0.0.3: seq=0 ttl=63 time=8.505 ms
64 bytes from 10.0.0.3: seq=1 ttl=63 time=7.289 ms
^C
--- 10.0.0.3 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 7.289/7.897/8.505 ms
[core-ssh ~]$ ping 10.0.0.19
PING 10.0.0.19 (10.0.0.19): 56 data bytes
^C
--- 10.0.0.19 ping statistics ---
8 packets transmitted, 0 packets received, 100% packet loss
[core-ssh ~]$ 

These hosts are definitely up. i can ping them from another hosts an reach their GUI also vie browser:

smo@endeavour ~ # ping 10.0.0.2                                                                                             0s 
PING 10.0.0.2 (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: icmp_seq=0 ttl=64 time=2.743 ms
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=1.936 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=4.062 ms
^C
--- 10.0.0.2 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.936/2.914/4.062/0.876 ms
smo@endeavour ~ # ping 10.0.0.19                                                                                            2s 
PING 10.0.0.19 (10.0.0.19): 56 data bytes
64 bytes from 10.0.0.19: icmp_seq=0 ttl=255 time=10.979 ms
64 bytes from 10.0.0.19: icmp_seq=1 ttl=255 time=536.497 ms
64 bytes from 10.0.0.19: icmp_seq=2 ttl=255 time=69.416 ms
^C
--- 10.0.0.19 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 10.979/205.631/536.497/235.171 ms
smo@endeavour ~ # 

I am thankfull for any suggestions, if you need more info, please feel free to ask.

What version of Home Assistant Core has the issue?

core-2022.2.9

What was the last working version of Home Assistant Core?

core-2022.2.9

What type of installation are you running?

Home Assistant OS

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

elupus commented 2 years ago

My guess is it's reached them via gatewaying over your default router on eth0. The devices you fail to reach does not have a default gateway set, so they can't respond.

Smo-RBR commented 2 years ago

Thank you for trying to help. But all devices are in the same subnet. Also netmask is set correctly.

elupus commented 2 years ago

ifconfig doesn't list wlan0 and eth0 is not same subnet.

Smo-RBR commented 2 years ago

The HA is reachable at 10.0.0.8. An Ethernet cable is not connected. Router shows HA with this address. Router DHCP is configured to assign this address to HA. Can ssh to 10.0.0.8. GUI says wlan0 with 10.0.0.8. I don’t know why ifconfig shows no Wi-Fi interface. But 172.x address space what is shown for eth0 isn’t used in my whole network.

Do Conbee sticks Ethernet stuff?

Smo-RBR commented 2 years ago

i don´t understand why HA Gui and also in MOTD shows wlan0, but ifconfig does not


| |  | |                          /\           (_)   | |            | |  
| |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_ 
|  __  |/ _ \| '_ \ _ \ / _ \   / /\ \ / __/ __| / __| __/ _\ | '_ \| __|
| |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_ 
|_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|

Welcome to the Home Assistant command line.

System information
  IPv4 addresses for eth0:  
  IPv4 addresses for wlan0: 10.1.0.1/8
  IPv6 addresses for wlan0: 2003:ef:714:bc00:5d02:8b0e:2838:b318/64, fe80::d320:88:b94e:8628/64

  OS Version:               Home Assistant OS 7.4
  Home Assistant Core:      2022.2.9

  Home Assistant URL:       http://homeassistant.local:8123
  Observer URL:             http://homeassistant.local:4357
[core-ssh ~]$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 02:42:AC:1E:21:01  
          inet addr:172.30.33.1  Bcast:172.30.33.255  Mask:255.255.254.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2673 errors:0 dropped:0 overruns:0 frame:0
          TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:662309 (646.7 KiB)  TX bytes:385902 (376.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

[core-ssh ~]$ 
Smo-RBR commented 2 years ago

Seems i found the problem. Turn off dynamic wifi channel assignment solves the problem. And, because the entire Network runs flawless with this router and repeaters for a couple of years, i think, the bug is in HA.

elupus commented 2 years ago

That sounds like issues with your devices. So unlikely ha issue. Also ha is not Hassos.

Smo-RBR commented 2 years ago

What? The entire network, with some embedded devices, MacOS, Linux, FreeBSD computers and iOS and Android mobiles runs for years without any problems, only HA or HASSOS have them, and you think HA is not the problem? Okay :) Great. In your answers above, you have proven that you don't have any idea how networks work, this shows your subnet and default gw theory above. You were not able to answer one of my questions, eg. why ha shows wlan0, ifconfig not. And now you say, other devices are the problem. This is beyond all what i had expected.