/interface ethernet
set [ find default-name=ether1 ] name=WAN1
set [ find default-name=ether2 ] name=WAN2
set [ find default-name=ether3 ] name=ether3
set [ find default-name=ether4 ] name=ether4
set [ find default-name=ether5 ] name=Local
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1-WAN1 name=pppoe-out1 \
password=XXXX use-peer-dns=yes user=XXXXXXX@onnet.b
/ip address
add address=192.168.1.1/24 network=192.168.1.0 broadcast=192.168.1.255 interface=Local
add address=192.168.10.2/24 network=192.168.10.0 broadcast=192.168.10.255 interface=WAN2
/ip firewall mangle
add chain=input in-interface=pppoe-out1 action=mark-connection new-connection-mark=WAN1_conn
add chain=input in-interface=WAN2 action=mark-connection new-connection-mark=WAN2_conn
add chain=output connection-mark=WAN1_conn action=mark-routing new-routing-mark=to_WAN1
add chain=output connection-mark=WAN2_conn action=mark-routing new-routing-mark=to_WAN2
add action=mark-connection chain=prerouting dst-address-type=!local \
new-connection-mark=wan1_conn passthrough=yes per-connection-classifier=\
both-addresses-and-ports:3/0 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting dst-address-type=!local \
new-connection-mark=WAN1_conn passthrough=yes per-connection-classifier=\
both-addresses-and-ports:3/1 src-address=192.168.1.0/24
add action=mark-connection chain=prerouting dst-address-type=!local \
new-connection-mark=WAN2_conn passthrough=yes per-connection-classifier=\
both-addresses-and-ports:3/1 src-address=192.168.1.0/24
add action=mark-routing chain=prerouting connection-mark=WAN2_conn \
add chain=prerouting connection-mark=WAN1_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN1
add chain=prerouting connection-mark=WAN2_conn in-interface=Local action=mark-routing new-routing-mark=to_WAN2
/ip route
add dst-address=0.0.0.0/0 distance=1 gateway=pppoe-out1 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 distance=1 gateway=WAN2 routing-mark=to_WAN2 check-gateway=ping
add dst-address=0.0.0.0/0 distance=2 gateway=pppoe-out1 routing-mark=to_WAN2 check-gateway=ping
add dst-address=0.0.0.0/0 distance=2 gateway=WAN2 routing-mark=to_WAN1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=pppoe-out1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=WAN2 distance=2 check-gateway=ping
/ip firewall nat
add chain=srcnat out-interface=pppoe-out1 action=masquerade
add chain=srcnat out-interface=WAN2 action=masquerade
/ip pool add name=default-dhcp ranges=192.168.1.2-192.168.1.255
/ip dhcp-server add name=default address-pool=default-dhcp interface=Local disabled=no
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=192.168.1.1 comment="default configuration"
/ip dns 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
/system clock set time-zone-name=Asia/Bangkok
/system ntp client set enabled=yes mode=unicast primary-ntp=203.185.67.115 secondary-ntp=203.185.67.115
หมายเหตุ ยังไม่ได้ทดสอบ 555555
อ้างอิง
ความคิดเห็น
แสดงความคิดเห็น
ติดต่อสอบถามได้ที่ Email : warut.ruk@gmail.com