Community discussions

MikroTik App
 
Dfects
just joined
Topic Author
Posts: 15
Joined: Wed Feb 20, 2013 1:27 am

Dual WAN by client

Fri Jan 13, 2023 7:49 pm

I currently have two different WAN connections, one being a VDSL line and the other being a 4G connection. The VDSL is lower bandwidth, but lower latency and the 4G connection is higher bandwidth but high latency so I like to use both for different purposes.

The setup I have at the moment on my asus router allows me to utilise both connections by assigning the primary WAN (4G) to my DHCP range, any clients outside that range are configured to use the secondary (VDSL) line. I can then control per device either by static IP or DHCP reservation as required.

I'm not 100% sure how to configure a similar setup in routeros, i'm assuming once I have both the WAN connections configured I need to configure some routes?

Any pointers in what to read up on/where to start would be helpful. The only guides i can find so far are for failover or load balancing.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19318
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual WAN by client

Fri Jan 13, 2023 8:51 pm

If you wish to 'force' one subnet to WAN1 and 'force' another subnet to WAN2, very easy to do with routes.
Lets say you have two subnets, 92.168.10.0/24 for 4g (isp1) and 192.168.5.0/24 for vdsl. (Isp2)
Typically one has the two default routes,

default route 1 - dst-address=0.0.0.0/0 gwy=WAN1-gatewayIP table=main
default route 2 - dst-address=0.0.0.0/0 gwy=WAN2-gatewayIP table=main


then one adds two additional routes, two tables and some routing rules.

/routing table add fib name=useISP1
/routing table add fib name=useISP2


/Ip routes
dst-address=0.0.0.0/0 gwy=WAN1-gatewayIP table=main
dst-address=0.0.0.0/0 gwy=WAN2-gatewayIP table=main
add dst-address=0.0.0.0/0 gwy=WAN1-gatewayIP table=useISP1
add dst-address=0.0.0.0/0 gwy=WAN2-gatewayIP table=useISP2


/routing rule add src-address=192.168.10.0/24 action=lookup table=useISP1
/routing rule add src-address=192.168.5.0/24 action=lookup table=useISP2


Note1: If you dont want the router to provide the alternate route if its down, lets say 4g users can go to vdsl if 4g is down and not vice versa then would modify the action.
/routing rule add src-address=192.168.10.0/24 action=lookup table=useISP1
/routing rule add src-address=192.168.5.0/24 action=lookup-only-in-table table=useISP2


Note2: If you want a particular subnet to be able to reach another subnet instead of being forced out the tunnel then consider more routing rules and order counts.
lets say in this case you want 4g users to be able to reach users in vdsl subnet ( this is in addition to required firewall rules )

/routing rule add dst-address=192.168.5.0/24 action=lookup-only-in-table table=main
/routing rule add src-address=192.168.10.0/24 action=lookup table=useISP1
/routing rule add src-address=192.168.5.0/24 action=lookup-only-in-table table=useISP2
 
Dfects
just joined
Topic Author
Posts: 15
Joined: Wed Feb 20, 2013 1:27 am

Re: Dual WAN by client

Sun Jan 15, 2023 11:36 pm

Wow! I wasn't expecting such a detailed reply, thanks so much for taking the time.I'll work through it shortly on my hap ax3 while reading up to make sure I know what/why each thing is needed :)

Ideally all the clients will be able to communicate, I have a a fair few smart devices and local mini servers that all clients will want to communicate with so Note2 seems very relevant. That being said, eventually having a default "guest" subnet for when friends or family want to use the wifi but don't need server access would be nice so may attempt that after when I have a better grasp.

Would I be right in thinking the best way to control which subnet a client is in would be DHCP range covering the one subnet, then reservations/static Ip's to control access to the other(s)? (Majority will be on 4G, only gaming/work PCs on VDSL) Or is there a better way?
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19318
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Dual WAN by client

Mon Jan 16, 2023 1:44 am

Where they will connect physically may be under your control and thus the use of a managed switch is great for segmentation.
For WIFI the use of SSIDs for specific vlans works.........

For an accurate config best if you detail all items.
a. identify all users/user groups and devices/device groups
b. identify all the traffic required/allowed for each
c. identify all the traffic not allowed for each
d. provide a network diagram of equipment being used, and perhaps how you would map out the users ( use separate vlans for example on which ports ).

Who is online

Users browsing this forum: No registered users and 37 guests