Community discussions

MikroTik App
 
wilepro
just joined
Topic Author
Posts: 18
Joined: Wed Jun 09, 2010 3:44 pm

how to redirect http traffic to another gateway on Mikrotik

Sat Jan 26, 2013 11:00 am

how to redirect http traffic to another gateway on Mikrotik
 
User avatar
vixxant
newbie
Posts: 38
Joined: Thu Mar 17, 2011 7:36 pm
Contact:

Re: how to redirect http traffic to another gateway on Mikro

Sun Jan 27, 2013 8:06 am

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
 
mixig
Member
Member
Posts: 316
Joined: Thu Oct 27, 2011 2:19 pm

Re: how to redirect http traffic to another gateway on Mikro

Sun Jan 27, 2013 11:42 am

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
 
wilepro
just joined
Topic Author
Posts: 18
Joined: Wed Jun 09, 2010 3:44 pm

Re: how to redirect http traffic to another gateway on Mikro

Mon Jan 28, 2013 8:57 pm

ok this is what I want, but how can I test if it really works
thanks
 
mixig
Member
Member
Posts: 316
Joined: Thu Oct 27, 2011 2:19 pm

Re: how to redirect http traffic to another gateway on Mikro

Mon Jan 28, 2013 9:57 pm

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
 
wilepro
just joined
Topic Author
Posts: 18
Joined: Wed Jun 09, 2010 3:44 pm

Re: how to redirect http traffic to another gateway on Mikro

Tue Jan 29, 2013 10:24 am

is not work
 
mixig
Member
Member
Posts: 316
Joined: Thu Oct 27, 2011 2:19 pm

Re: how to redirect http traffic to another gateway on Mikro

Tue Jan 29, 2013 3:02 pm

ip firewall mangle export

ip route export

copy/pase the config
 
wilepro
just joined
Topic Author
Posts: 18
Joined: Wed Jun 09, 2010 3:44 pm

Re: how to redirect http traffic to another gateway on Mikro

Wed Jan 30, 2013 5:59 pm

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
 
mixig
Member
Member
Posts: 316
Joined: Thu Oct 27, 2011 2:19 pm

Re: how to redirect http traffic to another gateway on Mikro

Wed Jan 30, 2013 11:27 pm

ok, first thing, your wan2 has wrong gateway, it`s not in the same network as your wan2 interface...
 
wilepro
just joined
Topic Author
Posts: 18
Joined: Wed Jun 09, 2010 3:44 pm

Re: how to redirect http traffic to another gateway on Mikro

Thu Jan 31, 2013 8:13 pm

is 192.168.5.20 help to configure my router
 
wilepro
just joined
Topic Author
Posts: 18
Joined: Wed Jun 09, 2010 3:44 pm

Re: how to redirect http traffic to another gateway on Mikro

Fri Feb 01, 2013 9:30 am

good thanks you !!!! :lol: