I
I
Ivan Eliseev2017-09-12 09:52:20
Mikrotik
Ivan Eliseev, 2017-09-12 09:52:20

How to route individual users in mikrotik?

Hey!
Does anyone know the routing methods for mikrotik users?
Well, for example, I have two channels and one vpn entering Mikrotik.
It is necessary to throw the separate user on other route. Users, for the time being, via normal dhcp, but I think that for such purposes it will be necessary to connect them via vpn so that it is possible to shoot into separate routes. Has anyone already implemented this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wexter, 2017-09-12
@ivaneliseeff

create default routes with markings

/ip route add dst-address=0.0.0.0/0 gateway=1.1.1.1 routing-mark=ISP1
/ip route add dst-address=0.0.0.0/0 gateway=2.2.2.2 routing-mark=ISP2
/ip route add dst-address=0.0.0.0/0 gateway=3.3.3.3 routing-mark=VPN

at the entrance through the mangle, hang the routing-mark according to the desired src-address
/ip firewall mangle add chain=prerouting src-address=192.168.0.2 action=mark-routing new-routing-mark=ISP1
/ip firewall mangle add chain=prerouting src-address=192.168.0.3 action=mark-routing new-routing -mark=ISP2

at the output in nat do src-nat/masquerade by marking
/ip firewall nat add chain=src-nat action=src-nat routing-mark=ISP1 to-addresses=1.1.1.2
/ip firewall nat add chain=src-nat action=masquerade routing-mark=ISP2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question