ผมลองเอาโค้ดมาปรับแก้เอง คือถ้าเสียบอินเตอร์เน็ตเส้นเดี่ยว(เฉพาะ port 1)จะใช้งานปกติ ถ้าเสียบ 2 เส้นเน็ตจะหลุดทั้นที (port 1 True 15/1 : port 2 tot fiber 50/20)
โค้ดตามนี้ครับ ขอคำชี้่แนะด้วยครับ
ใช้ตัว RB2011UiAS-2HnD-IN FW:V6.34rc3 ทำ Loadbalannce ปัญหาตอนนี้คือ ถ้าเสียบเน็ตเข้าไป 2 เส้นเน็ตทั้ง Lan จะหลุดไปทั้งหมด แต่ดูจาก interface เน็ตทั้งสองเส้นไม่ได้หลุด ครับ จึงยากขอคำชี้แนะด้วยครับ (มือใหม่ครับ หาข้อมูลมาปรับแก้)
โค้คที่ผมเอามาปรับแก้ครับ
#|/ip address
/ip address add address=192.168.1.1/24 network=192.168.1.0 broadcast=192.168.1.255 interface=ether5 comment="default configuration"
#master port
#/interface ethernet set ether4,ether5 master-port=ether3
#|/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=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
#|Speed Balance 15/60=1:4
/ip firewall mangle add chain=preroutingdst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:5/0 action=mark-connection new-connection-mark=ether1_conn passthrough=yes
/ip firewall mangle add chain=preroutingdst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:5/1 action=mark-connection new-connection-mark=ether2_conn passthrough=yes
/ip firewall mangle add chain=preroutingdst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:5/2 action=mark-connection new-connection-mark=ether2_conn passthrough=yes
/ip firewall mangle add chain=preroutingdst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:5/3 action=mark-connection new-connection-mark=ether2_conn passthrough=yes
/ip firewall mangle add chain=preroutingdst-address-type=!local in-interface=ether5 per-connection-classifier=both-addresses-and-ports:5/4 action=mark-connection new-connection-mark=ether2_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
#|/iproute
/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-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 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
#| DHCP server is on switch, with address pool 192.168.1.30-192.168.1.79
/ip pool add name=default-dhcp ranges=192.168.1.30-192.168.1.79
/ipdhcp-server add name=default address-pool=default-dhcp interface=ether5 disabled=no
/ipdhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=8.8.8.8,8.8.4.4 comment="default configuration"
#| DNS
#/ipdns set allow-remote-requests=yes
#/ipdns static add name=router address=192.168.1.1
#| 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
/ipdns set allow-remote-requests=yes cache-max-ttl=1w cache-size=5000K max-udp-packet-size=512 servers=8.8.8.8,8.8.4.4
Users found this pages searching for: