Community discussions

MikroTik App
 
5aberD
just joined
Topic Author
Posts: 24
Joined: Wed Apr 15, 2020 10:47 pm

Dual WAN Mangle routing

Tue Apr 21, 2020 7:03 pm

I have two WAN connection to my Mikrotik One for me (ADSL) and another for the family(PPPOE)
I want my devices (2 Laptops, & 2 Smartphones) to go through interface 2 ADSL Connection
192.168.1.10/24 192.168.1.0 ether2

and all other devices on the network to go through interface 1 PPPOE Connection
192.168.0.40/24 192.168.0.0 ether1
the wifi Have a DHCP server from 192.168.10.10-192.168.10.50
and there are about 12 devices on the wifi (not at the same time)
I can make my devices' IP STATIC since theirs only 4 devices

I Created the Internet Connection of both interfaces and I can ping the main ISP's I added the DNS Server 8.8.8.8 and the route list was created when I entered the IP addresses above.
how can I do this?
 
Zacharias
Forum Guru
Forum Guru
Posts: 3459
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: Dual WAN Mangle routing

Sun Apr 26, 2020 3:11 am

There are 2 ways...
First in your Routing Table you mark your 2 WAN connections... e.g.
/ip route
add distance=1 gateway=192.168.1.1 routing-mark=ISP1
add distance=1 gateway=192.168.75.2 routing-mark=ISP2
Then if i want a host with address 192.168.20.254 to use ISP1 and host with address 192.168.20.253 to use ISP2 :
/ip route rule
add action=lookup-only-in-table src-address=192.168.20.254/32 table=ISP1
add action=lookup-only-in-table src-address=192.168.20.253/32 table=ISP2
Or with using Mangles:
/ip firewall mangle
add action=mark-routing chain=prerouting dst-address-type=!local \
    new-routing-mark=ISP1 passthrough=no src-address=192.168.20.254
add action=mark-routing chain=prerouting dst-address-type=!local \
    new-routing-mark=ISP2 passthrough=no src-address=192.168.20.253
If we have more than 1 subnets e.g 192.168.10.0/24, if we want to be able to communicate with each one, then in the Route Rules we should add at the top:
add dst-address=192.168.10.0/24 src-address=192.168.20.0/24 table=main
in Mangles:
add action=accept chain=prerouting dst-address=192.168.10.0/24
Which will result in the Main routing Table as well...

Who is online

Users browsing this forum: gimmo and 72 guests