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
73.22k stars 30.58k forks source link

Cannot Change Which Is The Default Network Adapter for Home Assistant #81433

Closed LordNex closed 6 months ago

LordNex commented 1 year ago

The problem

I have a collapsed core VLAN segmented network with 5 different networks that Home Assistant needs to monitor. This has worked well by just deselecting the auto-configure option in the Network panel in Home Assistant. My problem is that I cannot control which adapter is used as the "Default" adapter. I already have a route set to send all non-local HA traffic to the appropriate interface, but when it needs to get non-local resources I want it to only go out to one specific subnetted VLAN. As you can see in the Screenshot below Home Assistant recognizes all 5 adapters and each has its own subnet. But I cannot change the Starred "Default" to another adapter. And it seems to randomly hop around. I think it just looks at what is the first one that returns a reply but that subnet may be limited in what outside resources it is allowed to serve via my firewall. Is there a way or can one be implemented to be able to indicate which adapter to use for internet-based traffic?

image

Thanks again for such a fine product! Proud Supporter of Nabu Casa and Home Assistant for about 5 years now!

What version of Home Assistant Core has the issue?

core-2022.10.5

What was the last working version of Home Assistant Core?

core-2022.10.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Networking

Link to integration documentation on our website

No response

Diagnostics information

image

Example YAML snippet

No response

Anything in the logs that might be useful for us?

None that I can tell

Additional information

I'm running on a 40 Core Dell PowerEdge R620 with 256GB of RAM and a small SAN. This has VMWare ESXi 7.0.3 U2 installed with the custom Dell Image and Drivers. It has a 4x 1GB Intel NIC card that has been aggregated to the switch with LACP.

Home Assistant has been allocated 8 Cores @ 2 cores per processor, So basically a Quad Socket Dual Core setup with 32 GB of RAM and an install drive of 512GB. It has 5 NICs attached to the internal VSwitch with each on a separate port group per VLAN. This effectively gives Home Assistant an IP Address in each of the subnets it needs to communicate with.

LordNex commented 1 year ago

I've been receding a lot of the same errors everyone else has post 2022.1.1. This exacerbated the issue by blocking host internet access because it would only default to one specific adapter. I need multicast on all VLANs.

Only way I've been able to bandaid the situation is to remove all NICs from the VM except the one connected to the subnet I want it to connect on, then once it's marked as default, slowly readd the NICs one by one hoping that it doesn't reset.

I've done this once before but this is starting to be more and more of an issue as I segment my network more. Please add a way for us to define this setting as I see no other way in the help files.

OutOfThisPlanet commented 1 year ago

I have the same issue.

I have my homeassistant connected to 3 separate networks, via 3 different interfaces. Each interface has a different public IP address.

image

I need to be able to force homeassistant to use a specific interface as the gateway. This is so I can correctly set my dynamic DNS IP address for some webservers I host.

When homeassistant is using the wrong gateway, I am reporting the wrong IP address to my dynamic DNS provider.

The only fix I have found is to disable the other interfaces, which is undesirable.

I realise these selections are only for multicast, however how do I set the gateway interface of choice in homeassistant? This random "Default" is beyond maddening!

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (network) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `network` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign network` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


network documentation network source (message by IssueLinks)

QNimbus commented 1 year ago

As a temporary workaround, I was able to configure the correct default adapter by:

To modify the route metric and remove the default gw:

$ nmcli connection edit "<LAN connection name>"

nmcli> set ipv4.route-metric 1
nmcli> save
nmcli> quit

$ nmcli connection edit "<IOT/Guest connection name>"

nmcli> remove ipv4.gateway
nmcli> save
nmcli> quit

## Restart / Reboot

image

enp3s0 is my LAN interface, the other two are the Guest and IOT interfaces

OutOfThisPlanet commented 1 year ago

Awesome, I'll give that a try! Thanks!

OutOfThisPlanet commented 1 year ago

nmcli connection edit "Supervisor eth0" (I got caught out initially by just putting "eth0")

Nice. :)

Works for me.

Will turn this into a bash script to call from HA. :)

Could be tricky, as nmcli is interactive.

Need to figure out how to do it inline.

LordNex commented 1 year ago

Another way I found to force the default adapter is to leave the rest set to DHCP and just use a static on the adapter you want as default.

Seems to work as needed without much fuss or need to drop to the cli.

I tried once following the proper direction to add a VLAN to the adapter but that failed badly as I'm on VMWare and it's not really setup to work that way

issue-triage-workflows[bot] commented 1 year ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

LordNex commented 1 year ago

Nope has not been resolved and is still a very huge problem

muhlman commented 1 year ago

I concur this is an issue, I am having this issue myself on the latest versions.

bluduk01 commented 1 year ago

Still an ongoing issue with latest update HA OS 10.5.

asknoone commented 1 year ago

Another way I found to force the default adapter is to leave the rest set to DHCP and just use a static on the adapter you want as default.

Seems to work as needed without much fuss or need to drop to the cli.

I tried once following the proper direction to add a VLAN to the adapter but that failed badly as I'm on VMWare and it's not really setup to work that way

This doesn't work for me sadly. Shame, would have been a fairly simple solution.

Langelus commented 1 year ago

Given how common it is in the community to use seperate IOT vlans I sure hope this issue gets some love

motoridersd commented 1 year ago

I started having issues with some of my integrations failing to initialize because the traffic was being sent out the wrong interface. My firewall configuration has specific access lists to allow the primary interface to reach other devices, but HA was sending this traffic out of an interface that doesn't have access. I used the DHCP trick mentioned above on the secondary interface, and now the primary one (statically configured) is used as default.

Something changed in a recent update that caused the traffic to change source since this had been working for months without issues.

We definitely need to be able to tell HA what interface to use for traffic, or even be able to add static routes to fine tune these things as needed.

Removing the default gateway from the secondary interface's static configuration will probably achieve the same result, but HA doesn't allow us to configure a static IP without a gateway address. The Save option is grayed out until the Default Gateway field is filled in.

image

DezzyMelb commented 1 year ago

Has this had any update since it was opened??? I've tried all the commands and non of them work to set the default Nic. It would be good if there was an option in the GUI that allows you to run the default NIC Command.

motoridersd commented 1 year ago

This creeped up on me again this week and ended up using the CLI to add my secondary interface without a default gateway.

You can run it from the SSH addon. I used this procedure to add a static route as a guideline

https://community.home-assistant.io/t/declare-a-static-route-to-reach-other-lan/311442

Programmierus commented 1 year ago

nmcli offers a better setting to achieve the desired configuration without removing default gateways: never-default. This setting is available for both IPv4 and IPv6.

I executed the command nmcli con modify 'Supervisor enp0sXX' ipv4.never-default yes for each interface I didn't want to be the default gateway. After rebooting HAOS multiple times, it appears to work as expected; the desired interface is selected as the default.

OutOfThisPlanet commented 1 year ago

nmcli offers a better setting to achieve the desired configuration without removing default gateways: never-default. This setting is available for both IPv4 and IPv6.

I executed the command nmcli con modify 'Supervisor enp0sXX' ipv4.never-default yes for each interface I didn't want to be the default gateway. After rebooting HAOS multiple times, it appears to work as expected; the desired interface is selected as the default.

^ This! ^

kidhasmoxy commented 1 year ago

nmcli offers a better setting to achieve the desired configuration without removing default gateways: never-default. This setting is available for both IPv4 and IPv6.

I executed the command nmcli con modify 'Supervisor enp0sXX' ipv4.never-default yes for each interface I didn't want to be the default gateway. After rebooting HAOS multiple times, it appears to work as expected; the desired interface is selected as the default.

@Programmierus - are you finding that this option is respected all the time? I've set it on 2 of 3 adapters and they still show up as default after reboot. You can get lucky if you reboot enough so I'm wondering if this is a reliable fix.

Programmierus commented 1 year ago

nmcli offers a better setting to achieve the desired configuration without removing default gateways: never-default. This setting is available for both IPv4 and IPv6. I executed the command nmcli con modify 'Supervisor enp0sXX' ipv4.never-default yes for each interface I didn't want to be the default gateway. After rebooting HAOS multiple times, it appears to work as expected; the desired interface is selected as the default.

@Programmierus - are you finding that this option is respected all the time? I've set it on 2 of 3 adapters and they still show up as default after reboot. You can get lucky if you reboot enough so I'm wondering if this is a reliable fix.

I have 3 NICs (which are all physical passthroughs on Proxmox VE) and since setting on 2 of them never-default I can indeed confirm they were never set to default after 4 reboots so far... I also noticed that before the setting was done GUI was ordering NICs in random order (one time 20, 18, 19; other time 20, 19, 18 etc). Now (all 4 times) they are always 18, 19, 20. Seems to be quite a lot of coincidence to be lucky, but I will update if anything changes.

Jasparigus commented 1 year ago

+1 this problem, should be an official way to pick from the UI

fireheadman commented 1 year ago

how are you accomplishing this? I am attempting to set mine and getting an error

root@shield:~# nmcli connection show
NAME                        UUID                                  TYPE      DEVICE
Supervisor enx9ca2f49a4a11  745d943d-d483-4b42-aa1b-054efdbacca9  ethernet  enx9ca2f49a4a11
lo                          bb731b9d-9589-485b-bd83-26b2e47149d7  loopback  lo
Supervisor enp2s0f0         ca623ab2-706c-4c5d-98d2-9cfd8573345d  ethernet  enp2s0f0
Supervisor enx9ca2f49a4a11  4b1aa3a3-95b5-3d09-8901-6d704327497a  ethernet  --
root@shield:~# nmcli con modify 'Supervisor enx9ca2f49a4a11' ipv4.never-default yes
Warning: There is another connection with the name 'Supervisor enx9ca2f49a4a11'. Reference the connection by its uuid '4b1aa3a3-95b5-3d09-8901-6d704327497a'

root@shield:~# nmcli con modify 4b1aa3a3-95b5-3d09-8901-6d704327497a ipv4.never-default yes
Warning: There is another connection with the name 'Supervisor enx9ca2f49a4a11'. Reference the connection by its uuid '4b1aa3a3-95b5-3d09-8901-6d704327497a'

image

fireheadman commented 1 year ago

strange...... I rebooted and tried this once more and got a different result will also add... I somehow has multiple NAMEs for the same device, which I removed before rebooting and trying again.

root@shield:~# nmcli connection show
NAME                        UUID                                  TYPE      DEVICE
Supervisor enx9ca2f49a4a11  375ab782-768a-4ff0-ad1c-bab84c63ba92  ethernet  enx9ca2f49a4a11
lo                          ea5aeea6-5760-4699-8b71-edb5842755c1  loopback  lo
Supervisor enp2s0f0         ca623ab2-706c-4c5d-98d2-9cfd8573345d  ethernet  enp2s0f0
Supervisor enx9ca2f49a4a11  4b1aa3a3-95b5-3d09-8901-6d704327497a  ethernet  --
Supervisor enx9ca2f49a4a11  745d943d-d483-4b42-aa1b-054efdbacca9  ethernet  --

root@shield:~# nmcli con delete uuid 4b1aa3a3-95b5-3d09-8901-6d704327497a
Connection 'Supervisor enx9ca2f49a4a11' (4b1aa3a3-95b5-3d09-8901-6d704327497a) successfully deleted.
root@shield:~# nmcli con delete uuid 745d943d-d483-4b42-aa1b-054efdbacca9
Connection 'Supervisor enx9ca2f49a4a11' (745d943d-d483-4b42-aa1b-054efdbacca9) successfully deleted.
root@shield:~# nmcli con modify 375ab782-768a-4ff0-ad1c-bab84c63ba92 ipv4.never-default yes
root@shield:~# nmcli connection show
NAME                        UUID                                  TYPE      DEVICE
Supervisor enx9ca2f49a4a11  375ab782-768a-4ff0-ad1c-bab84c63ba92  ethernet  enx9ca2f49a4a11
lo                          ea5aeea6-5760-4699-8b71-edb5842755c1  loopback  lo
Supervisor enp2s0f0         ca623ab2-706c-4c5d-98d2-9cfd8573345d  ethernet  enp2s0f0

appears to be like I want it now image

root@shield:~# nmcli d show
GENERAL.DEVICE:                         enp2s0f0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         40:6C:8F:3E:60:88
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Supervisor enp2s0f0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/4
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.1.71/24
IP4.GATEWAY:                            192.168.1.254
IP4.ROUTE[1]:                           dst = 192.168.1.0/24, nh = 0.0.0.0, mt = 101
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 192.168.1.254, mt = 101
IP4.DNS[1]:                             192.168.1.254
IP6.ADDRESS[1]:                         fe80::f935:6926:7068:9d4e/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 1024

GENERAL.DEVICE:                         enx9ca2f49a4a11
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         9C:A2:F4:9A:4A:11
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Supervisor enx9ca2f49a4a11
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/2
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.4.71/32
IP4.GATEWAY:                            --
IP4.ROUTE[1]:                           dst = 169.254.0.0/16, nh = 0.0.0.0, mt = 1000
IP4.DNS[1]:                             192.168.1.254
IP6.ADDRESS[1]:                         fe80::70f0:1438:307f:9487/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 1024
LordNex commented 12 months ago

Has this had any update since it was opened??? I've tried all the commands and non of them work to set the default Nic. It would be good if there was an option in the GUI that allows you to run the default NIC Command.

Try setting a DHCP reservation on your router or dhcp server for all of the non primary VLANs and then set them to dhcp in HA. Then just set the primary interface static. Works until they get better VLAN support.

LordNex commented 12 months ago

And yes it still an issue with 11.0

ronaldvdmeer commented 11 months ago

After upgrade this became a problem once again. Will try the workarounds above but it would be good if this can be configured in the interface. Now all at random things stop functioning because the wrong default interface is selected.

Update: the workaround to set a static IP on the preferred default interface certainly does not work.

dgricourt commented 11 months ago

same for me. Looking forward to be able to define the default interface

khaosspawn commented 11 months ago

Still an issue as of 11.3. Any chance we can get a response or a work around? Setting the desired adapter to static didn't help.

ronaldvdmeer commented 11 months ago

For me the nmcli workaround does the trick.

LordNex commented 11 months ago

I can confirm that this is still happening under 2023.11.3. Luckily I have some pretty good networking equipment and am a network engineer so getting the work around to work isn't hard. But there are several different ways toy can go about it and it all really depends on your network topology.

But a permanent solutions should have already been at least investigated. If anyone at the HA Core team needs some networking help, feel free to reach out and I'd be happy to help.

LordNex commented 11 months ago

enp2s0f0

Is the addapter you'll need to either add a subnet of through linux, or let set all the interfaces you DONT want default to static, then on the adapter you do want as default, leave it DHCP but have a DHCP reservation set so that it picks up the IP your wanting as the primary. The one picking up DHCP seems to be the one it wants to default too.

LordNex commented 10 months ago

Still a major issue for anyone with a segmented network

LordNex commented 10 months ago

After upgrade this became a problem once again. Will try the workarounds above but it would be good if this can be configured in the interface. Now all at random things stop functioning because the wrong default interface is selected.

Update: the workaround to set a static IP on the preferred default interface certainly does not work.

It does, but you have to have control over your DHCP server to be able to set the proper options and reservations.

cods4 commented 9 months ago

I just spent the last 3 hours trying to work out why Victoria Metrics add on couldn't hit the prometheus api. Finally worked out this was the cause. I did this: nmcli connection edit ""

nmcli> set ipv4.route-metric 1 nmcli> save nmcli> quit

and it's working after one reboot. Fingers crossed it sticks next time I reboot and after an update.

This needs to be sorted.

LordNex commented 9 months ago

I just spent the last 3 hours trying to work out why Victoria Metrics add on couldn't hit the prometheus api. Finally worked out this was the cause.

I did this:

nmcli connection edit ""

nmcli> set ipv4.route-metric 1

nmcli> save

nmcli> quit

and it's working after one reboot. Fingers crossed it sticks next time I reboot and after an update.

This needs to be sorted.

There are back ways of reconfiguring the NIC through nmcli but we shouldn't need to.

Plus unfortunately your method leaves out IPv6. Which is currently the only publicly accessible addressing us Starlink users can utilize to have outside access to our HA interface. This is due to the proprietary way they handle data transfer stuffing you behind a CG-NAT network. Minus the TOR protocol, I can only access my interface fully by utilizing Nabo.Casa and its proxy abilities to utilize IPv6 and translate it to a IPv4 network that is still primarily how most of the world's internet infrastructure. The more and more people who convert their networks over to utilize IPv6, will then help the rest by providing the new infrastructure that's available.

I find it funny that something as important as the internet has taken over 20 years to even begin to utilize a standard that has been ratified for several decades. But I digress, hopefully more and more satellites "shells" with laser backbone hubs will help with that and also give us a publicly accessible IPv4 random address that we can sDNS through with something like NGINX.

In either situation it's still going to need the ability for the administration to mark the "default" route traffic should take for any non-localized traffic. And it shouldn't be a back door command line fix for something as primary and important of a setting as this. A simple additional checkbox shouldn't and maybe add VLAN tagging of packets per interface so it takes less stress on your router and layer 3 infrastructure to get the data routed to the right VLAN interface.

I can see where there are problems trying to make this standard seeing as they don't know the nature of the install. But us who utilize a higher end Firewall/IPS/IDS will be a lot happier. I'm thankful I have a Firewalla Gold decked out with an extra fast RAM upgrade. Can't recommend them enough. They are on the higher side of most people's network price point. But it blocks almost 1.2 million false connection attempts a day. Including the multitude of IoT devices that are calling out to CnC servers in foreign countries.

But I hope that works for you until they get a better option. Until then I'm still fighting it as even my DHCP reservation trick hasn't seemed to work either as of late. And it won't let me save without a default gateway set if I go manual on each interface.

LordNex commented 9 months ago

enp2s0f0

Is the addapter you'll need to either add a subnet of through linux, or let set all the interfaces you DONT want default to static, then on the adapter you do want as default, leave it DHCP but have a DHCP reservation set so that it picks up the IP your wanting as the primary. The one picking up DHCP seems to be the one it wants to default too.

This seems to have mixed results. I have over 100 devices connected to my network. About half of that is wireless that's spread through my Aruba IAP cluster with fast roaming enabled. It's even harder since the 2.4ghz spectrum is so over utilized by not just all of the IoT devices that connect that way. But also ZWave and Zigbee. I'm not sure about matter. I've been trying to switch over my TP-Link Wall Plug Adapters for Zigbee based ones with the hops of clearing up all of the wireless traffic.

LordNex commented 9 months ago

enp2s0f0

Is the addapter you'll need to either add a subnet of through linux, or let set all the interfaces you DONT want default to static, then on the adapter you do want as default, leave it DHCP but have a DHCP reservation set so that it picks up the IP your wanting as the primary. The one picking up DHCP seems to be the one it wants to default too.

Since those UUIDs were different and didn't seem to be attached to any device is strange. It's like HA almost started to add the VLANs as a subnetwork of the primary interface. Which always confused me in the way Linux handles VLANs in general.

cods4 commented 9 months ago

Which is currently the only publicly accessible addressing us Starlink users can utilize to have outside access to our HA interface

I feel for you on that one. I'm lucky that I have 3 static external IPv4 addresses and 1G/1G (meant to be 2.5G/2.5G) fibre. I managed to get IPv6 up and running on my network (since my new ISP gave out a static subnet). But I decided it wasn't worth the extra work to understand it all, and without fully understanding it and how my firewall dealt with it etc, I was worried I would open up my network to the world. So I turned it off again.

I think the reason that the move to IPv6 isn't really progressing as quickly as it should is that the IPv4 address shortage isn't really getting any worse anymore since most ISPs have moved to CG-NAT and that works perfectly fine for 99% of users. And when us nerds/enthusiasts need a static IPv4 address, we can usually pay a little extra for one, or change to an ISP that offers them. Unfortunately if Starlink is your only decent option, then you are in a pretty rough situation. Thanks Elon :(.

LordNex commented 9 months ago

Which is currently the only publicly accessible addressing us Starlink users can utilize to have outside access to our HA interface

I feel for you on that one. I'm lucky that I have 3 static external IPv4 addresses and 1G/1G (meant to be 2.5G/2.5G) fibre.

I managed to get IPv6 up and running on my network (since my new ISP gave out a static subnet). But I decided it wasn't worth the extra work to understand it all, and without fully understanding it and how my firewall dealt with it etc, I was worried I would open up my network to the world. So I turned it off again.

I think the reason that the move to IPv6 isn't really progressing as quickly as it should is that the IPv4 address shortage isn't really getting any worse anymore since most ISPs have moved to CG-NAT and that works perfectly fine for 99% of users. And when us nerds/enthusiasts need a static IPv4 address, we can usually pay a little extra for one, or change to an ISP that offers them.

Unfortunately if Starlink is your only decent option, then you are in a pretty rough situation. Thanks Elon :(.

Couldn't have said it better myself. And living way out in the boondocks. Yea it's the only internet worth doing. Maybe in another 5-10 years I'll see something else, but until then I'm stuck with CG-NAT with no option, unless I move to their business package which is like $1500 a month and without any bandwidth increase. Again, Thanks Elon!

Jasparigus commented 9 months ago

FYI Starlinks new priority 40gb plan is 140/month and will give you a public ip. After 40gb it just becomes standard unlimited. So for 20$ extra you can get a pubic ip which could be worth it depending on your needs. TailScale also provides a decent workaround.

I use TailScale to form a direct IPv6 tunnel to a cloud instance then use NGINX Proxy Manager with streams to expose my local services to the instances IPv4 address (eg Minecraft server and Plex) You can basically do anything nowadays without a public IP but it does add 1 hop for latency.

PS still having this HA issue even with some of the work arounds.

LordNex commented 9 months ago

FYI Starlinks new priority 40gb plan is 140/month and will give you a public ip. After 40gb it just becomes standard unlimited. So for 20$ extra you can get a pubic ip which could be worth it depending on your needs.

WOW I didn't know they offered that. I put in a ticket a few months back asking about it but this was when they were still getting their IPv6 network working properly. I may just invest in that as the $20 to have a public ipv4 would just make things so much easier.

I've used tailscale in the past. Have it installed on my Home Assistant box. But what outside source are you using as a proxy to get that to work? I have a lifetime subscription to UnlimitedVPN but it doesn't support port forwarding and the port it gives you it's just random ones that are available it appears. I've yet to find a cheap alternative BPN service that doesn't cost a monthly fee and has a lifetime subscription that allows port forwarding of any port you want. Basically giving you control over the whole ipv4 address.

OutOfThisPlanet commented 8 months ago

Plus unfortunately your method leaves out IPv6.

Shudders

LordNex commented 8 months ago

Plus unfortunately your method leaves out IPv6.

Shudders

NETWORKING

a word misused in PROGRAMMING far too often!

LordNex commented 8 months ago

FYI Starlinks new priority 40gb plan is 140/month and will give you a public ip. After 40gb it just becomes standard unlimited. So for 20$ extra you can get a pubic ip which could be worth it depending on your needs. TailScale also provides a decent workaround.

I use TailScale to form a direct IPv6 tunnel to a cloud instance then use NGINX Proxy Manager with streams to expose my local services to the instances IPv4 address (eg Minecraft server and Plex) You can basically do anything nowadays without a public IP but it does add 1 hop for latency.

PS still having this HA issue even with some of the work arounds.

I looked into this, must only be in your region or area. For me the only options I have force me to still spend $5000 on a slightly larger dish and hardware, and take on a $250 a month subscription that gives me nothing more in speed or anything else and only a dynamic public IP. Now at $140, I’d be ok with paying the extra $20 for a dynamic public IP. But apparently it’s still not an option for my grid. But I will keep an eye on it and cross my fingers.

But that still doesn’t address the pure lack of ability to control Home Assistant at its base. So no ISP is going to solve this for them. They need to relook at the ISO layers they built their network stack on and correct it for 21st century networking standards that have been in place for several decades.

OSULugan commented 6 months ago

I only have 4 network adapters tied to my home assistant VM, each with a different network segment that uses DHCP.

Here's another vote for simplifying this. Make a user-selectable "default" interface, and have Home Assistant configure the networking how it needs to to make that act correctly (i.e., bind to that address for the WebUI). Also, it would be nice to have access to identify the subdomain for name resolution purposes for each interface through the UI if I'm going to be forced to use static vs. dhcp connections.

There are times when configuring devices with a "static" IP and giving them a corresponding reservation at the DHCP server is a liability. For instance, when you need to alter the DNS server addresses for your network, only those systems that receive the information via DHCP are going to get updated.

Another adjunct feature that might make this situation have a lower impact (to me at least), is to have a universally acceptable way for me to reconfigure an IP address for a device/entity/integration via the WebUI. Most integrations require me to remove / re-add the integration to do this or to manually dig through the config files via an SSH connection. So, I use hostnames for them, and then a DNS change screws everything up (or a network change which forces DNS to not work right). Or a way to configure the /etc/hosts file for home assistant in the web UI, so that I could alias the ip addresses just the way I want for home assistant.

Or, at the very least, the way to associate "dead entities" with a new integration and/or remove better "dead entity" clean-up and management.

I've struggled through the reconfiguration of the network adapters a few times now, since it seems to be reset during an OS upgrade, and I just got to do it again today.

Dunuin commented 6 months ago

I don't get why we are not allowed to NOT set a gateway or DNS server for an interface when setting up a static IP. If you don't want to add such things into the webUI, why not allow us to edit a network config file that persists HassOs updates?

Here I got 3 interfaces. One for management, one DMZ and one for IoT. Only subnet able to access the internet is the DMZ one but the other two will be used as gateway...

bdraco commented 6 months ago

The default adapter is what the OS reports as default (usually the default route). core can't change what the operating system is reporting and does not manage the system's routing table. This issue is being reported to the wrong place and its never going to see resolution here.

Its important to note that the network area in settings only affects multicast traffic, and only for integrations that observe network settings:

Screenshot 2024-04-09 at 10 20 07 AM

If you are using HAOS, please open an issue at https://github.com/home-assistant/operating-system , however I'm not sure changing the default route is supported but its definitely not supported in core

If you are not using HAOS, you'll need to configure the default route at the operating system level.

The below script will get the default IP using for multicast traffic:

import socket

test_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
test_sock.connect(("224.0.0.251", 1))
print(test_sock.getsockname()[0])