Hi all, I have home network with two ISPs, VDSL and WiFi for two LANs. I used both networks in a way that I marked each traffic and sent it out by one of ISPs and in case of outage each one backed up another. This had some ugly consequences for me:
- Routing was missing something, MikroTik couldn’t reach Internet for updates because traffic wasn’t originating from LAN interface and wasn’t marked.
- When I added default route without marking, one of LANs lost Internet connectivity.
- I couldn’t ping router from LAN.
- When I overutilized any of two links my “ip sla” script started to shutdown routes to both ISPs one by one, again and again and again.
Now I want to do different approach. VDSL will be primary, WiFi will be backup. For junk traffic (like torrents, smartTV etc.) I’ll use WiFi, this will have no backup. I found out that separating torrents will be pain in the butt, so I’m leaving this for later. Right now I want to have whole Main LAN on VDSL and mark nunecessary clients (IP addresses) to got via WiFi. In the same time I want my MikroTik router and access points to reach Internet and download updates.
So, what I understood from MikroTik Wiki, when traffic will reach router, it will check routing table. If it won’t find route in marked routing table, it will use default table. I tried to setup whole thing according to this, but it doesn’t work. I created three default routes. VDSL default route with distance 1. WiFi default with distance 10. Switch to backup is done by script. Till this point all works perfectly.
I mark one PC 10.0.0.191 with mark JUNKPC, one I added default route for marked traffic with mark JUNKPC, LAN lost connectivity to internet completely.
Can anyone review my config below and point out what I’m doing wrong?
/interface bridge
add admin-mac=XX:XX:XX:XX:XX:XX auto-mac=no comment=defconf fast-forward=no name=bridge
/interface ethernet
set [ find default-name=ether1 ] name=ether1-ISP1 speed=100Mbps
set [ find default-name=ether2 ] name=ether2-master-LAN1 speed=100Mbps
set [ find default-name=ether3 ] name=ether3-LAN2 speed=100Mbps
set [ find default-name=ether4 ] speed=100Mbps
set [ find default-name=ether5 ] name=ether5-ISP2 speed=100Mbps
set [ find default-name=ether6 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether6-master
set [ find default-name=ether7 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether8 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether8-LAN1
set [ find default-name=ether9 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full
set [ find default-name=ether10 ] advertise=10M-half,10M-full,100M-half,100M-full,1000M-half,1000M-full name=ether10-LAN1
/ip pool
add name=dhcp ranges=10.0.0.1-10.0.0.254
/ip dhcp-server
add address-pool=dhcp authoritative=after-2sec-delay disabled=no interface=bridge lease-time=23h59m name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master-LAN1
add bridge=bridge comment=defconf interface=ether6-master
add bridge=bridge interface=ether3-LAN2
add bridge=bridge interface=ether4
add bridge=bridge interface=ether7
add bridge=bridge interface=ether8-LAN1
add bridge=bridge interface=ether9
add bridge=bridge interface=ether10-LAN1
/interface list member
add interface=ether2-master-LAN1 list=discover
add interface=ether3-LAN2 list=discover
add interface=ether4 list=discover
add interface=ether5-ISP2 list=discover
add interface=ether6-master list=discover
add interface=ether7 list=discover
add interface=ether8-LAN1 list=discover
add interface=ether9 list=discover
add interface=ether10-LAN1 list=discover
add interface=bridge list=discover
add interface=bridge list=mactel
add interface=bridge list=mac-winbox
/ip address
add address=10.0.0.254/24 comment="LAN subnet" interface=bridge network=10.0.0.0
add address=192.168.1.2/29 comment=ISP1 interface=ether1-ISP1 network=192.168.1.0
add address=192.168.0.2/24 comment=ISP2 interface=ether5-ISP2 network=192.168.0.0
/ip dhcp-server network
add address=10.0.0.0/24 comment=defconf gateway=10.0.0.254
/ip firewall filter
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=input comment="defconf: drop all from WAN" in-interface=ether1-ISP1
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
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=ether1-ISP1
/ip firewall mangle
add action=mark-routing chain=prerouting new-routing-mark=JUNKPC passthrough=yes src-address=10.0.0.191
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=ether1-ISP1
add action=masquerade chain=srcnat out-interface=ether5-ISP2
add action=masquerade chain=srcnat src-address=10.0.0.0/24
/ip route
add distance=1 gateway=ether5-ISP2 routing-mark=JUNKPC
add comment=ISP1 distance=1 gateway=192.168.1.1
add comment=ISP2 distance=10 gateway=192.168.0.1