找回密码
 加入网盟
分割线
官方精品推荐
功能包:PPP,advacend tools
基本情况:用户有两条INTERNET线路,一条是使用中国电信光纤10M,另一条是使用中国电信4MADSL.使用IP伪装使一个有200个终端局域网共享
上网。RouteOS共有3块网卡,ether1用于ADSL,ether2用于光纤,ether3用于连接终端。
目的:实现负载平衡,并且在其中一条线路断掉后自动切换为单线路,线路恢复后,继续使用负载平衡。
实施:
1、配置光纤线路
在/ip address中为光纤线路配置IP地址,子网掩码。
/ip address add address 61.139.77.77 mask 24 interface ether2
2、配置ADSL线路
/interface pppoe-client 配置ADSL拨号信息。
/interface pppoe-client add name pppoe-line1 service CHN-telecom/ user rh999@169 password kkjjh interface ether1 use-peer-dns yes mtu 1942 mru 1942
3、配置IP伪装
/ip firewall src-nat add action masquerade
/ip firewall mangle add protocol tcp tcp-options syn-only tcp-mss 1448
4、配置路由
/ip route add dst 0.0.0.0/0 gat 61.139.77.1,218.88.32.1 (注:61.139.77.1为光纤的网关,218.88.32.1则为ADSL的网关)
/ip route add dst 61.139.88.105/32 get 218.88.32.1(注:如果ADSL连通后PING不通网关的话,才加这条,如果PING得通则不须要。)
5、配置自动切换脚本
/system script add name="downadsl" source="/in pppoe-client dis [/in pppoe-client find name pppoe-lin owner="admin" policy=reboot,read,write,policy,test
/system script add name="upf" source=" /ip route set[/ip route find dst 0.0.0.0] gateway 61.139.73.1,218.88.32.1" owner="admin" policy=reboot,read,write,policy,test
/system script add name="downf" source="/ip route set[/ip route find dst 0.0.0.0] gateway 218.88.32.1 owner="admin" policy=reboot,read,write,policy,test
/system script add name="upadsl" source="/ip route set[/ip route find dst 0.0.0.0] gateway 61.139.73.1,218.88.32.1" owner="admin" policy=reboot,read,write,policy,test
6、配置NETWATCH用于监视网络的通断情况。
/tool netwatch add host=61.157.88.105 timeout=1s interval=5s up-script=upadsl down-script=downadsl
(注:61.157.88.105是监视ADSL是否通的IP,也可以是ADSL的网关。)
/tool netwatch add host=61.139.73.1 timeout=1s interval=5s up-script=upf down-script=downf
至此配置完成,注你成功。
功能包可以到www.mikrotik.com.cn上下载相应版本的功能包。

评分

参与人数 1威望 +30 网盟币 +60 收起 理由
janandi_admin + 30 + 60 我很赞同

查看全部评分

分享至 : QQ空间
收藏

5 个回复

倒序浏览
janandi_admin 2 2011-5-24 00:22:08
2#
顶起来
回复 使用道具 举报
czqde 3 2011-10-25 12:36:24
3#
好东西啊 收藏!
回复 使用道具 举报
czqde 3 2011-10-25 12:37:09
4#
好东西啊 收藏!!!
回复 使用道具 举报
semfer 1 2012-11-6 15:40:50
5#
太复杂,菜鸟看不太明白,要多多学习
回复 使用道具 举报
cw4774 2 2012-11-9 11:03:15
6#
那2条ADSL+固定光纤怎么做啊
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入网盟
关闭

华夏网盟推荐 上一条 /1 下一条