Page 1 of 1

Use WAN IP on LAN

Posted: Tue Feb 23, 2016 3:55 pm
by tomassp
Hi!

I'm using RB850Gx2 (powerpc) with 6.34.2 installed. There is no any specific configuration, just DHCP, some NAT rules for port forwarding and some reserved IP addresses by MAC address.
What I want is allow use WAN IP addresses in LAN. For example - one NAS drive with IP address 10.0.0.39, I can connect to ftp by ftp://10.0.0.39:21 from LAN. I'm configured that IP address to port forwarding, so I can access ftp on that NAS from outside using ftp://some.ip.address:4040. But I want that I can access ftp from outside IP in LAN. How can I do that?

Thanks!

Re: Use WAN IP on LAN

Posted: Tue Feb 23, 2016 4:55 pm
by kiaunel
Hi!

I'm using RB850Gx2 (powerpc) with 6.34.2 installed. There is no any specific configuration, just DHCP, some NAT rules for port forwarding and some reserved IP addresses by MAC address.
What I want is allow use WAN IP addresses in LAN. For example - one NAS drive with IP address 10.0.0.39, I can connect to ftp by ftp://10.0.0.39:21 from LAN. I'm configured that IP address to port forwarding, so I can access ftp on that NAS from outside using ftp://some.ip.address:4040. But I want that I can access ftp from outside IP in LAN. How can I do that?

Thanks!
HairpinNat is what you need
ip firewall nat
add chain=srcnat src-address=10.0.0.0/24 \
dst-address=10.0.0.39 protocol=tcp dst-port=21\
out-interface=LAN action=masquerade

Re: Use WAN IP on LAN

Posted: Tue Feb 23, 2016 4:59 pm
by gotsprings
/ip firewall nat add action=masquerade chain=srcnat dst-address=10.0.0.0/24 out-interface=\
    ether2-master-local src-address=10.0.0.0/24
Put that after your Masquerade rule. It will make all your port forwards work that have a dst-address in them rather than an interface.