×
หน้าหลัก > ข่าวและประกาศ > Load-Balancing dhcp-2Wan.OS7 Script.
Load-Balancing dhcp-2Wan.OS7 Script.
Images/Blog/AS3mrO7o-Load balance OS7.png
เขียนโดย kapnetwork เมื่อ Wed 03 Jan, 2024
Like

#  by RouterOS 7.12.1

#

/interface bridge
add name=ether_LAN

/ip address
add address=192.168.88.1/24 interface=ether_LAN network=192.168.88.0

/ip pool
add name=dhcp_pool0 ranges=192.168.88.2-192.168.88.254

/ip dhcp-server
add address-pool=dhcp_pool0 interface=ether_LAN name=dhcp1

/routing table
add disabled=no fib name=ISP1_table
add disabled=no fib name=ISP2_table

/ip dhcp-client
add interface=ether1
add default-route-distance=2 interface=ether2

/ip dhcp-server network
add address=192.168.88.0/24 dns-server=192.168.88.1 gateway=192.168.88.1

/ip dns
set allow-remote-requests=yes cache-size=5000KiB max-udp-packet-size=512 \
    servers=8.8.8.8

/ip route
add check-gateway=ping disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    192.168.1.1%ether1 pref-src="" routing-table=ISP1_table 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=\
    192.168.1.1%ether2 pref-src="" routing-table=ISP2_table scope=30 \
    suppress-hw-offload=no target-scope=10

/ip firewall mangle
add action=accept chain=prerouting dst-address=192.168.1.0/24 in-interface=\
    ether_LAN
add action=accept chain=prerouting dst-address=192.168.1.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

/ip firewall nat
add action=masquerade chain=srcnat out-interface=ether1 src-address=\
    192.168.88.0/24
add action=masquerade chain=srcnat out-interface=ether2 src-address=\
    192.168.88.0/24

/system clock
set time-zone-name=Asia/Bangkok

/system identity
set name=load-Balancing

/interface bridge port
add bridge=ether_LAN interface=ether4

แหล่งที่มา


 

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