Add Multiple Gateways

I have two ADSL Routers on the same networks

192.168.1.1 and 192.168.1.2

And I have one RB433 with Eth1 = 192.168.1.200 and I am running a hotspot

I can configure 2 * Gateways via ip/routes then add then manually.

BUT what I want to do is be able to change the gateway ip address progmatically ?

eg /ip route/add gateway 192.168.1.1

What I want to be able to do is some have the following combinations when it suites me.

  1. 192.168.1.1 only
  2. 192.168.1.2 only
  3. 192.168.1.1,192.168.1.2 (two gateways at same time, I can share them based on alternate routing for each user as they logon)

Can anyone assist me here.

Regards

Piri

You’d do well to have a read over the PCC configuration template I’ve written up.

http://www.mikrotik-routeros.com/?p=12

However you can also work with a few routing marks and mangle rules to do a simple version:

Eg:

/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=force-via-dsl1 scope=30 target-scope=10
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.2 routing-mark=force-via-dsl2 scope=30 target-scope=10

/ip firewall mangle
add comment="force certain traffic over DSL2" disabled=no in-interface=ether1 dst-address-type=!local chain=prerouting dst-address=198.51.100.0/24 action=mark-routing new-routing-mark=dsl2 passthrough=no
add comment="normal traffic" disabled=no in-interface=ether1 dst-address-type=!local chain=prerouting action=mark-routing new-routing-mark=dsl1 passthrough=no