setting up routeros with multiple WANs

Hi all,

Could someone advise me on the best way of setting up routerOS to handle multiple wan connections and if my planned setup will be supported?

My first gateway is BT - I have a BT business hub which I am planning to put into bridge mode. I have a single static IP with BT.
The second gateway is Virgin business and as I understand it, I cannot change virgin router to modem mode because it uses GRE connection to provide static IP, so I have requested from them a block of static IP addresses in the hope that I can assign one IP to a port on the mikrotik and use that as the second wan connection.

I would then like to configure a default WAN (BT) and then have the second WAN (Virgin) sitting idle, taking over if BT ever goes down.

I would also like the ability to switch any particular client device onto the virgin manually (If this can be done via terminal that would be ideal because I can then have a script that I run on my computer, to send a terminal command to the router in order to switch over to the second WAN connection).

I am totally stuck and a bit out of my depth!

Here is what I have done so far - I connected BT router to Mikrotik eth1/wan. I set up PPPoE on eth1/wan, added credentials from BT and this is working.
I have DHCP configured via the Mikrotik router as well, and everything works fine.

What I am trying to do now, is add Virgin as a second WAN to the mikrotik with a view to -

a) setting up a dual WAN failover so if one line goes down, it automatically goes on to the other line and
b) if I wish, I can assign a particular client on my LAN to use one of the two WANs as its gateway

I have been given a /29 subnet by virgin - I have network IP, gateway etc. But I just don’t know how to configure this on the Mikrotik.

What I have tried so far is to connect the virgin router to Eth2 on Mikrotik, then I have added First usable IP and the network address into IP > address list on mikrotik.
Then I tried changing 0.0.0.0/0 in IP > routes to use gateway of eth2. then tried to ping 8.8.8.8 from client, but once I update the gateway in routes to eth2, ping fails.

If I put gateway back to pppoe-out2, ping works fine again.

Can someone help?

Can you post your config please so far.
When you do replace your public IP information ppooe, with fake numbers and fake passwords etc. (same with virgin numbers).

Since you want to maintain control over your routes, suggest do not add default route = yes in the pppoe settings but instead
set the route manually you can do this by going to winbox and looking at IP Routes now and pay attention to what
the settings are for the pppoe route (aka gateway IP etc).

Then add the route manually
add dst-address=0.0.0.0/0 gateway=ISP1gatewayIP table=main distance=1 check-gateway=ping

Once you have done that and it shows up on IP routes in winbox and looks okay then remove the add default route=yes in the pppoe settings!

Once you have added Virgin to IP DHCP settings… also do not USE add default route=yes, as we need to set this up manually
add dst-address=0.0.0.0/0 gateway=ISP2gatewayIP table=main distance=2


With those things done, all your traffic will only go to ISP1, unless not available and then it will switch to ISP2, until ISP1 is available again.
This is the very basic first step of failover. Lets just try to get there for now and worry about finessing it better after.

Sorry cannot help with Virgin settings, my level of knowledge on isp setups is woefully weak.

I have attempted to make those changes that you suggested. Here is my config after making the changes -
Hopefully I have obscured everything.

At the moment, it works in the primary gateway, but if i change those distances around, to make the second wan primary, it does not work.
also, on the route for second gateway in route list, it says unreachable, next to the gateway.

I dont know if this is strange or not, but if I just ping the gateway of wan2 from my computer, I get a reply. So I guess it is reachable in one way or another…

\

jul/12/2022 15:42:42 by RouterOS 6.47.10

software id = RH5L-ZD1A

model = RB750Gr3

serial number = CC230F7Fxxxx

/interface bridge
add admin-mac=DC:2C:6E:xx:xx:xx auto-mac=no comment=defconf name=bridge
/interface pppoe-client
add disabled=no interface=ether1 name=pppoe-out2 use-peer-dns=yes user=
btbusinesshub@business.btclick.com
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-server option
add code=3 name=option3 value=“‘192.168.2.252’”
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.2.10-192.168.2.200
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=ether2 list=WAN
add interface=pppoe-out2 list=WAN
/ip address
add address=192.168.2.1/24 comment=defconf interface=ether3 network=
192.168.2.0
/ip dhcp-client
add comment=defconf interface=ether1
/ip dhcp-server lease
add address=192.168.2.17 mac-address=E4:E7:49:xx:xx:xx
add address=192.168.2.12 mac-address=C0:3E:0F:xx:xx:xx
add address=192.168.2.27 mac-address=0C:C4:7A:xx:xx:xx
add address=192.168.2.30 mac-address=F0:9F:C2:xx:xx:xx
add address=192.168.2.31 mac-address=00:14:D1:xx:xx:xx
add address=192.168.2.38 mac-address=34:64:A9:xx:xx:xx
add address=192.168.2.34 mac-address=0C:C4:7A:xx:xx:xx
add address=192.168.2.15 mac-address=B0:5C:DA:xx:xx:xx
add address=192.168.2.21 mac-address=5A:B9:E7:xx:xx:xx
add address=192.168.2.19 mac-address=38:A6:CE:xx:xx:xx
add address=192.168.2.36 mac-address=90:02:18:xx:xx:xx
add address=192.168.2.18 mac-address=A8:66:7F:xx:xx:xx
add address=192.168.2.28 mac-address=04:ED:33:xx:xx:xx
add address=192.168.2.23 mac-address=2E:71:1C:xx:xx:xx
add address=192.168.2.22 mac-address=D8:30:62:xx:xx:xx
add address=192.168.2.10 mac-address=94:B8:6D:xx:xx:xx
add address=192.168.2.32 mac-address=8E:F6:52:xx:xx:xx
add address=192.168.2.25 mac-address=2C:DB:07:xx:xx:xx
add address=192.168.2.49 mac-address=A4:83:E7:xx:xx:xx
add address=192.168.2.60 mac-address=58:40:4E:xx:xx:xx
add address=192.168.2.55 mac-address=48:2A:E3:xx:xx:xx
add address=192.168.2.44 mac-address=00:11:32:xx:xx:xx
add address=192.168.2.45 mac-address=20:4E:F6:xx:xx:xx
add address=192.168.2.66 mac-address=38:F3:AB:xx:xx:xx
add address=192.168.2.65 mac-address=80:5E:0C:xx:xx:xx
add address=192.168.2.35 mac-address=C4:AC:59:xx:xx:xx
add address=192.168.2.64 mac-address=90:0F:0C:xx:xx:xx
add address=192.168.2.16 mac-address=74:AC:B9:xx:xx:xx
add address=192.168.2.14 mac-address=74:AC:B9:xx:xx:xx
add address=192.168.2.37 mac-address=D8:BB:C1:xx:xx:xx
add address=192.168.2.56 mac-address=D8:BB:C1:xx:xx:xx
add address=192.168.2.77 dhcp-option=option3 mac-address=54:05:DB:xx:xx:xx
add address=192.168.2.13 mac-address=50:EB:F6:xx:xx:xx
/ip dhcp-server network
add address=62.31.zz.zz/32 dns-server=194.zz.zz.123,194.zz.zz.123 gateway=
62.zz.zz.25 netmask=29
add address=192.168.2.0/24 comment=defconf dns-server=192.168.2.1 gateway=
192.168.2.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1
/ip dns static
add address=192.168.2.1 name=router.lan
/ip firewall filter
add action=accept chain=input comment=
“defconf: accept established,related,untracked” connection-state=
established,related,untracked
add action=drop chain=input comment=“defconf: drop invalid” connection-state=
invalid
add action=accept chain=input comment=“defconf: accept ICMP” protocol=icmp
add action=accept chain=input comment=
“defconf: accept to local loopback (for CAPsMAN)” dst-address=127.0.0.1
add action=drop chain=input comment=“defconf: drop all not coming from LAN”
in-interface-list=!LAN
add action=accept chain=forward comment=“defconf: accept in ipsec policy”
ipsec-policy=in,ipsec
add action=accept chain=forward comment=“defconf: accept out ipsec policy”
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment=“defconf: fasttrack”
connection-state=established,related
add action=accept chain=forward comment=
“defconf: accept established,related, untracked” connection-state=
established,related,untracked
add action=drop chain=forward comment=“defconf: drop invalid”
connection-state=invalid
add action=drop chain=forward comment=
“defconf: drop all from WAN not DSTNATed” connection-nat-state=!dstnat
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment=“defconf: masquerade”
ipsec-policy=out,none out-interface-list=WAN
add action=redirect chain=dstnat comment=
“DIRECT DNS REQUESTS TO MIKROTIK DNS SERVER” dst-port=53 protocol=udp
to-addresses=192.168.2.1 to-ports=53
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out2
add distance=2 gateway=62.xx.xx.25
/system clock
set time-zone-name=Europe/London
/system scheduler
add interval=1d name=email on-event=“/log print file=logs
\n/tool e-mail send from=david@xxxxxxxxxxx.co.uk to=david@xxxxxx
vices.co.uk subject="logs" body="$[/system clock get date] log file"
file=logs.txt start-tls=yes” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-date=jun/30/2022 start-time=18:15:00
/tool e-mail
set address=mail.xxx.com from=david@xxx.co.uk user=xxxxxx
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

(1) Since ether1 is used/setup via PPPOE, then suggest this needs to be removed
/ip dhcp-client
add comment=defconf interface=ether1

(2) What is going on here, no need to obfuscate any LAN private IP settings… ???
(this is not the place for any WAN settings either!!)

/ip dhcp-server network
add address=62.31.zz.zz/32 dns-server=194.zz.zz.123,194.zz.zz.123 gateway=
62.zz.zz.25 netmask=29

(3) this needs to be fixed.
/ip address
add address=192.168.2.1/24 comment=defconf interface=bridge nnetwork=
192.168.2.0

(4) routes seem okay…
Can you show the results of new terminal (CLI)
/ip route print detail and just change the numbers so the actual public ones are not the real ones

(5) set this one to none, unlike winbox its not secured…
/tool mac-server
set allowed-interface-list=NONE

OK I think I have fixed those points you mentioned now.

detail of route print -

Flags: X - disabled, A - active, D - dynamic,
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme,
B - blackhole, U - unreachable, P - prohibit
0 A S dst-address=0.0.0.0/0 gateway=pppoe-out2
gateway-status=pppoe-out2 reachable check-gateway=ping distance=1
scope=30 target-scope=10

1 S dst-address=0.0.0.0/0 gateway=62.62.62.25
gateway-status=62.62.62.25 unreachable distance=2 scope=30
target-scope=10

2 ADC dst-address=81.81.81.1/32 pref-src=81.81.81.143 gateway=pppoe-out2
gateway-status=pppoe-out2 reachable distance=0 scope=10

3 ADC dst-address=192.168.2.0/24 pref-src=192.168.2.1 gateway=bridge
gateway-status=bridge reachable distance=0 scope=10

Got this reply when I tried that last command -

[admin@MikroTik] > /tool mac-server
[admin@MikroTik] /tool mac-server> set allowed-interface-list=NONE
input does not match any value of allowed-interface-list

And I misunderstood this bit and I had added it to dhcp server, networks -

Once you have added Virgin to IP DHCP settings… also do not USE add default route=yes, as we need to set this up manually
add dst-address=0.0.0.0/0 gateway=ISP2gatewayIP table=main distance=2

I’ve removed that now but not sure where I should be putting that info. I’m not all that familiar with using this router yet and a bit of a noob with networking as well.

Yes, somehow you are going to have to set the Virgin provided parameters into IP DHCP client I think, with interface being ether2.. I wonder if it will populate automatically??

Ah right, as far as I know, there is no DHCP. I beleive they configure the virgin router with the gateway IP on the subnet, which I think is done by it authenticating via GRE tunnel or something along those lines (They provided GRE credentials, and instructions for configuring the router, but in fact I think they configure it remotely themselves).

Then, they also provided me with a document detailing the provided subnet, network address, gateway address and usable IP addresses along with subnet mask and finally, a notice that I should assign my equipment with one of the usable IP addresses. So I dont think that DHCP is active now on the router (As an aside, they also mentioned that wifi on the router is now inactive, which is fine).

The reason I done it this way in the first place is after reading online that its not possible to change the router into modem mode now, like it used to be, due to the way that they configure a single static IP - using the GRE trunnel and the way I had read others got the same thing working was by requesting block of 5 IP addresses and then configuring the router with one of those IPs and setting the virgin hub as the gateway.

I am going to temporarily set up a laptop tomorrow with a usable IP and connect it to the virgin router, just to confirm that side of things is actually working.

In the meantime if you think there is any other way of getting this working, please let me know.

Thanks for your help so far I really appreciate it.

Okay so I am guessing you only need to do the following entries.

Interface list member
interface=ether2 list=WAN

/IP address
settings provided by virgin provider.

Thank you I will try this tomorrow.

This morning I configured the ethernet interface on my laptop with the details provided by virgin - first usable IP as the adators IP address, subnet mask 255.255.255.248 and the gateway provided by virgin. This worked, so its good to know the virgin router is working.

Unfortunately the virgin still doesnt work from the mikrotik -
If I have the ppoe gateway (ether1) set to distance 1, then I can ping the internet from my computer.
If I have the virgin gateway (ether2) set to distance 1, then I cannot ping the internet. And the mikrotik reports unreachable, when i do tracert 1.1.1.1, for example.

I am re-sharing my config in case you guys see anything wrong.

jul/13/2022 08:45:09 by RouterOS 6.47.10

software id = RH5L-ZD1A

model = RB750Gr3

serial number =

/interface bridge
add admin-mac=DC:2C:6E:6F:29:86 auto-mac=no comment=defconf name=bridge
/interface pppoe-client
add disabled=no interface=ether1 name=pppoe-out2 use-peer-dns=yes user=
/interface list
add comment=defconf name=WAN
add comment=defconf name=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-server option
add code=3 name=option3 value=“‘192.168.2.252’”
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.2.10-192.168.2.200
/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2
add bridge=bridge comment=defconf interface=ether3
add bridge=bridge comment=defconf interface=ether4
add bridge=bridge comment=defconf interface=ether5
/ip neighbor discovery-settings
set discover-interface-list=LAN
/interface list member
add comment=defconf interface=bridge list=LAN
add comment=defconf interface=ether1 list=WAN
add interface=ether2 list=WAN
add interface=pppoe-out2 list=WAN
/ip address
add address=192.168.2.1/24 comment=defconf interface=bridge network=
192.168.2.0
add address=62.1.1.26 interface=ether2 network=62.1.1.25
/ip dhcp-client
add comment=defconf interface=ether1
add comment=defconf interface=ether1
/ip dhcp-server lease
add address=192.168.2.17 mac-address=E4:E7:49:7E:24:B5
add address=192.168.2.12 mac-address=C0:3E:0F:42:CE:26
add address=192.168.2.27 mac-address=0C:C4:7A:0F:93:2C
add address=192.168.2.30 mac-address=F0:9F:C2:05:3D:9B
add address=192.168.2.31 mac-address=00:14:D1:2E:D9:08
add address=192.168.2.38 mac-address=34:64:A9:95:01:40
add address=192.168.2.34 mac-address=0C:C4:7A:AA:B3:C5
add address=192.168.2.15 mac-address=B0:5C:DA:27:33:B2
add address=192.168.2.21 mac-address=5A:B9:E7:7A:2A:67
add address=192.168.2.19 mac-address=38:A6:CE:E1:A7:1C
add address=192.168.2.36 mac-address=90:02:18:C0:5E:12
add address=192.168.2.18 mac-address=A8:66:7F:38:18:19
add address=192.168.2.28 mac-address=04:ED:33:DF:91:3E
add address=192.168.2.23 mac-address=2E:71:1C:87:57:97
add address=192.168.2.22 mac-address=D8:30:62:50:F6:A7
add address=192.168.2.10 mac-address=94:B8:6D:F0:69:FA
add address=192.168.2.32 mac-address=8E:F6:52:77:DB:FB
add address=192.168.2.25 mac-address=2C:DB:07:DF:E4:40
add address=192.168.2.49 mac-address=A4:83:E7:93:10:CC
add address=192.168.2.60 mac-address=58:40:4E:E7:C6:62
add address=192.168.2.55 mac-address=48:2A:E3:B2:E8:07
add address=192.168.2.44 mac-address=00:11:32:EE:ED:4F
add address=192.168.2.45 mac-address=20:4E:F6:75:FB:5D
add address=192.168.2.66 mac-address=38:F3:AB:0D:48:5F
add address=192.168.2.65 mac-address=80:5E:0C:54:F1:CB
add address=192.168.2.35 mac-address=C4:AC:59:A9:E9:02
add address=192.168.2.64 mac-address=90:0F:0C:0C:19:46
add address=192.168.2.16 mac-address=74:AC:B9:90:2B:29
add address=192.168.2.14 mac-address=74:AC:B9:B3:B2:5D
add address=192.168.2.37 mac-address=D8:BB:C1:11:2C:F2
add address=192.168.2.56 mac-address=D8:BB:C1:11:2E:4E
add address=192.168.2.77 dhcp-option=option3 mac-address=54:05:DB:CF:0D:FD
add address=192.168.2.13 mac-address=50:EB:F6:77:FC:3F
/ip dhcp-server network
add address=192.168.2.0/24 comment=defconf dns-server=192.168.2.1 gateway=
192.168.2.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1
/ip dns static
add address=192.168.2.1 name=router.lan
/ip firewall filter
add action=accept chain=input comment=
“defconf: accept established,related,untracked” connection-state=
established,related,untracked
add action=drop chain=input comment=“defconf: drop invalid” connection-state=
invalid
add action=accept chain=input comment=“defconf: accept ICMP” protocol=icmp
add action=accept chain=input comment=
“defconf: accept to local loopback (for CAPsMAN)” dst-address=127.0.0.1
add action=drop chain=input comment=“defconf: drop all not coming from LAN”
in-interface-list=!LAN
add action=accept chain=forward comment=“defconf: accept in ipsec policy”
ipsec-policy=in,ipsec
add action=accept chain=forward comment=“defconf: accept out ipsec policy”
ipsec-policy=out,ipsec
add action=fasttrack-connection chain=forward comment=“defconf: fasttrack”
connection-state=established,related
add action=accept chain=forward comment=
“defconf: accept established,related, untracked” connection-state=
established,related,untracked
add action=drop chain=forward comment=“defconf: drop invalid”
connection-state=invalid
add action=drop chain=forward comment=
“defconf: drop all from WAN not DSTNATed” connection-nat-state=!dstnat
connection-state=new in-interface-list=WAN
/ip firewall nat
add action=masquerade chain=srcnat comment=“defconf: masquerade”
ipsec-policy=out,none out-interface-list=WAN
add action=redirect chain=dstnat comment=
“DIRECT DNS REQUESTS TO MIKROTIK DNS SERVER” dst-port=53 protocol=udp
to-addresses=192.168.2.1 to-ports=53
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out2
add distance=2 gateway=ether2
/system clock
set time-zone-name=Europe/London
/system scheduler
add interval=1d name=email on-event=“/log print file=logs
\n/tool e-mail send from= to= subject="logs" body="$[/system clock get date] log file"
file=logs.txt start-tls=yes” policy=
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon
start-date=jun/30/2022 start-time=18:15:00
/tool e-mail
set address=mail.domain.com from= user=username
/tool mac-server
set allowed-interface-list=LAN
/tool mac-server mac-winbox
set allowed-interface-list=LAN

Here are some screenshots from the GUI as well, if they are helpful -

all the real parts you forgot to censor…

Not sure your testing methods are any good.
Dont change the distances, keep ether1 at dist=1 and ether2 (virgin at dist=2)

If you want to check if ether2 works simply go into the ether1 interface and disable it or go into pppoe settings and disable the client etc…
By the way if ether2 is connected and available you will see it in IP routes as both ISPs should show as reachable but blue since its not the active route.

Disable ether1 and ether2 should turn black as the active route!!

Maybe something I am missing then -

I tried what you suggested _ put eth1 as distance 1, eth2 as distance 2.
I can ping 1.1.1.1 from my computer, works fine.

Then I disable eth1 in interface.
Now when I ping 1.1.1.1 I get “Reply from 192.168.2.1: Destination host unreachable.”

When I re-enable it, everything starts working again.

Interestingly, as you mention, when its all working, both routes do show as reachable, and eth2 is indeed blue.

Could there be anything else causing it not to work?

You didnt remove this yet… ( both should be disabled as the client settings for ISP1 are set in the pppoe settings and for ISP2 you set it in manually via IP address )
/ip dhcp-client
add comment=defconf interface=ether1
add comment=defconf interface=ether1

Also when you disable pppoie client to test if the router fails over to ether2.

A. does ether2 go from blue to black in ip routes?
B. can you access the internet? aka browse??

/ip dhcp-client
add comment=defconf interface=ether1
add comment=defconf interface=ether1

I had those two disabled, but now I have completely removed them from IP, DHCP Client.

I tried again disabling pppoe - and yes, once I disable that, ppoe goes blue and says unreachable in routes, ether2 goes from blue to black. it also says reachable when that happens.
But when I try to browse internet it times out and when i try to ping an IP (for example 1.1.1.1) it says Reply from 192.168.2.1: Destination host unreachable.

Any other ideas? Or is there an option for someone to log in remotely and check settings (happy to pay for this)?