New ISP, Modem, Router - Can only access Home Assistant remotely

Hey guys,

I recently switched to a new ISP and got a new modem/router combo. I forwarded the ports and essentially copied all the settings from my old router to my new one. However, I can now only access HA remotely whether that is by connecting to a VPN or by using 4G on my phone. If I am on the local network, it continues to load indefinitely. At first I thought my IP was banned, but there was nothing in the ip_bans file. For good measure, I removed the file and restarted HA but I still cannot connect while on the LAN. I am using duckdns and have always accessed HA by going to myhomeassistant.duckdns.org. This still works, but again, not while on my LAN. I can SSH locally into HA and websocket commands still work.

Any ideas what to look for here?

Sounds like your new router doesn’t allow NAT loopback. In other words, local machines can’t use your external IP to access other local machines, they can only use internal IPs.

I assume you have your local IP address if you’ve forwarded ports to it. Navigate to that instead.

Thank you, that is very helpful and makes sense. I’m following this video and it sounds like I can use DNSMasq in HA as well as a DNS record in my router to have a single URL. Accessing HA locally by IP is somewhat helpful, but when using it from my phone app for instance, the app will not be able to connect without manual intervention each time. A single url for HA is definitely what I want.

So I am now having my router point to my HomeAssistant IP for primary DNS which therefore goes to DNSMasq. DNSMasq is setup to point myhomeassistant.duckdns.org to the local IP now. Per the logs, it looks like DNSMasq is working and forwarding requests I make from my PC, but for whatever reason, I can’t access HA by typing in myhomassistant.duckdns.org. Also, when I nslookup myhomeassistant.duckdns.org, it still shows the public IP and not my local IP which is incorrect I guess. Not sure what is going on.

You can use this in configuration.yaml:

homeassistant:
  external_url: "https://my.external.url"
  internal_url: "https://my.internal.url:8123"

and then you can tell in the app companion configuration to use internal/external url based on ssid :wink:

Sorry I can’t help with DNSMasq questions. I circumvent the issue by setting two different URLs in the app as suggested by aceindy.

I really only found it to be an issue when trying to play Google TTS over Google Home Minis. The Minis rely on Google for DNS lookup so the trick is to get Google to pass back a local IP. I managed this by setting up a local.duckdns.org domain to point to my local IP then setting that as the base_url in the TTS config section.

@aceindy Thank you, this is the configuration that I had setup that worked before:

homeassistant:
  external_url: https://myhomeassistant.duckdns.org
  internal_url: http://192.168.0.200:8123

I now have it set to

homeassistant:
  external_url: https://myhomeassistant.duckdns.org
  internal_url: https://myhomeassistant.duckdns.org:8123

With both setups now, I am unable to browse to either https://myhomeassistant.duckdns.org or https://myhomeassistant.duckdns.org:8123, or https://192.168.0.200 I get a generic “This site can’t be reached” error. The only way I can access HomeAssistant currently is https://192.168.0.200:8123.

Any thoughts on what to troubleshoot?

Edit: When I set it back to the original config, I am able to access HA locally by browsing to https://192.168.0.200:8123 still and now also myhomeassistant.duckdns.org:8123 but still not myhomeassistant.duckdns.org

I devised a way to bring back my old router. Thank you for taking the time to help, we are good now.