Accssing server having private IP with a URL

While I am new to OpenWrt, I managed to setup and run OpenWrt on NanoPi R5C for my home.

I have a home assistant server with IP of connected to R5C via LAN.

I also setup DDNS (

When I am outside (not on WIFI), I can access my home assistant server via android home assistant app using the URL

However, when I am home with my phone on WIFI (let say my phone has private IP of, I cannot access my home assistant server using the URL

I must to use to access my home assistant server.

Before I started using OpenWrt, I used Asus router RT-AC68U (flashed with Merlin firmware).
With RT-AC68U, I could access my home assistant server using the URL even when I was on WIFI at home.

I'd like to know if I can setup OpenWrt in a way that I can access my home assistant server with a URL no matter where I am.

I tried searching the forum but I was not able to find any solution because I sadly do not know what this function is called.

Any help would be appreciated.

I have a similar setup using NGIX proxy manager but don't face this issue behind OpenWrt.

How is your Openwrt configured?

It seems your phone and HA are in a different subnet.

1 Like

The simplest solution is to add a static IP-hostname mapping on your local DNS server.
Make sure your DDNS client is configured to use the external DNS server.

1 Like

They are in the same subnet.

Example rule here:

1 Like

I tried below but it does not work.

config redirect
option target 'DNAT'
option src 'wan'
option proto 'tcp'
option src_dport '8123'
option dest_port '8123'
option src_ip ''
option dest 'lan'
option dest_ip ''
option name 'HA-local'

They need to be in different networks and subnets.

The traffic doesn't cross the routing plane/firewall.

You can use the DNS solution if you prefer to keep them in the same network.

1 Like