ดาวน์โหลด Script
ลบการตั้งค่าทั้งหมด
นำScriptใส่
สามารถแก้ไข เพิ่มเติมได้ ทันที
#Port1 Wan เน็ตเข้า dhcp-client
#Port2 Wan เน็ตเข้า pppoe-client
#Port3 dhcp 192.168.88.xx
#Port4 dhcp 192.168.89.xx
#Port5 ว่าง
#RouterOS v7
/interface bridge
add name=br-first
add name=br-other
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 name=pppoe-out1 \
password=2222 use-peer-dns=yes user=2222
/ip dhcp-client
add default-route-distance=2 interface=ether2
/ip address
add address=192.168.88.1/24 interface=br-first network=192.168.88.0
add address=192.168.89.1/24 interface=br-other network=192.168.89.0
/ip pool
add name=dhcp_pool0 ranges=192.168.88.2-192.168.88.200
add name=dhcp_pool1 ranges=192.168.89.2-192.168.89.200
/ip dhcp-server
add address-pool=dhcp_pool0 interface=br-first name=dhcp1
add address-pool=dhcp_pool1 interface=br-other name=dhcp2
/ip dhcp-server network
add address=192.168.88.0/24 gateway=192.168.88.1
add address=192.168.89.0/24 gateway=192.168.89.1
/routing table
add fib name=to_ISP1
add fib name=to_ISP2
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip route
add disabled=no distance=2 dst-address=0.0.0.0/0 gateway=192.168.5.1 \
pref-src="" routing-table=to_ISP2 scope=30 suppress-hw-offload=no \
target-scope=10
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
pppoe-out1 pref-src="" routing-table=to_ISP1 scope=30 \
suppress-hw-offload=no target-scope=10
/ip firewall mangle
add action=accept chain=prerouting in-interface=pppoe-out1
add action=accept chain=prerouting in-interface=ether2
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=pppoe-out1 new-connection-mark=ISP1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark \
in-interface=ether2 new-connection-mark=ISP2_conn
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=br-first new-connection-mark=\
ISP1_conn passthrough=yes per-connection-classifier=both-addresses:1/0
add action=mark-connection chain=prerouting connection-mark=no-mark \
dst-address-type=!local in-interface=br-other new-connection-mark=\
ISP2_conn passthrough=yes per-connection-classifier=both-addresses:1/0
add action=mark-routing chain=prerouting connection-mark=ISP1_conn \
in-interface=br-first new-routing-mark=to_ISP1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP2_conn \
in-interface=br-other new-routing-mark=to_ISP2 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP1_conn \
new-routing-mark=to_ISP1
add action=mark-routing chain=output connection-mark=ISP2_conn \
new-routing-mark=to_ISP2
/ip firewall nat
add action=masquerade chain=srcnat out-interface=pppoe-out1 src-address=\
192.168.88.0/24
add action=masquerade chain=srcnat out-interface=pppoe-out1 src-address=\
192.168.89.0/24
add action=masquerade chain=srcnat out-interface=ether2 src-address=\
192.168.88.0/24
add action=masquerade chain=srcnat out-interface=ether2 src-address=\
192.168.89.0/24
/system clock
set time-zone-name=Asia/Bangkok
/interface bridge port
add bridge=br-other interface=ether4
add bridge=br-first interface=ether3