Want to transfer packets for specific device through selected WAN from multiple WAN

Hello everyone.. I’m currently using MikroTik RB4011iGS with 3x multiple WAN system.. Recently i added an IP Phone provided by one of my ISP (SmileBD). But because of my multiple WAN system my IP Phone only works when other 2 ISP connections are disabled.. I already tried to create some rules in mangle so that my IP Phone only use data trough the specific WAN, but it did not work.. Expecting from experts to fix my problem by correcting my config files… thanks in advance…


I am giving my config files given below:

feb/06/2022 19:30:05 by RouterOS 6.46.2

software id = 1PNC-ULLU

model = RB4011iGS+

serial number = XXXXXXXXXXX

/interface bridge
add comment=Local_LAN name=Local
/interface ethernet
set [ find default-name=ether1 ] comment=SmileBD-WAN mac-address=
XX:XX:XX:XX:XX:XX
set [ find default-name=ether2 ] comment=SuperNET-WAN mac-address=
XX:XX:XX:XX:XX:XX
set [ find default-name=ether3 ] comment=OneNET-WAN mac-address=
XX:XX:XX:XX:XX:XX
set [ find default-name=ether5 ] comment=“LAN”
set [ find default-name=ether6 ] comment=“LAN”
set [ find default-name=sfp-sfpplus1 ] disabled=yes
/interface pppoe-client
add add-default-route=yes comment=PPPoE_WAN-3 disabled=no interface=ether3
name=OneNET-PPPOE password=xxx use-peer-dns=yes user=xxx
add add-default-route=yes comment=PPPoE_WAN-1 disabled=no interface=ether1
max-mtu=1480 name=SmileBD-PPPOE password=xxx use-peer-dns=yes user=
xxx
add add-default-route=yes comment=PPPoE_WAN-2 disabled=no interface=ether2
name=SuperNET-PPPOE password=xxx use-peer-dns=yes user=
xxx
/interface ethernet switch port
set 0 default-vlan-id=0
set 1 default-vlan-id=0
set 2 default-vlan-id=0
set 3 default-vlan-id=0
set 4 default-vlan-id=0
set 5 default-vlan-id=0
set 6 default-vlan-id=0
set 7 default-vlan-id=0
set 8 default-vlan-id=0
set 9 default-vlan-id=0
set 10 default-vlan-id=0
set 11 default-vlan-id=0
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip pool
add name=dhcp_pool ranges=192.168.66.101-192.168.66.254
/ip dhcp-server
add address-pool=dhcp_pool disabled=no interface=Local lease-time=12h name=
dhcp1
/interface bridge port
add bridge=Local interface=ether6
add bridge=Local interface=ether7
add bridge=Local interface=ether8
add bridge=Local interface=ether9
add bridge=Local interface=ether10
add bridge=Local interface=ether5
/ip address
add address=192.168.66.1/24 interface=Local network=192.168.66.0
/ip cloud
set ddns-enabled=yes ddns-update-interval=5m
/ip dhcp-server lease
add address=192.168.66.41 client-id=1:0> :b:> 82:d1:6a:e9 comment=“IP Phone [SIP Phone]”
mac-address=00:05:88:D6:6A:F9 server=dhcp1
/ip dhcp-server network
add address=192.168.66.0/24 gateway=192.168.66.1
/ip dns
set allow-remote-requests=yes
/ip firewall address-list
add address=192.168.66.101-192.168.66.254 list=Local
add address=127.0.0.1 disabled=yes list=allow-ip
/ip firewall mangle
add action=mark-connection chain=prerouting comment=“Load Balance”
dst-address-list=!Local in-interface=Local new-connection-mark=
OneNET_conn passthrough=yes per-connection-classifier=
both-addresses-and-ports:9/0 src-address-list=Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=OneNET_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/1 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=OneNET_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/2 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SuperNET_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/3 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SuperNET_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/4 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SuperNET_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/5 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SmileBD_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/6 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SmileBD_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/7 src-address-list=
Local
add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SmileBD_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/8 src-address-list=
Local
add action=mark-routing chain=prerouting connection-mark=OneNET_conn
dst-address-list=!Local in-interface=Local new-routing-mark=OneNET_route
passthrough=yes src-address-list=Local
add action=mark-routing chain=prerouting connection-mark=SuperNET_conn
dst-address-list=!Local in-interface=Local new-routing-mark=
SuperNET_route passthrough=yes src-address-list=Local
add action=mark-routing chain=prerouting connection-mark=SmileBD_conn
dst-address-list=!Local in-interface=Local new-routing-mark=SmileBD_route
passthrough=yes src-address-list=Local
add action=mark-routing chain=prerouting comment=
“=== IP Phone [SIP Phone] through Smile BD WAN ===” disabled=yes dst-address=!192.168.66.0/24
in-interface=Local new-routing-mark=SmileBD_route passthrough=yes
src-mac-address=00:0B:82:D1:6A:E9
/ip firewall nat
add action=masquerade chain=srcnat comment=“==== ALL_SRCNAT ====”
out-interface-list=all
/ip route
add distance=1 gateway=OneNET-PPPOE routing-mark=OneNET_route
add distance=1 gateway=SuperNET-PPPOE routing-mark=SuperNET_route
add distance=1 gateway=SmileBD-PPPOE routing-mark=SmileBD_route
/system identity
set name=Multiple-WAN
/tool bandwidth-server
set authenticate=no
backup.txt.rsc (5.74 KB)

It is not clear to me what you are trying to do with an iphone.
I use my iphone on my wifi connection at home through my ISP providers.

Why would you want to attach the IPHONE as an ISP connection???
Furthermore it would have to be via WIFI correct? and your RB4011 is wired only??

thnx for your reply.. but it’s not IPhone.. It’s IP Phone, like SIP phone, which is provided by my ISP… Problem is that my SIP Phone only works and goes online, when my “SmileBD” isp actives and other two ISP is disabled.. I think if i can route my SIP Phone to that specific iSp, probably the problem will be solved.. I already made the rules in mangle(you can find the rules), but it doesn’t help..

And yes, the IP Phone is also connected via WiFi.. the fact is if i have to use my IP Phone, it must be inside the specific ISP;s route… This is the reason i need to make a proper rules that my SIP Phone will only use the specific WAN..

duplicate post

Too funny, not wonder it didnt make sense.

Okay this is very easy!!! No mangling required for SIP connection!
CHANGE YOUR LOAD BALANCING SO IT ONLY APPLIES THE TWO ISP connections (OneNET-PPPOE and SuperNET-PPPOE)

You should have THREE ROUTES in total
ISP1-gatewayIP by default in pppoe settings
ISP2-gatewayIP by default in pppoe settings
ISP-SmileBD_gatewayIP by default in pppoe settings

No need to touch those!
You have created extra routes for mangling, so delete mangle rules and route rule you created for VOIP provider.
You will have to adjust the mangle classifier numbers to they make sense for the two remaining WANs vice three. { not 9/0 etc…}

add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-**mark=SmileBD_**conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/6 src-address-list=Local

add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-m**ark=SmileBD_**conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/7 src-address-list=Local

add action=mark-connection chain=prerouting dst-address-list=!Local
in-interface=Local new-connection-mark=SmileBD_conn passthrough=yes
per-connection-classifier=both-addresses-and-ports:9/8 src-address-list=Local

add action=mark-routing chain=prerouting connection-mark**=SmileBD_**conn
dst-address-list=!Local in-interface=Local new-routing-mark=SmileBD_route
passthrough=yes src-address-list=Local

add distance=1 gateway=SmileBD-PPPOE routing-mark=SmileBD_route********

All you need to do is replace the third route (deleted above**) with a new ONE and an associated Routing Rule as follows:**

IF BY COMMAND LINE
Add IP Route
add distance=1 gateway=ISP-SmileBD_gatewayIP routing-mark=useBD

Add Route Rule
add action=lookup-only-in-table src-address=192.168.41/32 table=useBD

IF BY WINBOX GUI
IP Route
dst-address=0.0.0.0/0 gateway=SmileGD_gatewayIP Routing Mark: useBD

Route Rule
Src. Address: 192.168.66.41/32
Action: lookup only in table
Table: useBD

Basically stating that any traffic from that IP address should be ONLY routed through table: useBD and thus the traffic will not go out table main for example. It will work all the time.

that post was for a different purpose… and that was also not solved by the person who guided me… and that is the reason i didn’t deleted… But i have already solved the matter by creating the mangle rules, which is clearly seen in this post… the mangle rules i made after the load balance, it works without any problem for the other devices.. and with that way i’m already using my android tv boxes, because only ISP OneNet is providing me the IPTV service.. but only for my SIP Phone provided by my ISP named BDCom doesn;t work with the same mangle rules.. my question was that maybe the mangle rules are not enough to transfer all the data traffic through an individual ISP…

I already unsubscribed the topic.. but thnx for correcting me.. i should have deleted the last posts, which caused the misunderstanding :slight_smile: ..

Okay , let me explain the matter..

ISP 1 = providing me the SIP service, it only works when u r in their network. have only 30mbps internet speed. and 80mbps BDIX speed

ISP 2 = providing me the IPTV service , also only works inside their network, have 30mbps internet speed and 300mbps BDIX speed

ISP 3 = Normal internet connection.. But have raw bandwidth 100mbps internet speed and 800mbps BDIX speed

i also wanted to give different load to different ISPs.. so i calculated the ration and made mangles with 9/0 … Also in my region, we have BDIX speed, it’s like a cache speed… if i do the WANs vice three, it can’t take the maximum BDIX cache speed.. i know it’s a bit confusing.. But because of my regional ISPs configuration, i have to setup this in that way.. Even if i change my default route distance, it can’t combine the speed while downloading…

I will follow your given idea and hope that problem will be solved.. thank u :slight_smile:

Well what seemed to be three ISP load balance is really not that at all.

  1. ISP for voip is tied to one IP address and thus handled as per my previous post. Its on all the time for the VOIP modem or phone etc…

  2. ISP for regular internet, SHOULD BE the PRIMARY WAN in your setup, no mangling required.

  3. ISP for IPTV, not sure how this works by vlan or connected to tV boxes etc… but it too sounds singluarly focussed.

Can you confirm if your intention was to use IPTV ISP for something else besides IPTV, what does it feed??