Community discussions

MikroTik App
 
ferryhtw
just joined
Topic Author
Posts: 3
Joined: Thu May 13, 2021 3:23 pm
Location: Jakarta

[Solved] PCC Load Balance that not going to another Port

Fri May 14, 2021 3:08 am

Hi,
This is my first time setting up Mikrotik I'm overwhelmed and amaze with so many things available in the router.
So, I have 2 broadband connection to different ISP connected to my router RB750Gr3, somehow, my traffic only goes to Ether2/ISP MNC and never goes to Ether1/ISP FM
When I test the failover by plug out the cable from Ether2/ISP MNC, the traffic is going to Ether1/ISP FM so it proves that something wrong with my configuration.
AS I have try this for a week I think its time for me to look some help from expert here.

Some details:
Ether 1/ISP FM
Bandwith 50 mbps UP / 5 mbps DOWN

Ether 2/ISP MNC
Bandwith 20 mbps UP / 20 mbps DOWN

Ether 5/LAN
Connected to Wifi Router

Below are my configuration:
# may/13/2021 19:49:08 by RouterOS 6.47.6
# software id = 5DVB-AT6I
#
# model = RB750Gr3
/interface ethernet
set [ find default-name=ether1 ] comment=FM
set [ find default-name=ether2 ] comment=MNC
set [ find default-name=ether5 ] comment=LAN
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp_pool1 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool2 ranges=192.168.10.2-192.168.10.254
add name=dhcp_pool3 ranges=\
    192.168.0.1-192.168.0.22,192.168.0.24-192.168.0.254
add name=dhcp_pool4 ranges=192.168.10.2-192.168.10.254
/ip dhcp-server
add address-pool=dhcp_pool4 disabled=no interface=ether5 name=dhcp1
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/interface detect-internet
set detect-interface-list=all
/ip address
add address=192.168.10.1/24 interface=ether5 network=192.168.10.0
/ip dhcp-client
add disabled=no interface=ether1
add disabled=no interface=ether2
/ip dhcp-server network
add address=192.168.0.0/24 dns-server=1.1.1.1,8.8.8.8 gateway=192.168.0.23
add address=192.168.10.0/24 dns-server=1.1.1.1,8.8.8.8 gateway=192.168.10.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8
/ip firewall mangle
add action=accept chain=prerouting dst-address=192.168.0.0/24
add action=accept chain=prerouting dst-address=192.168.10.0/24
add action=accept chain=prerouting dst-address=192.168.1.0/24
add action=mark-connection chain=prerouting in-interface=ether1 \
    new-connection-mark=ISP-FM passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether2 \
    new-connection-mark=ISP-MNC passthrough=yes
add action=mark-connection chain=prerouting in-interface=ether5 \
    new-connection-mark=ISP-FM passthrough=yes per-connection-classifier=\
    both-addresses:3/0
add action=mark-connection chain=prerouting in-interface=ether5 \
    new-connection-mark=ISP-FM passthrough=yes per-connection-classifier=\
    both-addresses:3/1
add action=mark-connection chain=prerouting in-interface=ether5 \
    new-connection-mark=ISP-MNC passthrough=yes per-connection-classifier=\
    both-addresses:3/2
add action=mark-routing chain=prerouting connection-mark=ISP-FM in-interface=\
    ether5 new-routing-mark=ke-ISP-FM passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP-MNC \
    in-interface=ether5 new-routing-mark=ke-ISP-MNC passthrough=yes
add action=mark-routing chain=output connection-mark=ISP-FM new-routing-mark=\
    ke-ISP-FM passthrough=yes
add action=mark-routing chain=output connection-mark=ISP-MNC \
    new-routing-mark=ke-ISP-MNC passthrough=yes
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2
/ip route
add check-gateway=ping distance=1 gateway=192.168.0.1 routing-mark=ISP-FM
add distance=2 gateway=192.168.1.1 routing-mark=ISP-FM
add check-gateway=ping distance=1 gateway=192.168.1.1 routing-mark=ISP-MNC
add distance=2 gateway=192.168.0.1 routing-mark=ISP-MNC
/system clock
set time-zone-name=Asia/Jakarta
/system identity
set name=BirdHub
/tool graphing interface
add interface=ether1
add interface=ether2
add interface=ether5
/tool graphing resource
add
I hope above information could help you to identify my mistakes, If you need further details, please let me know.

Regards,
Ferry
Last edited by ferryhtw on Tue May 18, 2021 1:50 pm, edited 1 time in total.
 
ferryhtw
just joined
Topic Author
Posts: 3
Joined: Thu May 13, 2021 3:23 pm
Location: Jakarta

Re: PCC Load Balance that not going to another Port

Tue May 18, 2021 1:50 pm

I found the solution, I combine several tutorial I found.
It is not perfect but it fits with my need.

Something that haven't implemented:
My ISP have asymectrical bandwith
ISP1: 60 Mbps Up / 10 Mbps Down
ISP2: 20 Mbps Up / 20 Mbps Down
My current configuration is not compensate the asymectrical bandwith (Both Up and Down and the diffrent between ISP1 and ISP2)

Below are my current configuration:
# may/18/2021 17:48:59 by RouterOS 6.47.6
# software id = 5DVB-AT6I
#
# model = RB750Gr3
# serial number = CC210D15213B
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp_pool0 ranges=192.168.10.2-192.168.10.254
/ip dhcp-server
add address-pool=dhcp_pool0 disabled=no interface=ether5 name=dhcp1
/snmp community
set [ find default=yes ] addresses=0.0.0.0/0 name=birdhub
/ip neighbor discovery-settings
set discover-interface-list=!dynamic
/ip address
add address=192.168.10.1/24 interface=ether5 network=192.168.10.0
/ip dhcp-client
add add-default-route=no disabled=no interface=ether1 script="{\r\
    \n    :local rmark \"ke-ISP-FM\"\r\
    \n    :local count [/ip route print count-only where comment=\"ke-ISP-FM\"\
    ]\r\
    \n    :if (\$bound=1) do={\r\
    \n        :if (\$count = 0) do={\r\
    \n\t\t\t/ip route add distance=1 dst-address=1.0.0.1/32 gateway=\$\"gatewa\
    y-address\" scope=25 comment=\"ke-ISP-FM\"\r\
    \n            /ip route add check-gateway=ping distance=1 gateway=1.0.0.1 \
    target-scope=25 comment=\"ke-ISP-FM\"\r\
    \n\t\t\t/ip route add distance=1 gateway=1.0.0.1 routing-mark=ke-ISP-FM ta\
    rget-scope=25 comment=\"ke-ISP-FM\"\r\
    \n\t\t\t/ip route add distance=2 gateway=8.8.4.4 routing-mark=ke-ISP-FM ta\
    rget-scope=25 comment=\"ke-ISP-FM\"\r\
    \n        } else={\r\
    \n            :if (\$count = 1) do={\r\
    \n                :local test [/ip route find where comment=\"ke-ISP-FM\"]\
    \r\
    \n                :if ([/ip route get \$test gateway] != \$\"gateway-addre\
    ss\") do={\r\
    \n                    /ip route set \$test gateway=\$\"gateway-address\"\r\
    \n                }\r\
    \n            } else={\r\
    \n                :error \"Multiple routes found\"\r\
    \n            }\r\
    \n        }\r\
    \n    } else={\r\
    \n        /ip route remove [find comment=\"ke-ISP-FM\"]\r\
    \n    }\r\
    \n}"
add add-default-route=no disabled=no interface=ether2 script="{\r\
    \n    :local rmark \"ke-ISP-MNC\"\r\
    \n    :local count [/ip route print count-only where comment=\"ke-ISP-MNC\
    \"]\r\
    \n    :if (\$bound=1) do={\r\
    \n        :if (\$count = 0) do={\r\
    \n\t\t\t/ip route add distance=1 dst-address=8.8.4.4/32 gateway=\$\"gatewa\
    y-address\" scope=25 comment=\"ke-ISP-MNC\"\r\
    \n            /ip route add check-gateway=ping distance=1 gateway=8.8.4.4 \
    target-scope=25 comment=\"ke-ISP-MNC\"\r\
    \n\t\t\t/ip route add distance=1 gateway=8.8.4.4 routing-mark=ke-ISP-MNC t\
    arget-scope=25 comment=\"ke-ISP-MNC\"\r\
    \n\t\t\t/ip route add distance=2 gateway=1.0.0.1 routing-mark=ke-ISP-MNC t\
    arget-scope=25 comment=\"ke-ISP-MNC\"\r\
    \n\t} else={\r\
    \n            :if (\$count = 1) do={\r\
    \n                :local test [/ip route find where comment=\"ke-ISP-MNC\"\
    ]\r\
    \n                :if ([/ip route get \$test gateway] != \$\"gateway-addre\
    ss\") do={\r\
    \n                    /ip route set \$test gateway=\$\"gateway-address\"\r\
    \n                }\r\
    \n            } else={\r\
    \n                :error \"Multiple routes found\"\r\
    \n            }\r\
    \n        }\r\
    \n    } else={\r\
    \n        /ip route remove [find comment=\"ke-ISP-MNC\"]\r\
    \n    }\r\
    \n}"
/ip dhcp-server lease
add address=192.168.10.105 client-id=1:2a:a1:9d:73:9c:81 mac-address=\
    2A:A1:9D:73:9C:81 server=dhcp1
add address=192.168.10.93 client-id=1:b8:27:eb:1:64:9b mac-address=\
    B8:27:EB:01:64:9B server=dhcp1
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=8.8.8.8 gateway=192.168.10.1
/ip dns
set allow-remote-requests=yes servers=1.1.1.1,8.8.8.8
/ip dns static
add address=192.168.10.1 name=birdhub.ferryhtw.com
/ip firewall mangle
add action=accept chain=prerouting in-interface=ether1
add action=accept chain=prerouting in-interface=ether2
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=FM_conn passthrough=yes per-connection-classifier=\
    both-addresses-and-ports:2/0 src-address=192.168.10.0/24
add action=mark-connection chain=prerouting dst-address-type=!local \
    new-connection-mark=MNC_conn passthrough=yes per-connection-classifier=\
    both-addresses-and-ports:2/1 src-address=192.168.10.0/24
add action=mark-routing chain=prerouting connection-mark=FM_conn \
    new-routing-mark=ke-ISP-FM passthrough=yes src-address=192.168.10.0/24
add action=mark-routing chain=prerouting connection-mark=MNC_conn \
    new-routing-mark=ke-ISP-MNC passthrough=yes src-address=192.168.10.0/24
/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1 src-address=\
    192.168.10.0/24
add action=masquerade chain=srcnat out-interface=ether2 src-address=\
    192.168.10.0/24
/ip route
add comment=ke-ISP-FM distance=1 gateway=1.0.0.1 routing-mark=ke-ISP-FM \
    target-scope=25
add comment=ke-ISP-FM distance=2 gateway=8.8.4.4 routing-mark=ke-ISP-FM \
    target-scope=25
add comment=ke-ISP-MNC distance=1 gateway=8.8.4.4 routing-mark=ke-ISP-MNC \
    target-scope=25
add comment=ke-ISP-MNC distance=2 gateway=1.0.0.1 routing-mark=ke-ISP-MNC \
    target-scope=25
add check-gateway=ping comment=ke-ISP-FM distance=1 gateway=1.0.0.1 \
    target-scope=25
add check-gateway=ping comment=ke-ISP-MNC distance=1 gateway=8.8.4.4 \
    target-scope=25
add comment=ke-ISP-FM distance=1 dst-address=1.0.0.1/32 gateway=192.168.0.1 \
    scope=25
add comment=ke-ISP-MNC distance=1 dst-address=8.8.4.4/32 gateway=192.168.1.1 \
    scope=25
/snmp
set contact=ferryhtw@gmail.com enabled=yes location=Jakarta trap-generators=\
    start-trap trap-interfaces=all
/system clock
set time-zone-name=Asia/Jakarta
/system identity
set name=BirdHub

Who is online

Users browsing this forum: GoogleOther [Bot], sokalsondha and 38 guests