Community discussions

MikroTik App
 
captainproton
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 72
Joined: Sat Jan 12, 2008 3:01 pm

2 gateways

Sun Mar 01, 2009 9:07 pm

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?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: 2 gateways

Sun Mar 01, 2009 10:26 pm

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.