I’ve got my new RB2011UiAS-RM 6.33.3 up and running and have some questions.
1:
I have a domain. Lets call it “home.mydomain.dk”.
I can’t access this from my LAN and my Squeezebox Server (web interface) is running on this but if I use the LAN IP (10.0.1.2:9002) it works without issues. It works from the WAN side.
2:
I have a NAS. It’s called “nas” on my LAN.
I can ping this address from a Windows PC, but not my Linux PC (xubuntu). On my Linux PC I have to add “.local” to ping it. Ping “nas.local” works. I think it’s a Linux issue, but can I fix it from my Mikrotik router?
First, make your NAT pinhole configuration to be “hairpin friendly”
You probably have a dstnat rule that looks something like this:
chain=dstnat action=dst-nat to-addresses=10.0.1.2 protocol=tcp dst-port=9002 in-interface=ether1-gateway
If so, then remove the in-interface criteria, and add dst-address=x.x.x.x (your public IP)
If your public IP is dynamic, then use dst-address-type=local dst-address=!10.0.0.0/8
Second, add the hairpin rule:
chain=srcnat action=masquerade out-interface=LAN src-address=10.0.1.0/24
Problem 2: DNS suffix
nas.local is a FQDN (fully-qualified domain name)
nas is just a hostname. When you type an unqualified hostname (doesn’t end with a full domain like mydomain.dk) then the computer is going to silently try using whatever it thinks the local domain is. So if you told your computer that the domain suffix is mydomain.dk, then if you type “ping nas” - the computer is going to try to look up the IP for “nas.mydomain.dk” - and any other domain suffixes you may specify…
Your NAS is in your local DNS as the FQDN: nas.local
You have two ways to fix this:
tell the linux box that the domain suffix is “local”
tell the NAS that the local domain suffix is “mydomain.dk”
The reason it’s working on the Windows box is that Windows will try .local as a possible domain suffix, in addition to the domain it’s been told to use.
You need to setup HairPin NAT or Split Horizon DNS.
Using first solution is simpler but generates traffic and uses router CPU.
The second is more complicated but better if you expect large traffic from local network to your servers