/ip firewall nat add action=netmap chain=dstnat dst-address=WAN_IP dst-port=443,80 protocol=tcp to-addresses=192.168.10.10
thanks for your reply, but still can not enter from local lan.. i can from outside of the office..try to add this oneCode: Select all/ip firewall nat add action=netmap chain=dstnat dst-address=WAN_IP dst-port=443,80 protocol=tcp to-addresses=192.168.10.10
after you dst-nat from global to LAN, add these 2 rules:
ip firewall nat
add action=dst-nat chain=dstnat dst-address="your global IP" dst-port=80 in-interface="LAN interface for your web server"
protocol=tcp src-address=192.168.10.0/24 to-addresses=192.168.10.10 to-ports=80
add action=masquerade chain=srcnat dst-address=192.168.10.10 dst-port=80 out-interface="LAN interface for your web server" protocol=tcp src-address=192.168.10.0/24
how would you change what he said?It is better to do src-nat with specified IP instead of masquarade.
Set only three rules. Simple dst-nat for connectivity from Internet and my previous 2 rules to hook the global IP from LAN. With this setup I have web access to web resource with global IP from LAN.
First rule is
ip firewall nat
add action=dst-nat chain=dstnat dst-port=80 in-interface="your global interface"
protocol=tcp to-addresses=192.168.10.10 to-ports=80
ether1 is LAN interface or WAN?
your 9 and 10 rules must have LAN interface. 9 rule in and 10 is out
What rule exacly? Maybe your LAN interface belongs to some master port or bridge? Then, you need point this bridge or master port in 9 and 10 rules. Or you have to extract this port from bridge or slave entity. You have to point LAN interface of your web server, otherwise you can't establish hairpin nat mechanic.ether1 is LAN interface or WAN?
your 9 and 10 rules must have LAN interface. 9 rule in and 10 is out
ether1 is my wan.. but if i put the etherX where i have my server, it doesn't let me finish the rule, an error pop out
What rule exacly? Maybe your LAN interface belongs to some master port or bridge? Then, you need point this bridge or master port in 9 and 10 rules. Or you have to extract this port from bridge or slave entity. You have to point LAN interface of your web server, otherwise you can't establish hairpin nat mechanic.ether1 is LAN interface or WAN?
your 9 and 10 rules must have LAN interface. 9 rule in and 10 is out
ether1 is my wan.. but if i put the etherX where i have my server, it doesn't let me finish the rule, an error pop out
I'm talking about 9 and 10 rules only. Forget about classic masquerade. Change interfaces on them.What rule exacly? Maybe your LAN interface belongs to some master port or bridge? Then, you need point this bridge or master port in 9 and 10 rules. Or you have to extract this port from bridge or slave entity. You have to point LAN interface of your web server, otherwise you can't establish hairpin nat mechanic.ether1 is LAN interface or WAN?
your 9 and 10 rules must have LAN interface. 9 rule in and 10 is out
ether1 is my wan.. but if i put the etherX where i have my server, it doesn't let me finish the rule, an error pop out
now you say that, i have this rule, created by mikrotik itself, i never wrote this.
chain=srcnat action=masquerade out-interface=ether1 log=no log-prefix=""
I'm talking about 9 and 10 rules only. Forget about classic masquerade. Change interfaces on them.What rule exacly? Maybe your LAN interface belongs to some master port or bridge? Then, you need point this bridge or master port in 9 and 10 rules. Or you have to extract this port from bridge or slave entity. You have to point LAN interface of your web server, otherwise you can't establish hairpin nat mechanic.ether1 is LAN interface or WAN?
your 9 and 10 rules must have LAN interface. 9 rule in and 10 is out
ether1 is my wan.. but if i put the etherX where i have my server, it doesn't let me finish the rule, an error pop out
now you say that, i have this rule, created by mikrotik itself, i never wrote this.
chain=srcnat action=masquerade out-interface=ether1 log=no log-prefix=""
@rodrigobenta, please share me all rules. i want give a hug toomen, you are a f********ng GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOD! if i could, i would go to you and give you a hug men jaja
@Anumrak, your solution have not worked for me.I'm talking about 9 and 10 rules only. Forget about classic masquerade. Change interfaces on them.
/ip firewall nat export
add action=masquerade chain=srcnat dst-address=192.168.0.52 dst-port=629 out-interface=Local protocol=tcp src-address=192.168.0.0/24
add chain=srcnat src-address=192.168.0.52 protocol=tcp src-port=629 out-interface=Local action=srcnat to-addresses=1.1.1.10 to-ports=629
i added too this src-nat rule. should i remove dst-nat rule?So I would manually add another srcnat rule, mirroring the dstnat one which would translate the destination IP of the request from 1.1.1.10 to 192.168.0.52:
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=ether1
add action=dst-nat chain=dstnat dst-address=192.168.5.173 dst-port=22 protocol=tcp to-addresses=192.168.5.1
/ip firewall connection print detail where src-address~":22" || dst-address~":22" || reply-src-address~":22" || reply-dst-address~":22"
Flags: E - expected, S - seen-reply, A - assured, C - confirmed, D - dying, F - fasttrack, s - srcnat, d - dstnat
0 SAC Fsd protocol=tcp src-address=192.168.88.253:54434 dst-address=192.168.5.173:22 reply-src-address=192.168.5.1:22
reply-dst-address=192.168.5.173:54434 tcp-state=established timeout=23h45m orig-packets=18 orig-bytes=2 356 orig-fasttrack-packets=0
orig-fasttrack-bytes=0 repl-packets=19 repl-bytes=2 893 repl-fasttrack-packets=9 repl-fasttrack-bytes=1 713 orig-rate=0bps repl-rate=0bps
here are my firewall filters:Can you please paste here the export of your "/ip firewall filter" rules?
;;; PROXY-ATAK-DROP
chain=input action=drop protocol=tcp in-interface=RADIO-LINK dst-port=8080 log=no
log-prefix=""
;;; PROXY-ATAK-DROP
chain=input action=drop protocol=tcp in-interface=VDSL-ETH dst-port=8080 log=no
log-prefix=""
;;; DNS-ATAK-DROP
chain=input action=drop protocol=tcp in-interface=VDSL-ETH dst-port=53 log=no
log-prefix=""
;;; DNS-ATAK-DROP
chain=input action=drop protocol=tcp in-interface=RADIO-LINK dst-port=53 log=no
log-prefix=""
Hi Anumrak, for your described 4 rules, i checked my rules again. now my rules are shown like this:add action=src-nat chain=srcnat out-interface=Local protocol=tcp src-address=192.168.0.52 src-port=629 to-addresses=1.1.1.10 to-ports=629
Wrong idea.
You need only 4 NAT rules:
1) Classic masquerade for your local network in order to go to Internet;
2) Destination NAT IN rule for your provider interface in order to get access to your web server from outside;
3) Destination NAT IN rule for your LAN interface in order to translate IP packets from global destination to local destination;
4) Source NAT OUT rule for your LAN interface in order to translate IP packets from local source ip to your router's IP.
And absence of different firewall rules which can do collision of packets flow.
This is the server which I want to reach in local network.What is the device 192.168.0.52?
What exactly is this server? Does it have iptables or something?This is the server which I want to reach in local network.What is the device 192.168.0.52?
i want to reach to local server (192.168.0.52) in local network (my local ip: 192.168.0.195) with external ip (1.1.1.10). (My external IP is static)
When i try reach from out network (e.g. 2.2.2.2) to (1.1.1.10) -> SUCCESS
When i try reach from in network (192.168.0.195) to (192.168.0.52) -> SUCCESS
When i try reach from in network (192.168.0.195) to (1.1.1.10) -> FAIL : ERR_CONNECTION_REFUSED
This is QNAP NAS server.What exactly is this server? Does it have iptables or something?
Anumrak can help?Your welcome![]()
add action=dst-nat chain=dstnat dst-address=GLOBALIP dst-port=80 protocol=tcp src-address=!192.0.0.0/23 to-addresses=192.0.0.13 to-ports=80
add action=dst-nat chain=dstnat dst-address= GLOBALIP dst-port=80 in-interface=bridge1 protocol=tcp src-address=192.0.0.0/23 to-addresses=192.0.0.13 to-ports=80
add action=masquerade chain=srcnat dst-address=192.0.0.13 dst-port=80 out-interface=bridge1 protocol=tcp