Self-host - Access resource using local IP address

Describe the problem

I have a webmail app listed as a resource [webmail.example.com (name)->192.168.1.120 (address)] in one of my Netbird networks. The webmail login page is publicly accessible (e.g.,webmail.example.com), however, some accounts are set to local-only access. This means the login page is always publicly accessible, but some accounts can only be logged into from a private IP address range.

I can access the login page just fine from my Android mobile phone (which has the Netbird app installed & enabled) while using the cellular connection. When I try to login from my phone, the webmail system detects my phone’s public IP address so I cannot login because my account is restricted to local access only.

On my phone, in the Netbird app, I do have split tunneling mode set to Off so all apps use the Netbird VPN. I also have the webmail.example.com resource enabled in the Netbird client app settings.

Is there a way to specify which IP address is forwarded to a Netbird resource? The public IP of the device or the Netbird peer IP address? I would think that the private IP address would be forwarded since all traffic is set to use the Netbird VPN.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the URL of the resource (https://webmail.example.com)
  2. Enter login credintials
  3. Get error that Remote access is forbidden.

Expected behavior

Be able to login. I want my private IP address forwarded to this webmail app, not the public IP of my phone.

Are you using NetBird Cloud?

No. Self-host NetBird’s control plane.

NetBird version

v0.79.0

Is any other VPN software installed?

No

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings

I did more testing. I have another app that uses the same URL/IP address but listens on a different port (8465). I cannot access that app from my phone’s cellular connection even though I have All set for protocols and ports in the Access Control policy for this resource.

What am I doing wrong?

I know I tried this before, but it made no difference, earlier.

I edited the webmail app resource, on the Netbird server. I changed…

From: webmail.example.com (name)->192.168.1.120 (address)
To: webmail.example.com (name)->webmail.example.com (address)

As of now, I’m able to login to the webmail app and also access the other app via port 8465.

Have you tried setting up a routing peer to access your home LAN subnet via NetBird?

That seems the simplest solution to your issue

Yes. I already have two routing peers.

For reasons I don’t know, the fix seems to be to specify the hostname when creating the resource rather than specifying its local IP address.

You need to have custom dns setup on your phone to use the IP of the netbird machine/server/etc, quite possibly setting it up so you either have your own nameserver or you use Netbird’s.

If this doesn’t work, there could be secure dns somewhere on your phone interffering with the setup.