Page 1 of 1
how to redirect http traffic to another gateway on Mikrotik
Posted: Sat Jan 26, 2013 11:00 am
by wilepro
how to redirect http traffic to another gateway on Mikrotik
Re: how to redirect http traffic to another gateway on Mikro
Posted: Sun Jan 27, 2013 8:06 am
by vixxant
what your asking for is not clear
here is a example of a dst nat rule . if this is what your looking for
ip firewall nat add dst-address=(WAN-IP) dst-port=80 action=dst-nat to-addresses=(LAN-IP-WEBSERVER) to-ports=80
Re: how to redirect http traffic to another gateway on Mikro
Posted: Sun Jan 27, 2013 11:42 am
by mixig
Hi,
if I understood you have two wan ports on MKT (WAN1, WAN2), WAN1 is default route in our scenario, WAN2 will be used for HTTP traffic which will be coming from local computers.
1) we must mark web traffic which is coming to mikrotik (ip firewall mangle)- put that rule on the top of the mangle (change in-interface LAN with your real local interface)
/ip firewall mangle
add chain=prerouting action=mark-routing new-routing-mark=web_traffic passthrough=no protocol=tcp dst-address-type=!local in-interface=LAN dst-port=80
2) we must create default route for that traffic (in our case it is WAN2)
/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=WAN2 routing-mark=web_traffic scope=30 target-scope=10
Re: how to redirect http traffic to another gateway on Mikro
Posted: Mon Jan 28, 2013 8:57 pm
by wilepro
ok this is what I want, but how can I test if it really works
thanks
Re: how to redirect http traffic to another gateway on Mikro
Posted: Mon Jan 28, 2013 9:57 pm
by mixig
you can see in torch, or you can open the browser and go to
www.whatismyip.com
if your address is ip address from WAN2 then it works
Re: how to redirect http traffic to another gateway on Mikro
Posted: Tue Jan 29, 2013 10:24 am
by wilepro
is not work
Re: how to redirect http traffic to another gateway on Mikro
Posted: Tue Jan 29, 2013 3:02 pm
by mixig
ip firewall mangle export
ip route export
copy/pase the config
Re: how to redirect http traffic to another gateway on Mikro
Posted: Wed Jan 30, 2013 5:59 pm
by wilepro
is not work please help me this my configuration
Wan1 192.168.1.2/24 gateway1 192.168.1.1
Wan2 192.168.5.25/24 Gateway2 192.68.1.20
lan 192.168.100.254/24
please
Re: how to redirect http traffic to another gateway on Mikro
Posted: Wed Jan 30, 2013 11:27 pm
by mixig
ok, first thing, your wan2 has wrong gateway, it`s not in the same network as your wan2 interface...
Re: how to redirect http traffic to another gateway on Mikro
Posted: Thu Jan 31, 2013 8:13 pm
by wilepro
is 192.168.5.20 help to configure my router
Re: how to redirect http traffic to another gateway on Mikro
Posted: Fri Feb 01, 2013 9:30 am
by wilepro
good thanks you !!!!