Hello all, I can’t do functional dstnat and I don’t know why.
I do dstnat for public ip address, port 80, to access pc from LAN.
ether1 - public ip - 100.0.0.50
ether2 - subnet 192.168.1.0/24, ip 192.168.1.1, nat to public ip
pc with web in ether2 - 192.168.1.66
I need dst nat from 100.0.0.50:80 to 192.168.1.66:80
When dstnat is not applied, MikroTik WebManagement is displayed in browser.
I used standart dstnat as I found everywhere.
When I put address to browser, this still waiting.
When dstnat is applied, log in firewall filter rules is not processed,
only prerouting log show me connection.
What firewall filter rule? Please post the output of “/ip firewall export”.
Also ensure that the host you’re forwarding to has a correct route back (probably a default route to the router IP on the interface the host is behind).
To ether1 is connected notebook with IP address 10.0.0.50
To ether2 is connected PC with Apache and IP address 192.168.2.44
From notebook I do http://10.0.0.51/ and browser still waiting for response.
Some basic setting missing probably, help please.
These host can’t talk normally, apache is on private site and ether1 is public site. Only port 80 can be opened from public site to Apache. Apache server ip is 192.168.2.44, mask 255.255.255.0, gateway 192.168.2.1. Thank you guys.
And just to verify, you are testing from outside the network and not from behind the router?
This is problem on real configuration. But I need access public IPs from internal site too.
Please how can I change config to this can work? Thank you.
If you need to access the public IP from the inside you have to hairpin NAT the traffic. You will lose the ability to track inside users by IP on the web server.
Fewi you are King, thank you, it works! I don’t exactly understand what you mean: "You will lose the ability to track inside users by IP on the web server. " In Apache log is gateway 192.168.1.1 record, but it is access of public address from NATed LAN, so I think this is ok becouse subnet is NATed to public address and all clients looks as one address on internet.
It means that all inside users that are on the same subnet as the server will appear to the web server as the router IP address when they access the server via its public IP address. If you can live with that you’re all set. Unfortunately there is no workaround to that side effect.
Hm, I have one more probably problematic question.
When I have two subnets 192.168.1.0/24 and 192.168.2.0/24
Every subnet has NATed public address 10.0.0.1 and 10.0.0.2
and dstnated port 80 to any LAN computer.
With new rule, I’m able access 10.0.0.1 from 192.168.1.0/24
and access 10.0.0.2 from 192.168.2.0/24.
Is it possible access cross public ie. 10.0.0.1 from 192.168.2.0/24?
Unless I am mistaken that should be working without any additional configuration. If it doesn’t try duplicating those hairpin NAT rules setting the src-address qualifier to the other LAN network.