Intermittent network connectivity in Docker

Got a super weird problem. The last few days I’ve noticed issues with HA. The weather app periodically reports unavailable, automations are intermittently not working.

Finally got some time to dig into it and it seems to be a network problem. HTTP requests are periodically failing in the container with “Network unreachable”. This occurs both to addresses on my local network and to the Internet.

I can re-create this by running a wget inside the container, e.g.

f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: server returned error: HTTP/1.1 404 Not Found
f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: can't connect to remote host (154.51.163.100): Network unreachable
f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: can't connect to remote host (154.51.163.100): Network unreachable
f0a135ba2c48:/config# wget https://api.glowmarkt.com -O - >/dev/null
Connecting to api.glowmarkt.com (154.51.163.100:443)
wget: server returned error: HTTP/1.1 404 Not Found

I’ve tried deleting and recreating the the container. I’ve updated to the latest version.

I run a number of containers on this host and the issue is isolated to this container, the others are fine. As is network connectivity on the host its self.

And it seems to be only HTTP(S)/TCP traffic impacted. Pings at least works fine.

I’m running Ubuntu 24.04. Anyone else seen this? I’m a bit stumped.

I have this problem already for a long time on my test system, which is also Ubuntu 24.04. It seems to be a problem with the linux kernel.
See also this thread: Can't reach GitHub (and other sites) when Home Assistant is running
For me issuing “sudo ip route flush cache” when home assistant is restarted helps to solve the problem until the next stop/start.

xxx

The cache flush didn’t work for me. I’ve rolled back to 6.8.0-94 and now all is good again. Hopefully there’s a fix in the works.

I’m also seeing this issues for various hosts, including the ones below, but could not yet recreate the issue using wget.
The connections seem to work fine for some time, then break, then work again.
I just noticed the issue since I switched from pihole (container) to technitium (container) yesterday. I will switch back to pihole and see if the issue comes up again, even if I don’t see how this switch could create an issue - there are no errors / blocks in the technitium logs for those addresses.
I’m on Ubuntu 24.04.3 LTS, kernel 6.8.0-101-generic

host emea.bff.cariad.digital:443 ssl:default [Network unreachable]
host opendata.dwd.de:443 ssl:default [Network unreachable]
supervisor Cannot connect to host version.home-assistant.io:443 ssl:default [Network unreachable]

Same issue. Since home assistant 2026.3.x I noticed a lot of “ Network unreachable”. For example my Tibber, Azure TTS, Xiaomi home, all kind of integrations are logging errors with sort of above error message.
Using docker image.

I started having the same issue a few day go after some updates I made on my machine. Flashing the route table did fix it, but was not good enough since I have a daily restart of my HA. And by the way using “netplan apply” in my case also worked until the next restart.
After 2 days of ai-troubleshooting, it seems that the problem comes from the docker of HA “hijacking” the network of the machine when initializing, which should not happen.
One solution that seems to work is to use a MACVLAN, which means:

  1. Adding a new virtual network interface with a different IP address than the one of the machine
  2. Chaning the HA’s docker compose / stack / run command so it connects to this new interface

It worked for me but the IP of the Home Assistant service will be different from the one of the machine

To do this you can ask your favourite AI to help you create a new MACVLAN for your HA docker, it is not complicated.

Are there any cleaner solutions?

I’ve been also affected by this and it has driven me nuts for days before I found this post. So, at first, thanks you all!

I confirm I’m also affected by this when running HA in a container within a K3S environment with an Ubuntu 24.04.3 LTS, kernel 6.8.0-101-generic kernel.

and @tarekecharfi my HA deployment is running with a (Multus) MACVLAN network interface since years, so I’m afraid it does not work as a workaround in my case.

It also drove me nuts, and still not 100% happy with the outcome.
The key point of the workaround (and I agree with @juergenjw it might have to do with the linux kernel) is that you have to get HA’s docker on a different IP than the machine that runs it. In addition to MACVLAN I had to also do a few adjustments to prevent docker from “touching” the network config (which seems to be a weakness in the new linux):

  • I removed the privileged: true
  • Instead, I replaced it with
cap_add:
      - NET_RAW
  • I had to disable the autoconfig (not sure how useful this is):
   environment:
      - HASS_NETWORK_DISABLE_AUTO_CONFIG=true
  • Finally I had to indicate within the container the “new” IP address of the HA’s service
      ha_network:
        ipv4_address: 192.168.X.X #whatever new IP address here...

networks:
  ha_network:
    external: true
  • The new MACVLAN itself is created through a different docker, for example:
sudo docker network create -d macvlan \
  --subnet=192.168.X.0/24 \  #Adjust to your network, e.g 192.168.1.0
  --gateway=192.168.X.1 \     #Adjust to your network, e.g 192.168.1.1
  --ip-range=192.168.X.200/32 \     #Adjust to your network
  -o parent=enp1s0 \    #name of your internet interface here, netplan status to get it
  ha_network