I would like to point my custom domain to LXC container running on Omnia which is connected to another router accessing the internet. I’m not sure how to configure “Dynamic DNS” to obtain public IP, because my WAN IP is local IP assigned to Omnia by another router.
I suppose I need to set “Hostnames” and some “Firewall” rules as well, right?
Could you please explain the required steps to me? Thank you.
If you do not have a public IP (fixed or floating) or do not have port forwarding enabled by the ISP, then it will not work for you. DDNS is used for domain name changes of public IP (sometimes for free domain reasons).
Here you will find out your public IP: https://www.mojeip.cz/ and if you do not get from the IP to the device, then the domain will not help.
If your uplink router has a public IP you need to have a port forward from your uplink router to your TO and then from your TO to your LXC Container. If your TO is the only network client of your uplink router you can set your TO as a DMZ client, so that all traffic gets forwarded to it (so no need for additional port forwards on your uplink router). Make sure your TO has a static IP so that port forwards/DMZ always points to correct ip.
In DDNS settings (advanced settings -> ip source adress) you can define how the DDNS script should obtain the public ip. Select URL and use e.g. http://checkip.dyndns.com, so that the script uses your outbound ip (which should be your public ip).
EDIT:
If you want to access your LXC Container from inside your lan with the same URL as from the outside you can add a static address record for it with its local ip adress as described here: https://doc.turris.cz/doc/en/public/dns_knot_misc
That would be the next step. First, it must gain access from the public IP and if it is behind NAT (it has a local IP on the WAN) then there will be a problem.
But if he is in control
of his upstream router (which I assumed) he can set up port forwarding on both routers, which should work, even if it‘s a double-nat setup
I still don’t understand how can I route it to LXC container. Do I have to set anything in Network>Hostnames or Network>Firewall or elsewhere? Traceroute shows request is forwarded to TO:
1 * 192.168.1.1 (192.168.1.1) 1.839 ms 1.491 ms
2 192.168.0.1 (192.168.0.1) 1.953 ms 1.305 ms 1.820 ms
3 * * *
…
@RomanHK ok, I have the domain pointing to mine public IP. What’s next? How can I forward it to LXC container? I tried Firewall - Port Forwards but couldn’t get it working. Thanks.
You need to set up a port forward on your Upstream router from your Upstream Router to the IP and port of your TO of the port forward you set up on your TO, too
EDIT:
<public ip>:<public port> -> Upstream Router -> Port forward from <public ip>:<public port> to <TO ip>:<TO port> -> TO -> Port forward from <TO ip>:<TO port> to <LXC ip>:<LXC port> -> LXC container
The problem is, I have this shitty router “UBEE UVW3226” from UPC and I have no idea how to properly forward ports or use it as DMZ client because there is no such option.
I know, but my router doesn’t have such settings. Probably different software version or something. I have to get through their support which is a real challenge .