Page 1 of 1

Redirecting Problems

Posted: Sat Jul 13, 2019 2:17 am
by ronylove
Dear, good afternoon.
I would like to ask for your cooperation in this problem that I have.
I have a RB configured with internet access
- Segment 192.168.0.1/24 (IP of the Router)
- LAN

* PC2 = 192.168.0.3 user with fixed IP
* PC3 = 192.168.0.4 local web server

What I want is that people who try to enter my RB and digitize the IP (192.168.0.1), this automatically sends them to the IP of the local Web server (192.168.0.4)
The rule you use is:
- Firewall ==> NAT ==>
chain = dstnat Dst. Address = 192.168.0.1 protocol = tcp Dst.Port = 80 action = dst-nat To Addresses = 192.168.0.4 To Ports = 80

But when I do the test, the page goes blank and does not load anything.

Re: Redirecting Problems

Posted: Sat Jul 13, 2019 4:28 am
by 2frogs
You also need a src-nat:
/ip firewall nat
add action=src-nat chain=srcnat src-address=192.168.0.0/24 dst-address=192.168.0.4 to-address=192.168.0.1

Re: Redirecting Problems

Posted: Tue Jul 16, 2019 12:51 am
by ronylove
thanks for answering "2frogs".
I would like to see if I understood. Apart from the rule I put above, I need to place the srcnat rule.

Thank you.

Re: Redirecting Problems  [SOLVED]

Posted: Tue Jul 16, 2019 3:33 am
by 2frogs
That is correct, you need both rules.