找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2763|回复: 1

[负载平衡] 求ros 3.3 两条adsl 负载平衡 的脚本

[复制链接]
发表于 2011-7-21 10:32:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
ros 3.3 两条adsl 负载平衡 的脚本
routeros
发表于 2011-7-23 19:25:28 | 显示全部楼层
上官网有
/ip address add address=192.168.2.254/255.255.255.0 interface=lan comment=lan

/ip dns set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=512
/ip dns set primary-dns=218.6.200.139 secondary-dns=61.139.2.69

/ interface pppoe-client
add name="pppoe-out1" max-mtu=1440 max-mru=1440 interface=wan1 \
    user="P001" password="001" profile=default \
    service-name="" ac-name="" add-default-route=no dial-on-demand=no \
    use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no

add name="pppoe-out2" max-mtu=1440 max-mru=1440 interface=wan2 \
    user="P002" password="002" profile=default \
    service-name="" ac-name="" add-default-route=no dial-on-demand=no \
    use-peer-dns=no allow=pap,chap,mschap1,mschap2 disabled=no

/ ip firewall mangle
add chain=prerouting dst-address-type=!local in-interface=lan per-connection-classifier=both-addresses:2/0 \
    action=mark-connection new-connection-mark=1st_conn passthrough=yes comment="PCC1"
add chain=prerouting connection-mark=1st_conn in-interface=lan action=mark-routing new-routing-mark=1st_route

add chain=prerouting dst-address-type=!local in-interface=lan per-connection-classifier=both-addresses:2/1 \
    action=mark-connection new-connection-mark=2st_conn passthrough=yes comment="PCC2"
add chain=prerouting connection-mark=2st_conn in-interface=lan action=mark-routing new-routing-mark=2st_route

add chain=input in-interface=wan1 action=mark-connection new-connection-mark=1st_conn

add chain=input in-interface=wan2 action=mark-connection new-connection-mark=2st_conn

add chain=output connection-mark=1st_conn action=mark-routing new-routing-mark=1st_route

add chain=output connection-mark=2st_conn action=mark-routing new-routing-mark=2st_route

/ip route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
pppoe-out1 routing-mark=1st_route
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
    pppoe-out2 routing-mark=2st_route
add check-gateway=ping comment="" disabled=no distance=1 dst-address=\
0.0.0.0/0 gateway=pppoe-out1
add check-gateway=ping comment="" disabled=no distance=2 dst-address=\
    0.0.0.0/0 gateway=pppoe-out2

/ip firewall nat
add action=masquerade chain=srcnat comment=1 out-interface=pppoe-out1

add action=masquerade chain=srcnat comment=2 out-interface=pppoe-out2
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-25 22:26 , Processed in 0.055167 second(s), 14 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表