My local LAN is 192.168.2.1/24, My web server ip is 1921.68.2.250 but i want to now access all of my user visit my web server as a domain (imlenkon.com). like they enter browser imlenkon.com its go to 192.168.2.250.
Do you have your domain DNS/DDNS name registered with your WAN IP address?
If yes, then you can do it with NAT.
These 3 lines will make your web server accessible from internet and also from LAN by your domain name:
/ip firewall filter
add action=accept chain=forward comment="Accept dstnat pinholes" connection-nat-state=dstnat
/ip firewall nat
add action=dst-nat chain=dstnat comment="WAN to web server" dst-address-type=local dst-port=80,443 protocol=tcp to-addresses=192.168.2.250
add action=masquerade chain=srcnat comment="LAN to web server" dst-address=192.168.2.250 protocol=tcp src-address=192.168.2.1/24
Edit: Thank you Sob, dst-port corrected
If it’s just web server, it’s good idea to have dstnat rule with dst-port=80,443, otherwise all ports will go there.
[quote=“Pea”]Do you have your domain DNS/DDNS name registered with your WAN IP address?
If yes, then you can do it with NAT.
These 3 lines will make your web server accessible from internet and also from LAN by your domain name:
/ip firewall filter
add action=accept chain=forward comment="Accept dstnat pinholes" connection-nat-state=dstnat
/ip firewall nat
add action=dst-nat chain=dstnat comment="WAN to web server" dst-address-type=local dst-port=80,443 protocol=tcp to-addresses=192.168.2.250
add action=masquerade chain=srcnat comment="LAN to web server" dst-address=192.168.2.250 protocol=tcp src-address=192.168.2.1/24
Thnx for your Reply,
I don’t need to access from internet, i need only from my Local network IP to Domain name Like 192.168.2.250 convert to imlenkon.com, then user just enter their browser imlenkon.com then access 192.168.2.250 how is it possible???
If users have router as DNS resolver, you can do:
/ip dns static
add address=192.168.2.250 name=imlenkon.com
I try this but not working
after that you have to enable allow remote request in /ip dns and use your router ip address as your dns server ip in your pc.