🌐 LB PCC 5 Line ISP Failover

❗ Muammo

MikroTik RouterOS da 5 ta ISP liniyasi bo’lgan tarmoqlarda LB PCC usuli bilan trafigni tejalashtirish muammosi.

🎯 Yechim

Bu muammoni yechish uchun LB PCC skriptidan foydalanish mumkin.

🛠 Sozlash bosqichlari

1️⃣ RouterOS ni sozlash

RouterOS da LB PCC skriptini ishga tushirish uchun quyidagi bosqichlarni bajaring.

/ip firewall address-list
add address=192.168.0.0/16 list=LOCAL-IP
add address=172.16.0.0/12 list=LOCAL-IP
add address=10.0.0.0/8 list=LOCAL-IP

/ip firewall nat
add chain=srcnat out-interface="ether1" action=masquerade
add chain=srcnat out-interface="ether2" action=masquerade
add chain=srcnat out-interface="ether3" action=masquerade
add chain=srcnat out-interface="ether4" action=masquerade
add chain=srcnat out-interface="ether5" action=masquerade

/ip route
add check-gateway=ping distance=1 gateway="192.168.1.1" routing-mark="to-ether1"
add check-gateway=ping distance=1 gateway="192.168.2.1" routing-mark="to-ether2"
add check-gateway=ping distance=1 gateway="192.168.3.1" routing-mark="to-ether3"
add check-gateway=ping distance=1 gateway="192.168.4.1" routing-mark="to-ether4"
add check-gateway=ping distance=1 gateway="192.168.5.1" routing-mark="to-ether5"
add check-gateway=ping distance=1 gateway="192.168.1.1"
add check-gateway=ping distance=2 gateway="192.168.2.1"
add check-gateway=ping distance=3 gateway="192.168.3.1"
add check-gateway=ping distance=4 gateway="192.168.4.1"
add check-gateway=ping distance=5 gateway="192.168.5.1"

/ip firewall mangle
add action=mark-connection chain=input in-interface="ether1" new-connection-mark="cm-ether1" passthrough=yes
add action=mark-connection chain=input in-interface="ether2" new-connection-mark="cm-ether2" passthrough=yes
add action=mark-connection chain=input in-interface="ether3" new-connection-mark="cm-ether3" passthrough=yes
add action=mark-connection chain=input in-interface="ether4" new-connection-mark="cm-ether4" passthrough=yes
add action=mark-connection chain=input in-interface="ether5" new-connection-mark="cm-ether5" passthrough=yes
add action=mark-routing chain=output connection-mark="cm-ether1" new-routing-mark="to-ether1" passthrough=yes
add action=mark-routing chain=output connection-mark="cm-ether2" new-routing-mark="to-ether2" passthrough=yes
add action=mark-routing chain=output connection-mark="cm-ether3" new-routing-mark="to-ether3" passthrough=yes
add action=mark-routing chain=output connection-mark="cm-ether4" new-routing-mark="to-ether4" passthrough=yes
add action=mark-routing chain=output connection-mark="cm-ether5" new-routing-mark="to-ether5" passthrough=yes
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP dst-address-type=!local new-connection-mark="cm-ether1" passthrough=yes per-connection-classifier=both-addresses-and-ports:5/0 src-address-list=LOCAL-IP
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP dst-address-type=!local new-connection-mark="cm-ether2" passthrough=yes per-connection-classifier=both-addresses-and-ports:5/1 src-address-list=LOCAL-IP
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP dst-address-type=!local new-connection-mark="cm-ether3" passthrough=yes per-connection-classifier=both-addresses-and-ports:5/2 src-address-list=LOCAL-IP
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP dst-address-type=!local new-connection-mark="cm-ether4" passthrough=yes per-connection-classifier=both-addresses-and-ports:5/3 src-address-list=LOCAL-IP
add action=mark-connection chain=prerouting dst-address-list=!LOCAL-IP dst-address-type=!local new-connection-mark="cm-ether5" passthrough=yes per-connection-classifier=both-addresses-and-ports:5/4 src-address-list=LOCAL-IP
add action=mark-routing chain=prerouting connection-mark="cm-ether1" dst-address-list=!LOCAL-IP new-routing-mark="to-ether1" passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=prerouting connection-mark="cm-ether2" dst-address-list=!LOCAL-IP new-routing-mark="to-ether2" passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=prerouting connection-mark="cm-ether3" dst-address-list=!LOCAL-IP new-routing-mark="to-ether3" passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=prerouting connection-mark="cm-ether4" dst-address-list=!LOCAL-IP new-routing-mark="to-ether4" passthrough=yes src-address-list=LOCAL-IP
add action=mark-routing chain=prerouting connection-mark="cm-ether5" dst-address-list=!LOCAL-IP new-routing-mark="to-ether5" passthrough=yes src-address-list=LOCAL-IP

⚠️ Diqqat

RouterOS versiyasi farqi bo’lishi mumkin.

  • RouterOS v6 va RouterOS v7 da LB PCC skripti ishga tushirilishi farq qilishi mumkin.

✅ Xulosa

LB PCC skripti RouterOS da 5 ta ISP liniyasi bo’lgan tarmoqlarda trafigni tejalashtirish uchun ishlatiladi.

0 0 ovozlar
Article Rating
Obuna boʻling
Xabar berish
guest

0 Comments
Eng avvalgi
Eng yangi Eng ko'p ovoz berilgan