Community discussions

MikroTik App
 
lebphi
just joined
Topic Author
Posts: 12
Joined: Sun Oct 14, 2018 12:27 pm

dual wan with an hap ac2 ?

Sun Jun 16, 2019 8:55 am

hi,

At home i've 2 differents internet connections and i'd like to use a dual wan router to manage them.
I've found on the net an exemple with a mikrotik router :
https://systemzone.net/mikrotik-dual-wa ... using-pcc/
It is possible to do that with any mikrotik router or i need a specific router ?
Can i manage a dual wan with my HAP AC2 router ?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22135
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: dual wan with an hap ac2 ?

Sun Jun 16, 2019 6:04 pm

RouterOS for the most part is RouterOS meaning you can do everything on most devices.
So yes dual or triple or quadruple wan is possible.

You need to state your requirements more clearly however.
1. Do you want failover ( a primary and if it fails then go to secondary)
2. Shared, load balance, make use of both connections equally or if different throughputs on a sort of ratio basis.
3. Are both connections dynamic or static IP addresses?
4. Do you have any port forwardings to consider
5. Do you have an email accounts you use assigned to a specific WAN/ISP
6. Do you require a user or subnet to only use one of the WANIPs for outbound traffic

etc
etc
etc
 
lebphi
just joined
Topic Author
Posts: 12
Joined: Sun Oct 14, 2018 12:27 pm

Re: dual wan with an hap ac2 ?

Sun Jun 16, 2019 9:08 pm

super.

i'd like :
- failover. the second connection will be use only when the first one will be down
- the 2 connections have dynamics ip address with the use of dyndns
- i need forwarding port from internet to my local network
- i don't use email with the WAN
- all users can use anyone of WAN
- the dhcp server will be in the mikrotik router not in the internet boxes

in fact i'd like the 2 WAN are transparent as possible for the users of the local network. From internet the difference wil only be the dyndns address.

I continue to search in the forum for find ideas to do that.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22135
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: dual wan with an hap ac2 ?

Mon Jun 17, 2019 6:11 pm

/ip route
add check-gateway=ping distance=2 gateway=8.8.4.4 target-scope=30
add check-gateway=ping distance=3 gateway=208.67.220.220 target-scope=30
add distance=10 gateway=ispgateway(secondary) target-scope=30
add distance=2 dst-address=8.8.4.4/32 gateway=ispgateway(primary)
add distance=3 dst-address=208.67.220.220/32 gateway=ispgateway(primary)


In the above setup, distance=2 and distance=3 represent your primary ISP and distance=10 represents your backup ISP.
This is a basic recursive type of setup that checks connectivity (through your ISP) to common web locations.
This is done to ensure the gateway is actually up and running (not just to your ISP but beyond).
You could do it with just one website( next) the above example checks both google and OpenDNS servers before switching to your backup ISP.

/ip route
add check-gateway=ping distance=2 gateway=8.8.4.4 target-scope=30
add distance=10 gateway=ispgateway(backup) target-scope=30
add distance=2 dst-address=8.8.4.4/32 gateway=ispgateway(primary)

This however is not the complete story as you stated you have dynamic ISPs.
If an ISP fails and then tries to give you a different ISP address and more critically a different ISP gateway then it may not work.
THe above seems to work well with docsis type cable connections but it does NOT work for fibre bell type connections. My experience is that the MT routers cannot handle changes in gateways in this scenario. Typically once the unit has failed the primary and goes to the secondary (my primary is fibre, my secondary cable) it does not usually go back to the primary when it is back on line due to the different gateway assignment. I have to manually look at the dhcp client setting click on the connection and hit status to see what gateway the router is detecting and then go manually to IP routes and put that into the ispgateway(primary) location in the associated ip route rule.

Now the latest editions of RouterOS lets one tinker with scripts that may solve this issue but its slightly too technical for me.
Also if looking at your routes in winbox, the black text ones are working/in use, the light blue indicate ready to be used (connected but not in use).
So in the above setup the primary connection via the secondary public web location would be in light blue as would the secondary backup isp.
 
AidanAus
Member Candidate
Member Candidate
Posts: 177
Joined: Wed May 08, 2019 7:35 am
Location: Australia
Contact:

Re: dual wan with an hap ac2 ?

Tue Jun 18, 2019 9:09 am

/ip route
add check-gateway=ping distance=2 gateway=8.8.4.4 target-scope=30
add check-gateway=ping distance=3 gateway=208.67.220.220 target-scope=30
add distance=10 gateway=ispgateway(secondary) target-scope=30
add distance=2 dst-address=8.8.4.4/32 gateway=ispgateway(primary)
add distance=3 dst-address=208.67.220.220/32 gateway=ispgateway(primary)


In the above setup, distance=2 and distance=3 represent your primary ISP and distance=10 represents your backup ISP.
This is a basic recursive type of setup that checks connectivity (through your ISP) to common web locations.
This is done to ensure the gateway is actually up and running (not just to your ISP but beyond).
You could do it with just one website( next) the above example checks both google and OpenDNS servers before switching to your backup ISP.

/ip route
add check-gateway=ping distance=2 gateway=8.8.4.4 target-scope=30
add distance=10 gateway=ispgateway(backup) target-scope=30
add distance=2 dst-address=8.8.4.4/32 gateway=ispgateway(primary)

This however is not the complete story as you stated you have dynamic ISPs.
If an ISP fails and then tries to give you a different ISP address and more critically a different ISP gateway then it may not work.
THe above seems to work well with docsis type cable connections but it does NOT work for fibre bell type connections. My experience is that the MT routers cannot handle changes in gateways in this scenario. Typically once the unit has failed the primary and goes to the secondary (my primary is fibre, my secondary cable) it does not usually go back to the primary when it is back on line due to the different gateway assignment. I have to manually look at the dhcp client setting click on the connection and hit status to see what gateway the router is detecting and then go manually to IP routes and put that into the ispgateway(primary) location in the associated ip route rule.

Now the latest editions of RouterOS lets one tinker with scripts that may solve this issue but its slightly too technical for me.
Also if looking at your routes in winbox, the black text ones are working/in use, the light blue indicate ready to be used (connected but not in use).
So in the above setup the primary connection via the secondary public web location would be in light blue as would the secondary backup isp.
newbie question here, why are you using things like googles DNS for check gateway and not getting the closest address to the device on the ISP side via a traceroute from the router?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22135
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: dual wan with an hap ac2 ?

Tue Jun 18, 2019 3:01 pm

newbie question here, why are you using things like googles DNS for check gateway and not getting the closest address to the device on the ISP side via a traceroute from the router?
It it more a case of using a known (robust) unlikely to be down source.