Page 1 of 1

2 gateways

Posted: Sun Mar 01, 2009 9:07 pm
by captainproton
hey,

I have two gateways connected to the wan side of a mikrotik router.
on the lan side, i have a pppoe server for customers connections.
so the local address (server IP) is the same for everyone.

I want to devide the customers in groups by sorting them into 2 different subnets. (remote addresses)
group nr. 1 should be forwarded to gateway nr. 1
group nr. 2 to gateway nr 2

I tried severel routing rules and paket marks but with two gateways running at the same time it never works. only when disabling one.

so, that does not work as easy as i thought. any suggestions?

Re: 2 gateways

Posted: Sun Mar 01, 2009 10:26 pm
by SurferTim
Don't know exactly what you want, but here is a simple routing-mark example. Wlan2 goes out ether2, and all else goes out ether1:
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=ether2out in-interface=wlan2

These must be in this order:
/ip firewall nat add chain=srcnat action=masquerade routing-mark=ether2out out-interface=ether2
/ip firewall nat add chain=srcnat action=masquerade out-interface=ether1

Change the mangle to whatever you need to go out ether2. Like src-address maybe?

ADD: You can also use that routing mark in "/ip route" for different gateways in the same subnet (interface) if that is what you need.