Cannot connect with local address

Hi, I have set app the android app, and everything is working perfect of I connect via duckdns address, but when I type my local address to connect via Wi-Fi or won’t connect (https://192.168.1.5:8123). Why is that?

2 Likes

That is expected behavior once you setup a dynamic dns service. You can regain access to the local address if you also configure in nginx or caddy add-on.

1 Like

I think it’s a problem with the certificate. The certificate is valid for your duckdns address, but not for your internal address.

Do you get an certificate warning if you open https://192.168.1.5:8123 in a webbrowser?

Yes I do, how can I solve that?

Just use the external URL as the SSL cert is not valid for internal addresses. The app will not work if you have to accept the SSL cert locally.

3 Likes

Mazbe its something that can be fixed in a newer version, cause its pretty annoying to change to cell data when i quickly want to check sth from my phone.

Just use your external URL and turn on NAT loopback on your router and it should work as you expect it to.

This link may provide more info to help you out: https://companion.home-assistant.io/docs/troubleshooting/networking

1 Like

Or just do as @micque suggests and use nginx addon

1 Like

Hi,
I have same problem. I am using Hassio + DuckDNS (with Let’s encrypt) and I am not able to connect with the Android app.

This was my initial situation:

Port forwarding: 443 -> 8123
Remote access: xxx.duckdns.org -> Works properly in browser and in Android app.
Local access: 192.168.1.x --> Works in browser but with warning message about the certificate. It is normal and that’s why I guess I cannot connect with the app from local.

Next step: I installed nginx add-on because my router doesn’t have NAT loopback. I followed these steps:

  1. Remove / comment the lines about the ssl certificates:

base_url: xxx.duckdns.org
#ssl_certificate: /ssl/fullchain.pem
#ssl_key: /ssl/privkey.pem

  1. Add-on configuration:
    domain: (same as base_url)

  2. Leave the rest as-is.

With this configuration I cannot connect externally with the browser (and the app doesn’t work, of course). I have tried different combinations without success.

What I am doing wrong? There is another solution to connect with the app from local and remote?

Thanks in advance
Thanks

I also tried the same but with no success

Leave your HA instance setup with the SSL cert lines. It sounds like external URL was working so you dont need to worry about local URL. Local URL is only for those who are not using SSL externally, like for example if you use Nabu Casa remote because those users do not have a SSL cert to worry about as Nabu Casa handles it for them. Read the link below and follow instructions on Split Brain DNS.

More on this here: https://companion.home-assistant.io/docs/troubleshooting/networking

1 Like

This does
Solve the problem.

Thanks a lot for your help. I followed the intruction of the link and I have it almost solved.

The local access is only possible if I write the URL including the port in the browser: https://xxxx.duckdns.org:8123
From the Android app, I am not able to get access.To write the port doesn’t work.

From Windows, the information of ipconfig shows the DNS of Home Assistant. So, it is correct.

If I ping the address xxxx.duckdns.org the IP of Home Assistant appears.

It seems like if from local access the port forwarding 443 --> 8123 doesn’t work.

There is something that I could try?

Thanks

Sounds like an internal issue, personally I just port forward 8123 to 8123.

1 Like

Thanks. I tried but it doens’t work.

There is the option to use the port 443 by default instead of 8123? Doing this, I will avoid to do the port forwarding. What I am not sure if Homeassitant can work in different port.

Now I got it!!

This is my configuration:

Configuration.yaml:

http:
base_url: xxxx.duckdns.org
server_port: 443
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

AdGuard add-on installed with DNS rewrite: xxx.duckdns.org --> IP of Home Assitant host

Router:

Port forwarding: 443 --> 443 + IP of Home Assitant host

Everything works now: Android app and browser from PC.

Thanks all for your help.

6 Likes

So I’m going through the same issues, following your link, and wondered if you could expand on the AdGuard DNS rewrite? Right now, when I enter the https://xxxx.duckdns.org:8123 on a local basis, it directs me to an AdGuard dashboard.

In AdGuard DNS Rewrite you must enter the following info: www.duckdns.org - 192.168.1.x (the IP of your Home Assitant).

Then, check the port forwarding of your router. What is your current configuration?

I’m using AT&T Uverse, and though I hate the port forwarding aspects of the Pace 5268ac modem, I’ve got port range 443 mapped to port 8123 and the IP address of my home asst. I tried adding the server_port: 443 to my configuration.yaml file like you suggested…

http:
base_url: https://solarczarhomeassistant.duckdns.org
server_port: 443
ssl_certificate: /ssl/fullchain.pem
ssl_key: /ssl/privkey.pem

But this didn’t have any impact.

Try removing the port forwarding.

When you use the URL https://xxx.duckdns.org is the same as writing https://xxx.duckdns.org:443.

If your server is now at port 443, you will not need the port forwarding because https uses port 443.

Try the connection from your local network and remote.