以下是二线设置代码
说明:Local为内网 wlan1、wlan2为外网
/ ip address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 interface=Local
add address=10.111.0.2/24 network=10.111.0.0 broadcast=10.111.0.255 interface=wlan2
add address=10.112.0.2/24 network=10.112.0.0 broadcast=10.112.0.255 interface=wlan1
/ ip firewall mangle
add chain=input in-interface=wlan1 action=mark-connection new-connection-mark=wlan1_conn
add chain=input in-interface=wlan2 action=mark-connection new-connection-mark=wlan2_conn
add chain=output connection-mark=wlan1_conn action=mark-routing new-routing-mark=to_wlan1
add chain=output connection-mark=wlan2_conn action=mark-routing new-routing-mark=to_wlan2
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses:2/0
action=mark-connection new-connection-mark=wlan1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=Local per-connection-classifier=both-addresses:2/1
action=mark-connection new-connection-mark=wlan2_conn passthrough=yes
add chain=prerouting connection-mark=wlan1_conn in-interface=Local action=mark-routing new-routing-mark=to_wlan1
add chain=prerouting connection-mark=wlan2_conn in-interface=Local action=mark-routing new-routing-mark=to_wlan2
/ ip route
add dst-address=0.0.0.0/0 gateway=10.111.0.1 routing-mark=to_wlan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.112.0.1 routing-mark=to_wlan2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.111.0.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=10.112.0.1 distance=2 check-gateway=ping
/ ip firewall nat
add chain=srcnat out-interface=wlan1 action=masquerade
add chain=srcnat out-interface=wlan2 action=masquerade
PCC双线负载均衡配置脚本
/ip firewall mangle
add action=change-mss chain=forward comment="" disabled=no new-mss=1400 protocol=tcp tcp-flags=syn
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out1 new-connection-mark=pppoe-out1_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out2 new-connection-mark=pppoe-out2_conn passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out1_conn disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out2_conn disabled=no new-routing-mark=to_pppoe-out2 passthrough=yes
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out1_conn disabled=no in-interface=LAN new-routing-mark=to_pppoe-out1 passthrough=yes
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out2_conn disabled=no in-interface=LAN new-routing-mark=to_pppoe-out2 passthrough=yes
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=pppoe-out1_conn passthrough=yes
per-connection-classifier=both-addresses:2/0
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local in-interface=LAN new-connection-mark=pppoe-out2_conn passthrough=yes
per-connection-classifier=both-addresses:2/1
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out1_conn disabled=no in-interface=LAN new-routing-mark=to_pppoe-out1 passthrough=yes
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out2_conn disabled=no in-interface=LAN new-routing-mark=to_pppoe-out2 passthrough=yes
/ip route
add comment=adsl2 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=122.232.29.133 routing-mark=to_pppoe-out2 scope=30 target-scope=10
add comment=adsl1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=122.232.17.225 routing-mark=to_pppoe-out1 scope=30 target-scope=10
/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out1
如果你是ADSL动态IP和动态网关,请用动态脚本改变
:global assignaddress
:global newaddress
:global status
:global x
:global i
:set x 2
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=("pppoe-out" . $i)] running]
:if ($status=true) do={
:set newaddress [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
:set newaddress [:pick $newaddress 0 [:find $newaddress "/"]]
:set assignaddress [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
:set assignaddress [:pick $assignaddress 0 [:find $assignaddress "/"]]
:if ($assignaddress != $newaddress) do={
/ip address set [/ip address find comment=("adsl" . $i)] address=$newaddress network=$newaddress broadcast=$newaddress
/ip route set [/ip route find comment=("adsl" . $i)] gateway=$newaddress
}
}
}
如果最下面的链接不能下载请点击微软的网盘链接
微软网盘链接
- pcc.rar (351.5 KB)
- 描述: 双线策略教程
- 下载次数: 0
分享到:
相关推荐
RouterOS PCC负载脚本
RouterOS中PCC 负载均衡图文教程。
RouterOS-PCC负载均衡脚本
routeros负载均衡设置,对多线接入需要进行线路进行均衡负载的,需要。routeros是一款性能强大人软路由。
本文档介绍如何通过Routeros设置PPPoE拨号,并利用PCC技术实现负载均衡。(图文介绍) 在MikroTik RouterOS中配置PPPoE(Point-to-Point Protocol over Ethernet)拨号和PCC(Per-Connection Classifier)负载均衡是...
RouterOS v3 NTH的负载均衡 中文 图文 教程
ROS通过H3C s1526交换机进行Vlan配置进行多线ADSL拨号接入,并且进行多线的负载均衡
RouterOS免脚本多线ADSL负载均衡
RouterOS 40条ADSL线路PCC负载均衡的案例
RouterOS支持多线路的负载均衡,某小区为了节约费用,采用40条2M带宽的AD通过做汇聚实现高带宽的小区带宽,为解决接口问题采用一台Cisco的48口的交换机做VLAN接入40条AD,让后通过VLAN连接到RouterOS进行拨号,再做...
实现多adsl宽带负载平衡。需要用VM虚拟机的支持。
双线固定ip+双线adsl的pcc负载均衡脚本,我正在用,效果还不错!
routeros问题集锦 电子文档方式。非常实用。
RouterOS原版资料,计述在RouterOS中怎么实现多网关负载平衡
从3.0 版本开始,RouterOS 加入了对IPv6 的支持,本文将会对此加以介绍。并使用Router3.20 版本安装搭建一个IPv6 路由器,然后使用集线器接入两台安装了IPv6 协议的PC 机,形成一个小型内部IPv6 网,使其中的主机...
工作流程、多线路路由和负载均衡、Simple Queue、PCQ和 HTB等原理。如果你是个初学者可以从头开始学 习 RouterOS,如果你想提高自己的 RouterOS 水平,同样能学习到更多的功能。 作者希望通过这份教程能对准备和...
winbox-routeros管理工具,支持目前最新6.40版本,配合MikroTik-RouterOS实现内网映射到外网。
RouterOS双线负载冗余热备视频中国科学院正版首发