Hello everyone, I’m having trouble with configuring remote access to my home assistant with Duck DNS. Prior to tinkering with home assistant I didn’t even know what a home network was, so please bear with me if I make beginner mistakes…
Some basic info:
- Running on Raspberry Pi 4
- Downloaded and installed from Raspberry Pi - Home Assistant with Balena Etcher
- Connected via ethernet cable to a D-Link router (internet comes from a SIM inserted into the router)
To my understanding, I need to do the following steps to set up remote access:
- Create a new DuckDNS account and get my token & host name
- Install the Duck DNS add-on in HASS
- Configure the add-on as follows:
aliases: []
domains:
- xxxxxxxxxx.duckdns.org
lets_encrypt:
accept_terms: true
algo: secp384r1
certfile: fullchain.pem
keyfile: privkey.pem
seconds: 300
token: 08xxxxxxxxxxxxxxxxxxxxxxxx4ec
- Set up port forwarding on my router as follows:
Protocol: TCP/UDP (both)
NAT Loopback enabled
Public port: 443 (so that all public connections via https:// will be redirected)
Private IP: 192.168.0.xxx (this is the IP address of my RPi)
Private port: 8123 (so that the public https:// connection is forwarded to internal port 8123)
- Update configuration.yaml with the following:
homeassistant:
external_url: https://xxxxxxxx.duckdns.org
internal_url: http://homeassistant.local:8123
Error:
I attempted to access my home assistant instance via the url https://xxxxxxxxx.duckdns.org on my mobile device through 4G data and got a connection timeout error. No issues when it comes to accessing home assistant on the same WiFi/ethernet.
Narrowing down the problem:
I’m unable to get any error logs from RPi (Configuration > Settings > Logs) which suggests that it is not an issue with the Home Assistant installation blocking incoming connections. I’ve configured configuration.yaml with the below code just in case as well.
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24 #Remote LAN
- 192.168.0.xxx #Your Home assistant IP only
ip_ban_enabled: true
login_attempts_threshold: 5
Could the problem lie in my port forwarding configuration? Or perhaps there’s another possibility. On the home assistant documentation, they’ve stated that
If you cannot access your Home Assistant installation remotely, remember to check if your ISP provides you with a dedicated IP, instead of one shared with other users via a CG-NAT.
I was unable to figure out how to check for this. However, it seems that shared IPs are common nowadays, so this may be the problem I’m facing.
If there were any errors in my configuration, please kindly point them out.
And if my IP is not a dedicated one, what are my options? Should I get a dedicated IP address or purchase Nabu Casa cloud? Or is there some alternative (e.g. OpenVPN, proxy server) for this?
Thank you so much,
Chris