×
หน้าหลัก > ข่าวและประกาศ > New.2025 Load-Balancing dhcp-2Wan.OS7 Script.
New.2025 Load-Balancing dhcp-2Wan.OS7 Script.
Images/Blog/Xlaqtqm1-2025-01-04_132949.jpg
เขียนโดย kapnetwork เมื่อ Sat 04 Jan, 2025
Like

คัดลอกและวางได้ทันที แก้ไขตามที่ต้องการ

#port 1 Wan Dhcp ip address 192.168.1.1
#port 2 Wan Dhcp ip address 192.168.2.1
#port 4 Wan Dhcp ip address 192.168.88.1

# 2025-01-04  by RouterOS 7.16.2

#
# model = All OS v7

/interface bridge
add name=ether_LAN

/interface list
add name=WAN
add name=LAN

/routing table
add fib name=to_ISP1
add fib name=to_ISP2

/interface list member
add interface=ether2 list=WAN
add interface=ether1 list=WAN
add interface=ether_LAN list=LAN

/ip dns
set allow-remote-requests=yes servers=8.8.8.8

/ip firewall mangle
add action=accept chain=prerouting in-interface=ether1
add action=accept chain=prerouting in-interface=ether2
add action=mark-connection chain=prerouting connection-mark=no-mark \
    in-interface=ether1 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 passthrough=yes
add action=mark-connection chain=prerouting dst-address-type=!local \
    in-interface=ether_LAN new-connection-mark=ISP1_conn passthrough=yes \
    per-connection-classifier=both-addresses-and-ports:2/0
add action=mark-connection chain=prerouting dst-address-type=!local \
    in-interface=ether_LAN new-connection-mark=ISP2_conn passthrough=yes \
    per-connection-classifier=both-addresses-and-ports:2/1
add action=mark-routing chain=prerouting connection-mark=ISP1_conn \
    in-interface=ether_LAN new-routing-mark=to_ISP1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP2_conn \
    in-interface=ether_LAN new-routing-mark=to_ISP2 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP1_conn \
    new-routing-mark=to_ISP1 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP2_conn \
    new-routing-mark=to_ISP2

/ip route
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.1.1 pref-src="" \
    routing-table=to_ISP1 scope=30 suppress-hw-offload=no target-scope=10
add disabled=no distance=1 dst-address=0.0.0.0/0 gateway=192.168.2.1 pref-src="" \
    routing-table=to_ISP2 scope=30 suppress-hw-offload=no target-scope=10

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

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

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

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

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

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


/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-2025 Vevo Systems Co., Ltd.