×
หน้าหลัก > ข่าวและประกาศ > Load Balancing_2Wan.dhcp-Static OSv7
Load Balancing_2Wan.dhcp-Static OSv7
Images/Blog/gS28gaxU-Untitled-2.jpg
เขียนโดย kapnetwork เมื่อ Tue 05 Sep, 2023
Like

Download PDF

link Script

ทดสอบการใช้งาน Script

ความเร็ว  แต่ละเส้น
เน็ต เส้น 1 ความเร็ว 15Mbps
เน็ต เส้น 2ความเร็ว 15Mbps

Web ที่ใช้ทดสอบ https://www.speedtest.net/th

                จะเป็นการกระจายความเร็ว บางครั้งจะ test speed เป็น 15 หรือ30 Mbps

Load Balancing

Load Balancing แบบ PCC [Per connection classifier]
                การทำงาน ของ Load Balancing แบบ PCC จะช่วยให้คุณสามารถแบ่ง การกระจายทราฟฟิก [traffic] การใช้งาน web สตรีม [stream]ออกเท่าๆ กัน ด้วยความสามารถนี้จะทำให้การใช้งาน ได้อย่างราบรื่นInternetไม่สะดุดอีกต่อไป
แหล่งที่มาhttps://help.mikrotik.com/docs/display/ROS/Per+connection+classifier

1.สร้าง bridge ขึ้นเพื่อจะนำมาใช้งานกับ Load Balancing
                /interface bridge add name=ether_LAN
2.สร้าง ip address และDhcp server ที่ต้องการ พร้อมสร้าง Nat ในการออกเน็ต
3.นำ Port ที่ต้องการใช้งาน Load Balancing เข้าไปไว้ใน bridge
/interface bridge port add bridge=ether_LAN interface=ether5

4.สร้าง routing table
/routing table
add disabled=no fib name=ISP1_table
add disabled=no fib name=ISP2_table

5.กำหนด route
/ip route
add check-gateway=ping disabled=no dst-address=0.0.0.0/0 gateway=10.10.4.1 \

    routing-table=ISP1_table

add check-gateway=ping disabled=no dst-address=0.0.0.0/0 gateway=10.10.5.1 \

    routing-table=ISP2_table

Firewall Mangle

6. กำหนด ชื่อPPPOEหรือตัวเลขIP Gateway เพื่อนำไปใช้งาน Firewall Mangle IP Gateway  ได้มาจาก ผู้ให้บริการInternet

/ip route

add check-gateway=ping disabled=no dst-address=0.0.0.0/0 gateway=10.10.4.1 \

    routing-table=ISP1_table

add check-gateway=ping disabled=no dst-address=0.0.0.0/0 gateway=10.10.5.1 \

    routing-table=ISP2_table

นำโค้ดใส่ หากจุดไหนไม่ตรงสามารถแก้ไขได้ทันที

/ip firewall mangle

add action=accept chain=prerouting dst-address=10.10.4.0/24 in-interface=ether_LAN

add action=accept chain=prerouting dst-address=10.10.5.0/24 in-interface=ether_LAN

add action=mark-connection chain=input connection-state=new in-interface=ether1 new-connection-mark=ISP1 passthrough=yes

add action=mark-connection chain=input connection-state=new in-interface=ether2 new-connection-mark=ISP2 passthrough=yes

add action=mark-connection chain=output connection-mark=no-mark \

    connection-state=new new-connection-mark=ISP1 passthrough=yes per-connection-classifier=both-addresses:2/0

add action=mark-connection chain=output connection-mark=no-mark \

    connection-state=new new-connection-mark=ISP2 passthrough=yes per-connection-classifier=both-addresses:2/1

add action=mark-connection chain=prerouting connection-mark=no-mark connection-state=new dst-address-type=!local in-interface=ether_LAN \

    new-connection-mark=ISP1 passthrough=yes per-connection-classifier=both-addresses:2/0

add action=mark-connection chain=prerouting connection-mark=no-mark connection-state=new dst-address-type=!local in-interface=ether_LAN \

    new-connection-mark=ISP2 passthrough=yes per-connection-classifier=both-addresses:2/1

add action=mark-routing chain=output connection-mark=ISP1 new-routing-mark=ISP1_table passthrough=yes

add action=mark-routing chain=prerouting connection-mark=ISP1 in-interface=ether_LAN new-routing-mark=ISP1_table passthrough=yes

add action=mark-routing chain=output connection-mark=ISP2 new-routing-mark=ISP2_table passthrough=yes

add action=mark-routing chain=prerouting connection-mark=ISP2 in-interface=ether_LAN new-routing-mark=ISP2_table passthrough=yes

แท๊ก
ความคิดเห็น (0)
ก่อนหน้า 1 ถัดไป
ร้านค้าออนไลน์ และ ขายของออนไลน์ โดย © 2006-2024 Vevo Systems Co., Ltd.