รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

วิธีการติดตั้ง และปรับแต่งอุปกรณ์ Mikrotik
ให้รองรับการทำงานที่หลากหลายความต้องการ
การติดตั้ง HotSpot Server, การติดตั้ว Load Balanced ฯลฯ

รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย chok23 เมื่อ ศุกร์ 16 ต.ค. 2015 4:15 pm

L3.jpg
L3.jpg (68.34 KiB) เปิดดู 9330 ครั้ง
รบกวนช่วยแนะนำด้วยครับว่ามันเกิดจากอะไร PPoE3และPPoE4 ได้ไอพีไม่เหมือนกัน แต่ดูในIP>Routes ทั้งสองเส้นเป็นไอพีเดียวกัน พอทำโหลดบาลานซ์แล้ว กลายเป็นว่า สองเส้นนี้เป็นเส้นเดียวกันคือผลสปีดเทสได้10/512 ลองDisable อีกเส้นแล้วสปีดเทส ความเร็วก็ตรงตามแพ็คเกจของแต่ละสาย คือ10/512ทั้งสองเส้น เป็นADSL ของ3bb ครับ
แนบไฟล์
Rout.jpg
Rout.jpg (100.68 KiB) เปิดดู 9327 ครั้ง
l4.jpg
l4.jpg (67.65 KiB) เปิดดู 9311 ครั้ง
chok23
 
โพสต์: 17
ลงทะเบียนเมื่อ: พุธ 25 มี.ค. 2009 1:30 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย chok23 เมื่อ เสาร์ 17 ต.ค. 2015 8:19 am

ใช้ Script ตัวนี้ครับจาก เว็บSys2Uครับ
#|/ip address
/ip address add address=192.168.1.2/24 network=192.168.1.0 broadcast=192.168.1.255 interface=ether5 comment="default configuration"

#|/ip firewall mangle
/ip firewall mangle add chain=input in-interface=pppoe-out1 action=mark-connection new-connection-mark=ether1_conn
/ip firewall mangle add chain=input in-interface=pppoe-out2 action=mark-connection new-connection-mark=ether2_conn
/ip firewall mangle add chain=input in-interface=pppoe-out3 action=mark-connection new-connection-mark=ether3_conn
/ip firewall mangle add chain=input in-interface=pppoe-out4 action=mark-connection new-connection-mark=ether4_conn

/ip firewall mangle add chain=output connection-mark=ether1_conn action=mark-routing new-routing-mark=to_ether1
/ip firewall mangle add chain=output connection-mark=ether2_conn action=mark-routing new-routing-mark=to_ether2
/ip firewall mangle add chain=output connection-mark=ether3_conn action=mark-routing new-routing-mark=to_ether3
/ip firewall mangle add chain=output connection-mark=ether4_conn action=mark-routing new-routing-mark=to_ether4

/ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-mark=ether1_conn passthrough=yes
/ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:4/1 action=mark-connection new-connection-mark=ether2_conn passthrough=yes
/ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:4/2 action=mark-connection new-connection-mark=ether3_conn passthrough=yes
/ip firewall mangle add chain=prerouting dst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:4/3 action=mark-connection new-connection-mark=ether4_conn passthrough=yes

/ip firewall mangle add chain=prerouting connection-mark=ether1_conn in-interface=ether5 action=mark-routing new-routing-mark=to_ether1
/ip firewall mangle add chain=prerouting connection-mark=ether2_conn in-interface=ether5 action=mark-routing new-routing-mark=to_ether2
/ip firewall mangle add chain=prerouting connection-mark=ether3_conn in-interface=ether5 action=mark-routing new-routing-mark=to_ether3
/ip firewall mangle add chain=prerouting connection-mark=ether4_conn in-interface=ether5 action=mark-routing new-routing-mark=to_ether4


#|/ip route
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_ether1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_ether2 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_ether3 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out4 routing-mark=to_ether4 check-gateway=ping

/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out2 distance=2 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out3 distance=3 check-gateway=ping
/ip route add dst-address=0.0.0.0/0 gateway=pppoe-out4 distance=4 check-gateway=ping

#|/ip firewall nat
/ip firewall nat add chain=srcnat out-interface=pppoe-out1 action=masquerade
/ip firewall nat add chain=srcnat out-interface=pppoe-out2 action=masquerade
/ip firewall nat add chain=srcnat out-interface=pppoe-out3 action=masquerade
/ip firewall nat add chain=srcnat out-interface=pppoe-out4 action=masquerade

#| DHCP server is on switch, with address pool 192.168.1.151-192.168.1.200
/ip pool add name=default-dhcp ranges=192.168.1.151-192.168.1.200
/ip dhcp-server add name=default address-pool=default-dhcp interface=ether5 disabled=no
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.2 dns-server=192.168.1.2 comment="default configuration"

#| DNS
/ip dns set allow-remote-requests=yes
/ip dns static add name=router address=192.168.1.2

#| Now Configure DNS server so users can resolve hostnames,
#| Ex.cache-size=5000KiB
#| DNS Google = 8.8.8.8,8.8.4.4
#| DNS 3BB = 110.164.252.222,110.164.252.223
/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000K max-udp-packet-size=512 servers=110.164.252.222,110.164.252.223
chok23
 
โพสต์: 17
ลงทะเบียนเมื่อ: พุธ 25 มี.ค. 2009 1:30 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย jadeson เมื่อ อาทิตย์ 18 ต.ค. 2015 2:12 pm

ตามโค้ดตัวอย่าง

จะเป็น 4 PPPoE to 1 LAN loabbalance
port1 - wan PPPoE 1
port2 - wan PPPoE 2
port3 - wan PPPoE 3
port4 - wan PPPoE 4
port5 - Loadbalance

คุณมีเน็ต adsl กี่เส้น
ปกติเลย IP ที่ขึ้นมาของแต่ละ WAN ก็จะเป็น IP จริงที่ได้รับจากผู้ให้บริการของขา WAN นั้นๆ

ไม่ทราบว่าตอนเทสสปีดใช้อะไรเทสครับ แนะนำให้ลองเทสผ่านเว็ป testspeed ที่รองรับ multi session หรือจะเทสโดยการโหลดบิทเต็มสปีดที่มี seed เยอะๆ ก็ได้ครับ
SYS2U.COM 24-Hour Online IT Store
ซิสทูยู เฟสบุ๊ค - http://www.facebook.com/SYS2UOnline

ภาพประจำตัวสมาชิก
jadeson
 
โพสต์: 619
ลงทะเบียนเมื่อ: อังคาร 03 ก.พ. 2009 4:50 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย chok23 เมื่อ จันทร์ 19 ต.ค. 2015 9:30 am

มีADSL 4 สายครับ กรณีอย่างในภาพนี้สาย3และ4 เร้าท์ออกที่ไอพีแวนเดียวกันคือไอพีแวนของสายที่4 ถ้าผมDisableสายที่3ไว้สักพัก สายที่3แวนก็จะเร้าออกที่ไอพีแวนสาย3ได้ และซีพียูก็จะวิ่งอยู่ระหว่าง 30-100เปอร์เซนต์ ผมไม่แน่ใจว่าเป็นที่ผู้ให้บริการหรือเป็นที่ตัวไมโครติกกันแน่ครับ เฟิร์มแวร์ก็ล่าสุดแล้ว(3.24) ส่วนเรื่องโหลดบาลานซ์ ที่ความเร็วตก ผมได้ทดสอบปิดFirewall Filter และSyslog แล้วเทสสปีดความเร็วที่ออกมาก็จะเพิ่มขึ้นครับ เว็บที่ใช้เทส คือ 3bb และ speedtest.net ครับ
แนบไฟล์
resourse.jpg
resourse.jpg (57.84 KiB) เปิดดู 9170 ครั้ง
chok23
 
โพสต์: 17
ลงทะเบียนเมื่อ: พุธ 25 มี.ค. 2009 1:30 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย jadeson เมื่อ จันทร์ 19 ต.ค. 2015 2:37 pm

chok23 เขียน:มีADSL 4 สายครับ กรณีอย่างในภาพนี้สาย3และ4 เร้าท์ออกที่ไอพีแวนเดียวกันคือไอพีแวนของสายที่4 ถ้าผมDisableสายที่3ไว้สักพัก สายที่3แวนก็จะเร้าออกที่ไอพีแวนสาย3ได้ และซีพียูก็จะวิ่งอยู่ระหว่าง 30-100เปอร์เซนต์ ผมไม่แน่ใจว่าเป็นที่ผู้ให้บริการหรือเป็นที่ตัวไมโครติกกันแน่ครับ เฟิร์มแวร์ก็ล่าสุดแล้ว(3.24) ส่วนเรื่องโหลดบาลานซ์ ที่ความเร็วตก ผมได้ทดสอบปิดFirewall Filter และSyslog แล้วเทสสปีดความเร็วที่ออกมาก็จะเพิ่มขึ้นครับ เว็บที่ใช้เทส คือ 3bb และ speedtest.net ครับ


รบกวนตรวจสอบ
- เช็ค IP ขา WAN ที่เข้ามาผ่าน เมนู IP > Address > Address List
สังเกตุ แต่ละ pppoe-out1 - 4 ก็จะมี IP ขา WAN แสดง

ปกติแล้ว IP ขา WAN จะต้องเป็น IP คนละ ip กันน่ะครับ

Mikrotik ที่ใช้เป็นรุ่นอะไรครับ แล้วรองรับ Client ประมาณเท่าไร

ตัวอย่าง
address list.JPG
address list.JPG (44.68 KiB) เปิดดู 9163 ครั้ง
SYS2U.COM 24-Hour Online IT Store
ซิสทูยู เฟสบุ๊ค - http://www.facebook.com/SYS2UOnline

ภาพประจำตัวสมาชิก
jadeson
 
โพสต์: 619
ลงทะเบียนเมื่อ: อังคาร 03 ก.พ. 2009 4:50 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย chok23 เมื่อ จันทร์ 19 ต.ค. 2015 3:48 pm

ไอพีแวนที่ได้รับทั้ัง4สายไม่ซ้ำกันครับ
RB2011UiAS-RM
Hotspot Client ทั้งหมด 50 เครื่องไม่ออนไลน์พร้อมกัน
Binding 20 เครื่องครับ
แนบไฟล์
adress list.jpg
adress list.jpg (37.76 KiB) เปิดดู 9155 ครั้ง
chok23
 
โพสต์: 17
ลงทะเบียนเมื่อ: พุธ 25 มี.ค. 2009 1:30 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย chok23 เมื่อ อังคาร 20 ต.ค. 2015 8:03 am

อันล่าสุดครับ
แนบไฟล์
Rout2.jpg
Rout2.jpg (107.73 KiB) เปิดดู 9136 ครั้ง
adress list2.jpg
adress list2.jpg (37.74 KiB) เปิดดู 9122 ครั้ง
chok23
 
โพสต์: 17
ลงทะเบียนเมื่อ: พุธ 25 มี.ค. 2009 1:30 pm

Re: รบกวนสอบถามเกี่ยวกับโหลดบาลานซ์

โพสต์โดย jadeson เมื่อ พุธ 21 ต.ค. 2015 12:39 pm

chok23 เขียน:อันล่าสุดครับ


ถ้าตามโค้ดตัวอย่างที่ให้ จะทำ loadbalance ออก port 5 น่ะครับ ยังไม่มี hotspot (ส่วนใหญ่จะแนะนำให้ทำ hotspot แยก port อื่นที่เหลือ

ตามตัวอย่าง ถ้ามีการทำ hotspot ตัวนี้จะไม่รวมเน็ตให้น่ะครับ

ส่วนเรื่องที่ขา WAN ที่ซ้ำ สังเกตุ ถึงจะได้ IP ไม่ซ้ำกัน แต่ sub netmark เหมือนกัน

ตัว mikrotik จึง route ตัว sub netmark ที่ซ้ำกัน ไว้ด้วยกัน แล้วออก IP ขา WAN ลำดับแรกก่อน

ส่วนวิธีแก้คงต้อง เขียน route ขึ้นมาเอง แต่จะมานั่งเปลี่ยน ip ตามที่ผู้ให้บริการแจกมา ก็ดูจะวุ่นวายน่ะครับ

ขอบคุณครับ
SYS2U.COM 24-Hour Online IT Store
ซิสทูยู เฟสบุ๊ค - http://www.facebook.com/SYS2UOnline

ภาพประจำตัวสมาชิก
jadeson
 
โพสต์: 619
ลงทะเบียนเมื่อ: อังคาร 03 ก.พ. 2009 4:50 pm


ย้อนกลับไปยัง วิธีการติดตั้งและปรับแต่งอุปกรณ์ Mikrotik

ผู้ใช้งานขณะนี้

กำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และ บุคคลทั่วไป 14 ท่าน