home-assistant-addons icon indicating copy to clipboard operation
home-assistant-addons copied to clipboard

Home Assistant OS 9.5 changed IP subnet again

Open dilorenzo1987 opened this issue 2 years ago • 15 comments

they did it again :)

Always fun....

https://github.com/home-assistant/operating-system/pull/2246 https://github.com/home-assistant/operating-system/pull/2259

dilorenzo1987 avatar Jan 30 '23 13:01 dilorenzo1987

Hey! I saw this change but I don't think / didn't believe it's related to the forwarding addon. Can you confirm that your setup broke with 9.5? Mine didn't...

ThomDietrich avatar Jan 30 '23 15:01 ThomDietrich

Strange, it broke for me, my new config looks now like that: remote_forwarding:

  • 127.0.0.1:8123:172.30.232.1:8123

dilorenzo1987 avatar Jan 30 '23 15:01 dilorenzo1987

Hey. It broke it for me as well :-/ . The line from you @dilorenzo1987 doesn't seem to work.

hnykda avatar Jan 31 '23 20:01 hnykda

Ha, 172.17.232.1 (the older one from https://github.com/home-assistant/operating-system/pull/2259/files#diff-eb737cfe0628960e2fa0312e80496db0bee4f2df3ab26b949aebd0dcced2467aL11) works! I guess I need to adjust it afterwards again.

hnykda avatar Jan 31 '23 21:01 hnykda

I'm a bit confused now. Mine work fine, but I'm using a completely different url :D 56080:localhost:8123, where 56080 is the port homeassisatnt should be exposed on my remote server.

supermar1010 avatar Mar 07 '23 21:03 supermar1010

....aaaaand after Homeassitant OS update to v10, I had to go to the 172.30.232.1 "again" 😁 ...

hnykda avatar Apr 20 '23 17:04 hnykda

TODO

As I am just dealing with this issue again, I realized it would be good for general reliability, if the script had one step in which it checks (e.g. via curl), whether the configured 172.30.232.1:8123 is reachable.

While at it, I would also separate the two "ip:port" combinations out into seperate input fields, for usability, especially in the UI config mode. The current support for a list of forwarding ports is imho not needed. If someone needs more, they can always add stuff in other_ssh_options.

Any further thoughts? If anyone wants to contribute a PR, I would definitely appreciate that!

Btw: For me both 172.30.32.1 and 172.30.232.1 work :D

ThomDietrich avatar May 25 '23 07:05 ThomDietrich

Sounds like a good idea. I started with #16 for the first part, but it's just a stub.

hnykda avatar May 25 '23 09:05 hnykda

Hi! I tried several IPs and none of them seem to work... The ones I tried:

  • 172.30.32.1:8123
  • 172.30.232.1:8123
  • 172.17.32.1:8123
  • 172.17.232.1:8123
  • 172.17.0.1:8123

None of them seem to work... Do you know how can I see the real IP and port HA is using?

Thanks in advance,

cnieves1 avatar Nov 03 '23 08:11 cnieves1

For me, this works. Normal hassos

hostname: ...my-remote-ip...
ssh_port: 22
username: root
remote_forwarding:
  - 127.0.0.1:8124:172.30.232.1:8123
other_ssh_options: ""
force_keygen: false

hnykda avatar Nov 03 '23 08:11 hnykda

Hey @cnieves1, the IP subnet your envirnonment uses is printed on the Log when you start the app. Did you check there? image

ThomDietrich avatar Nov 03 '23 09:11 ThomDietrich

Thanks a lot @ThomDietrich !

Didn't know that!. I get:

1: lo    inet 127.0.0.1/8 scope host lo\       valid_lft forever preferred_lft forever
1: lo    inet6 ::1/128 scope host \       valid_lft forever preferred_lft forever
4: docker0    inet 172.30.232.1/23 brd 172.30.233.255 scope global docker0\       valid_lft forever preferred_lft forever
4: docker0    inet6 fe80::42:74ff:fed9:f650/64 scope link \       valid_lft forever preferred_lft forever
5: hassio    inet 172.30.32.1/23 brd 172.30.33.255 scope global hassio\       valid_lft forever preferred_lft forever
5: hassio    inet6 fe80::42:5bff:fee5:ceae/64 scope link \       valid_lft forever preferred_lft forever

Does that mean that 172.30.32.1 (hassio) should work?

That's one of the addresses I tried. Maybe it's something related with ports? I tried 127.0.0.1:8123:172.30.32.1:8123 (and I only changed the second IP address when trying, not the port) I don't see the ports listed anywhere... is there any way to check which port it's using?

cnieves1 avatar Nov 03 '23 09:11 cnieves1

Is there a reason why you insist on using IP addresses? I've successfully used hostnames and these remain stable. That also seems to be the recommended way of communicating with the supervisor (rather than hardcoding its IP).

To forward the SSH add-on's port to the remote (under port 51179 for example), I set localhost:51179:core-ssh:22. I believe you could forward the UI by using home-assistant as the hostname like in localhost:58123:home-assistant:8123.

Rjevski avatar May 12 '24 19:05 Rjevski

@Rjevski that is a very interesting point! The short answer would be that in this context I generally expect IPs to be fixed and clear. However, I agree that this might be a good way forward. Would you like to open a PR?

To all reading here: Any objections?

ThomDietrich avatar May 15 '24 07:05 ThomDietrich

no objections, this sounds good to me.

hnykda avatar May 15 '24 08:05 hnykda