Community discussions

MikroTik App
 
wilsongamo
newbie
Topic Author
Posts: 45
Joined: Thu Jan 22, 2015 1:22 pm

how to redirect traffic from an IP address to another way

Thu Apr 23, 2015 11:24 am

Hello All
My lan its 193.190.15.0/24
My comptuer 193.190.15.9
GW1 1.1.1.1
GW2 1.1.2.2

all my network computers using the GW1
want to know how to make the 193.190.15.9 uses GW2

Thanks
 
adyb76
Trainer
Trainer
Posts: 48
Joined: Sun Sep 25, 2011 11:45 am

Re: how to redirect traffic from an IP address to another way

Thu Apr 23, 2015 2:17 pm

You need to use IP firewall mangle rule to add a route mark to packets from the IP you want to leave via the different gateway and add a default rule specifying the gateway and the packet mark.
I don't have a router board to hand right now, but the script it along these lines:

/ip firewall mangle add chain=forward src-address=193.190.15.9 action=mark-routing new-routing-mark=via-gw2
/ip route add dst-address=0.0.0.0/0 gateway=1.1.2.2 routing-mark=via-gw2

Hope this helps.

Ade
 
wilsongamo
newbie
Topic Author
Posts: 45
Joined: Thu Jan 22, 2015 1:22 pm

Re: how to redirect traffic from an IP address to another way

Thu Apr 23, 2015 4:08 pm

chain forward is not working
 
adyb76
Trainer
Trainer
Posts: 48
Joined: Sun Sep 25, 2011 11:45 am

Re: how to redirect traffic from an IP address to another way

Thu Apr 23, 2015 5:35 pm

My bad, it should be prerouting chain

Who is online

Users browsing this forum: Ahrefs [Bot] and 89 guests