Secondary IP for eth0 interface

Hello!

I am trying to set a secondary IP to my eth0 inteface but I can’t get it.

I have been looking for a lot of information but I don’t see the way to do it (I don’t have the nmcli command and I can’t find any configuration file).

With the command ifconfig I get the IP of the docker and with the command “ha network info” I get the ipv4 of the interface eth0 but I don’t know how to add another one. I have seen that ipv6 has two IPs.

I have HA installed on a RaspberryPi 4 in the latest version 2021.8.7

Any idea?

Sorry, but I’m new and I’m still not very clear how all this works internally.

XY problem - Wikipedia (Thanks Tom :wink: )
What are you trying to achieve by adding an additional IP?

I have configured HA to access from outside via https and I have lost local access via http because the certificate does not match.

So I can’t run the application from inside my house and I have to put in the browser https://localHAip:8123 and “accept the risks” that the certificate is not valid to access locally.

I think, if I configure the public IP as secondary of the interface eth0 I can solve this problem.

You can use nginx proxy

1 Like

I will chek it!

No. You lost http because you enabled https. You can’t have both with only HA.
AFAIK, HA only supports 1 http(s) listener.

No. Certificates are normally concerned with the DNS you use, only, e.g. hass.lan in https://hass.lan:8123.
You can add IPs to so-called SAN certificates, but it’s very likely not what you did.

Then again, if the certificate you created is “self-signed”, the browser will complain, anyway.

If your router supports hairpinning, you can still access https://your.domain.com:8123 from inside your lan.

It’s more that they want both http and https access, for which a reverse proxy like nginx or caddy is perfect.

If you have (and control) an internal DNS, you can also redirect, internally, “your.domain.com” to the internal IP. That’s what I do for “ha.your.domain.com

IMO, it’s more that the OP is bothered by the certificate warning/error, not https per se.

Yeah. I really should read all of the post. :man_facepalming:

That is one of the tasks of my pihole :slight_smile:

1 Like

I was looking at it, but my router does not support hairpinning.

I am using Let’s Encrypt and DuckDNS, the real problem, beyond the browser warning, is that I can’t use the Android App from the local network because it fails to connect neither to the public IP (the router doesn’t support hairpinning) nor to the private one.

The doc for the companion app recommends the adguard addon for splt-brain DNS (i.e. what I mentioned), assuming you don’t already have one.

As Francis mentioned, pihole is also a popular “internal” DNS.

Reading the information you have provided me about split brain DNS, I have just understood everything…

Thank you! :slight_smile:

go with VPN. Once connected your http will work