Community discussions

MikroTik App
 
enricosm60
just joined
Topic Author
Posts: 6
Joined: Tue Nov 14, 2023 11:22 pm

run docker app as hostname from wireguard peer

Fri Mar 15, 2024 2:14 am

Hello to everyone,
I would like to know how to setup my MK Hex S router to be able to run from the WireGuard peer a docker instance located on a server (Synology NAS) using the docker app hostname instead of the app local server IP:port.

I have the MK router running WireGuard; this router is behind the ISP modem which is in bridge mode; also the MK router does have a static public IP assigned form ISP.

This docker app does have a hostname on the Synology so when on the local LAN I can start the app both writing on the browser the Synology LAN ip and the docker app designated port OR just write on the browser the hostname. For example on this scenario I write on browser http://192.168.88.2:12101 or http://fs23a01 and then in both cases I can run the same docker app.

But when I connect to the WireGuard (configured on the MK router) I can access from the VPN the docker app whit the NAS local IP as above (http://1982.168.88.2:12101) but I cannot do the same whit the hostname http://fs23a01, because the browser is not resolving the hostname. I guess this because in this last case I'm connecting to the MK router public IP instead of the local and I have no idea how to configure the MK to do the same as when I'm local.

This docker hostname has been setup on the Synology NAS web station add-on package:https://www.synology.com/en-global/dsm/ ... WebStation

I would like to start the docker app when on WireGuard tunnel using the hostname because It is much easier to remember this, instead of the lan IP and port.

I'm including my MK router configuration and some Synology and browser screen capture.
HEXS_PTY55_240313AX.txt.rsc
Synology NAS hostname config
Synology NAS hostname config.png
Docker app from hostname (local only)
Docker app from hostname (only local).png
Docker app from LAN
Docker app from LAN.png
Please if someone can give me some help to this ir would be much appreciated.

Sincerely,

Enrico
You do not have the required permissions to view the files attached to this post.
 
enricosm60
just joined
Topic Author
Posts: 6
Joined: Tue Nov 14, 2023 11:22 pm

Re: Synology run docker app as hostname from wireguard peer

Wed Mar 20, 2024 4:56 am

Hello everybody,

Well I luckly found by myself the solution to the issue above. The trick is to use the .lan extension for both on the Synology NAS Web Station app and also on the Mikrotik router DSM static settings.

The procedure is as follow:
1. On the Synology NAS, once created the container and checked that it runs whit no issues, then stop the container proyect and on Container Manager / Proyect / Settings / Web Portal, check this option and configure the 3 related boxes whit the default name of the proyect, port, and chose if http or https (I use http because the only way to access this container is from WireGuard), then restart the proyect.
Synology Web Portal1.png
2. Continue on the NAS and go to app Web Station / Web Service, and there select the desider customized portal to configure it as the screen capture below.
Synology Web Portal1.png
3. Then on the MK router open WinBox and go to IP / DNS / Static and there add the hostnames created on the Synology NAS as showed on the capture below.
MK DNS Static1.png
4. On the WireGuard peer configuration add on the Interface DNS the ip of your MK router.
[Interface]
PrivateKey = ""
Address = 192.168.250.250/32
DNS = 1.1.1.1, 1.1.1.2, 192.168.88.1


Then when connected remote using the WireGuard open your pc/laptop browser and simply write the http://hostname.lan and the docker app starts. No need to remember host ip and port.

Enrico
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: robertkjonesjr, Totten98 and 16 guests