mattlongman / Hassio-Access-Point

Hass.io addon to let you create a WiFi access point, perfect for using WiFi devices on off-grid installations.
MIT License
91 stars 64 forks source link

Forward internet to default route instead of hard coded eth0 #56

Closed rrooggiieerr closed 11 months ago

rrooggiieerr commented 11 months ago

Home Assistant OS 11.0 breaks client_internet_access

From the Home Assistant OS 11.0 change log:

⚠️ Breaking Change: On Arm based boards network names are enumerated based on device tree. This means that the first Ethernet devices will no longer be named eth0 but end0.

This pull request proposes a solution by using the default route interface to forward client internet access to.

I tested my modifications and client internet access is working again on Home Assistant OS 11.0

rrooggiieerr commented 11 months ago

@mattlongman can you check this pull request?

mattlongman commented 11 months ago

Thanks @rrooggiieerr! A couple of notes: take a look at the files I edited in your PR. Editing the changelog is helpful to keep track of fixes (not 100% required, but saves me figuring out changes). config.json version number is how Home Assistant OS determines whether an update is available, so if this isn't bumped, no one will be prompted to update.

Secondly, I don't have any way of testing this currently, so if you can confirm the updated version installs ok, that would be good.

mattlongman commented 11 months ago

Created discussion 57. @rrooggiieerr, I appreciate the time taken to submit this PR. If you're a regular user of the addon, your input would be appreciated.

rrooggiieerr commented 11 months ago

Hi @mattlongman, good to see you're alive ;-) I can confirm the workings of this code on my Pi 3 and Pi 4. Actually, the command ip route show default | awk '/^default/ { print $5 }' which I use to find the default route will run on any hardware platform running HAOS, try it yourself.

I know about the changelog and config.json. Imho these should be maintained by the package owner if only because a release could contain multiple changes, and if everyone would edit these files potential merge conflicts could occur.

mattlongman commented 11 months ago

Hi @mattlongman, good to see you're alive ;-) I can confirm the workings of this code on my Pi 3 and Pi 4. Actually, the command ip route show default | awk '/^default/ { print $5 }' which I use to find the default route will run on any hardware platform running HAOS, try it yourself.

I know about the changelog and config.json. Imho these should be maintained by the package owner if only because a release could contain multiple changes, and if everyone would edit these files potential merge conflicts could occur.

Yeah, I understand your point. For this repo, there's not a lot of chance of getting merge conflicts 😆