RouterOS Vrrp多播及PCC负载均衡

1.创建100个vrrp,并绑定到wan口下
for i from 1 to 100 do={/interface vrrp add comment=(“RP”. i ) i n t e r f a c e = w a n i n t e r v a l = 1 n a m e = ( " v r r p " . i) interface=wan interval=1 name=("vrrp". i)interface=waninterval=1name=("vrrp".i) vrid=$i}

2.修改vrrp 协议

for i from 1 to 100 do={/interface vrrp set v3-protocol=ipv6 numbers=(“vrrp”.$i)}

3.创建pppoe,(这里需要注意你的adsl 用户和密码),并绑定到对应的vrrp

for i from 1 to 100 do={/interface pppoe-client add add-default-route=yes allow=pap,chap comment=( i ) i n t e r f a c e = ( " v r r p " . i) interface=("vrrp". i)interface=("vrrp".i) max-mtu=1480 name=(“pppoe-out”. i ) u s e r = i) user= i)user=i password=$i }

设置pppoe 的为取消默认路由
for i from 0 to 99 do={/interface pppoe-client set numbers=$i add-default-route=no }

设置PCC负载均衡(原来的PPPOE需要取消默认路由,后边收到设置路由)

1.设置NAT

for i from 1 to 100 do={/ip firewall nat add chain=srcnat action=masquerade out-interface=(“pppoe-out”. i ) c o m m e n t = ( " p p p o e " . i) comment=("pppoe". i)comment=("pppoe".i)}

2.设置input

for i from 1 to 100 do={/ip firewall mangle add chain=input action=mark-connection new-connection-mark=(“pppoe-out”. i . " c o n n " ) p a s s t h r o u g h = y e s i n − i n t e r f a c e = ( " p p p o e − o u t " . i."_conn") passthrough=yes in-interface=("pppoe-out". i."conn")passthrough=yesininterface=("pppoeout".i) comment=(“input”.$i)}

3.设置output

for i from 1 to 100 do={/ip firewall mangle add chain=output action=mark-routing new-routing-mark=(“to_pppoe_out”. i ) p a s s t h r o u g h = y e s c o n n e c t i o n − m a r k = ( " p p p o e − o u t " . i) passthrough=yes connection-mark=("pppoe-out". i)passthrough=yesconnectionmark=("pppoeout".i."_conn") comment=(“output”.$i)}

4.设置连接标记

for i from 1 to 100 do={/ip firewall mangle add chain=prerouting action=mark-connection new-connection-mark=(“pppoe-out”. i . " c o n n " ) p a s s t h r o u g h = y e s s r c − a d d r e s s = 10.0.0.0 / 8 d s t − a d d r e s s − t y p e = ! l o c a l i n − i n t e r f a c e = e t h e r 1 − l a n p e r − c o n n e c t i o n − c l a s s i f i e r = ( " b o t h − a d d r e s s e s : 100 / " . i."_conn") passthrough=yes src-address=10.0.0.0/8 dst-address-type=!local in-interface=ether1-lan per-connection-classifier=("both-addresses:100/". i."conn")passthrough=yessrcaddress=10.0.0.0/8dstaddresstype=!localininterface=ether1lanperconnectionclassifier=("bothaddresses:100/".i-1) comment=(“pcc”.$i)}

5.设置路由标记

for i from 1 to 100 do={/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=(“to_pppoe_out”. i ) p a s s t h r o u g h = y e s s r c − a d d r e s s = 10.0.0.0 / 8 i n − i n t e r f a c e = e t h e r 1 − l a n c o n n e c t i o n − m a r k = ( " p p p o e − o u t " . i) passthrough=yes src-address=10.0.0.0/8 in-interface=ether1-lan connection-mark=("pppoe-out". i)passthrough=yessrcaddress=10.0.0.0/8ininterface=ether1lanconnectionmark=("pppoeout".i."_conn") comment=(“pcc”.$i)}

6.手动设置路由

for i from 1 to 100 do={/ip route add comment= i d i s a b l e d = n o d i s t a n c e = 1 d s t − a d d r e s s = " 0.0.0.0 / 0 " g a t e w a y = ( " p p p o e − o u t " . i disabled=no distance=1 dst-address="0.0.0.0/0" gateway=("pppoe-out". idisabled=nodistance=1dstaddress="0.0.0.0/0"gateway=("pppoeout".i) routing-mark=(“to_pppoe_out”.$i) check-gateway=(“ping”)}

7.设置路由ping 监控
for i from 1 to 100 do={/ip route add check-gateway=“ping” comment=(“pppoe-out”. i ) d i s a b l e d = n o d i s t a n c e = " 10 " d s t − a d d r e s s = " 0.0.0.0 / 0 " g a t e w a y = ( " p p p o e − o u t " . i) disabled=no distance="10" dst-address="0.0.0.0/0" gateway=("pppoe-out". i)disabled=nodistance="10"dstaddress="0.0.0.0/0"gateway=("pppoeout".i)}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值