#设置内网IP地址
/ ip add add interface=ether1
address=192.168.0.254/255.255.255.0
#设置共享上网
/ ip firewall nat add action=masquerade chain=srcnat
src-address=192.168.0.0/255.255.255.0

#设置ADSL拔号
/ interface pppoe-client add name="pppoe-out1" interface=ether2
user="wwwszwblmcom@163.gd" password="88888888"
add-default-route=no disabled=no
/ interface pppoe-client enable pppoe-out1

/ interface pppoe-client add name="pppoe-out2" interface=ether3
user="wwwszwblmcom@163.gd" password="88888888"
add-default-route=no disabled=no
/ interface pppoe-client enable pppoe-out2

/ interface pppoe-client add name="pppoe-out2" interface=ether4
user="wwwszwblmcom@163.gd" password="88888888"
add-default-route=no disabled=no
/ interface pppoe-client enable pppoe-out3

#设置ADSL虚拟IP
/ ip address add address=58.58.58.51/32 interface=pppoe-out1
comment="adsl1"
/ ip address add address=58.58.58.52/32 interface=pppoe-out2
comment="adsl2"
/ ip address add address=58.58.58.53/32 interface=pppoe-out3
comment="adsl3"

#设置分流上网
/ ip firewall mangle add chain=prerouting
src-address=192.168.0.1-192.168.0.20 action=mark-routing
new-routing-mark=adsl1 comment=adsl1
/ ip firewall mangle add chain=prerouting
src-address=192.168.0.21-192.168.0.30 action=mark-routing
new-routing-mark=adsl2 comment=adsl2
/ ip firewall mangle add chain=prerouting
src-address=192.168.0.31-192.168.0.40 action=mark-routing
new-routing-mark=adsl3 comment=adsl3

#设置路由表
/ ip route add gateway=58.58.58.51 routing-mark=adsl1
comment=adsl1
/ ip route add gateway=58.58.58.52 routing-mark=adsl2
comment=adsl2
/ ip route add gateway=58.58.58.53 routing-mark=adsl3
comment=adsl3

#设置脚本
:local assign-address
:local new-address
:local status
:local x
:set x 3
:for i from=1 to=$x do={
:set status [/interface get [/interface find 
name=("pppoe-out" . $i)] running] 
:if ($status=true) do={
:set new-address [/ip address get [/ip address find dynamic=yes
interface=("pppoe-out" . $i)] address]
:set new-address [:pick $new-address 0 [:find $new-address
"/"]]
:set assign-address [/ip address get [/ip address find dynamic=no
interface=("pppoe-out" . $i)] address]
:set assign-address [:pick $assign-address 0 [:find $assign-address
"/"]]
:if ($assign-address != $new-address) do={
/ip address set [/ip address find comment=("adsl" . $i)]
address=$new-address network=$new-address
broadcast=$new-address
/ip route set [/ip route find comment=("adsl" . $i)]
gateway=$new-address
}
}
}

本文使用Blog_Backup未注册版本导出,请到soft.pt42.com注册。

ROS单线多拨pppoe的更多相关文章

  1. OpenWrt > ADSL单线多拨,负载均衡(仅供参考)

    前题 硬件:路由器,刷入OpenWrt 一些背景知识和动手能力 目标效果图 步骤 使用SSH 登陆路由器.I.e. ssh root@192.168.2.1 运行/usr/bin/duobo.日志类似 ...

  2. 单线多拨,傻瓜式openwrt单线多拨叠加速率教程

    http://bbs.pceva.com.cn/thread-98362-1-1.html

  3. [RouterOS] ROS对接碧海威或PA等流控实现完美流控详细教程(附脚本全免费)

    前言: 经常在群里看到不少朋友争论海蜘蛛 ROS 维盟 爱快 碧海威 流控大师 Woyos等等软路由,哪个好.实际上,网络产品是复杂的,现在的软路由功能上已经远远不是单独的路由了.每种产品都有他本身的 ...

  4. OPENWRT X86 安装使用教程 (未完成)

    目 录  一 下载 Openwrt 镜像文件 二 将镜像文件写入目标磁盘 2.1  写盘工具 2.2 Physdiskwrite 写盘 2.3 win32diskimager 写盘 三 管理界面 3. ...

  5. !!!!OpenWrt系列教程汇总

    OpenWrt FAQ https://dev.openwrt.org.cn/wiki/faqs OpenWrt编译教程 完全新手教程:openwrt编译全过程(sse) 直接编译出带中文的openw ...

  6. 7620N路由器刷openwrt系统并配置***

    之前一直用goAgent***,主要用gmail.逛逛twitter.youtube.维基百科.加速stackoverflow等等.但goAgent只能PC使用,手机.iPad都不能用,直到我拿到了一 ...

  7. 小记——GTMD校园网

    前言 学校一年前开通了校园网,然鹅信号未覆盖我们住的公寓,又多忍受了一年的小破宽带(10M带宽,100块300个小时) 上个星期,架设了一年的校园网终于通了,然后我们发现——校园网69元一个月,一个用 ...

  8. ros使用pppoe拨号获取ipv6,并且下发IPV6的dns到客户机win7

    原文: https://www.mobile01.com/topicdetail.php?f=110&t=3405680 http://forum.mikrotik.com/viewtopic ...

  9. 软路由OpenWrt(LEDE)2020.5.10更新 UPnP+NAS+多拨+网盘+DNS优化

    近期更新:2020.05.10更新-基于OpenWrt R2020.5.9版本,源码截止2020.05.10.   交流群:QQ 1030484865 电报 t.me/t_homelede   版本说 ...

随机推荐

  1. Android开放百度地图集成

    1.创建应用 获取AK (我理解为Application key)  通过百度账号登录百度地图开放平台,进入API控制台 http://lbsyun.baidu.com/apiconsole/key ...

  2. 用DIV遮罩解决checkbox勾选无效的问题

    在前端开发的过程中,遇到一种情况,需要勾选,为了用户的操作便捷就将click事件放到了DIV上.(其中使用了knockout.js) 代码大概如下: <div id="one" ...

  3. MxNet : use the MxNet windows versioin

    The MxNet needs  the following thirdparties: 1. lapack complie lapack-3.6.1: download the lapack-3.6 ...

  4. web开发——在网页中引用字体包(.ttf),即嵌入特殊字体

    在写html时,有点时候需要显示一些特殊字体,不过这些特殊字体是系统一般不自带的,这时就需要我们自行加载要用的字体.方法如下: 1.首先在style里添加: @font-face { font-fam ...

  5. pytorch实战(7)-----卷积神经网络

    一.卷积: 卷积在 pytorch 中有两种方式: [实际使用中基本都使用 nn.Conv2d() 这种形式] 一种是 torch.nn.Conv2d(), 一种是 torch.nn.function ...

  6. android自定义dialog布局

    dialog使用系统自带的有时候不是很美观,就想要自己来设计一个dialog界面,以下就是可以设计的dialog界面: public class CustomDialog extends Dialog ...

  7. 数组(day07)

    数组名称不可以代表存储区 数组名称可以代表数组里第一个存储区的地址 可以对数组名称进行sizeof计算,结果是 数组里所有存储区的总大小 C99规范里可以使用变长数组 声明变长数组的时候可以用变量表示 ...

  8. [luogu4161 SCOI2009]游戏 (DP)

    传送门 Solution 可以发现实际上是把n分为几个循环节,然后找循环节的\(lcm\)是这次的排数 而\(lcm\)必然是一些最高次幂的质数的成积,那么就dp求一下所有情况就好了 PS:注意并不是 ...

  9. 【hihocoder 1296】数论三·约瑟夫问题

    [题目链接]:http://hihocoder.com/problemset/problem/1296 [题意] [题解] [Number Of WA] 0 [完整代码] #include <b ...

  10. Nginx学习总结(2)——Nginx手机版和PC电脑版网站配置

    考虑到网站的在多种设备下的兼容性,有很多网站会有手机版和电脑版两个版本.访问同一个网站URL,当服务端识别出用户使用电脑访问,就打开电脑版的页面,用户如果使用手机访问,则会得到手机版的页面. 1.判断 ...