计算机技术论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

  • 欢迎访问 计算机技术论坛-电脑迷与初学者的家园!由于论坛管理严格,新注册会员可能遇到各种问题,无法解决的请发邮件 admin@jsjbbs.cn
查看: 4671|回复: 9

单网卡PPPOE五次拨号带宽合并,零成本...2M变10M 分享全过程

[复制链接]
发表于 2009-6-27 13:45:58 | 显示全部楼层 |阅读模式
单机单网卡PPPOE五次拨号带宽合并高速下载,零成本易使用!
电信FTTB+LAN 可以多次PPPOE拨号,所以带宽2M成10M

分享安装全过程,免费的!!!




网络环境:电信FTTB+LAN 可以多次PPPOE拨号(好像装了IPTV的ADSL也可以多次拨号,不清楚)
使用软件:1、“多特下载“VMware Workstation(虚拟机) V6.0.2 Build 59824 汉化版.exe
           序列号:JHXUR-G0M88-GA44V-4MRN6
          2、”狗狗下载“软路由RouterOS2.9.6破解版及安装动画(34动画)    包含有了软件安装及视频教程。
           学习论坛:中国路由论坛


简要安装过程:
1、新建虚拟机 自定义 linux 桥接 磁盘 IDE, 添加五块桥接网卡, 光驱使用ISO镜像就是RouterOS2.9.6破解版.iso ,启动,安
装完,镜像ISO不要了,启动login admin   ,setup  a  a  192.168.0.1/24  x x    。好了虚拟机好了,以后只需要后台运行
着即可,配置高的机器几乎不占用系统资源。
2、本机IP设为192.168.0.2 后 用 winbox 连接到192.168.0.1  。
new terminal 脚本


/ interface pppoe-client
add name="pppoe-out1" max-mtu=1480 max-mru=1480 interface=ether2 \
    user="拨号账号" password="拨号密码" 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=1480 max-mru=1480 interface=ether3 \
    user="拨号账号" password="拨号密码" 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-out3" max-mtu=1480 max-mru=1480 interface=ether4 \
    user="拨号账号" password="拨号密码" 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-out4" max-mtu=1480 max-mru=1480 interface=ether5 \
    user="拨号账号" password="拨号密码" 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-out5" max-mtu=1480 max-mru=1480 interface=ether6 \
    user="拨号账号" password="拨号密码" 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 address
add address=192.168.0.1/24 network=192.168.0.0 broadcast=192.168.0.255 \
    interface=ether1 comment="added by setup" disabled=no
add address=128.228.188.17/32 network=128.228.188.17 broadcast=128.228.188.17 \
    interface=pppoe-out1 comment="1" disabled=no
add address=128.228.191.73/32 network=128.228.191.73 broadcast=128.228.191.73 \
    interface=pppoe-out2 comment="2" disabled=no
add address=128.228.190.137/32 network=128.228.190.137 \
    broadcast=128.228.190.137 interface=pppoe-out3 comment="3" disabled=no
add address=128.228.189.121/32 network=128.228.189.121 \
    broadcast=128.228.189.121 interface=pppoe-out4 comment="4" disabled=no
add address=128.228.192.121/32 network=128.228.192.121 \
    broadcast=128.228.192.121 interface=pppoe-out5 comment="5" disabled=no

/ ip firewall mangle
add chain=prerouting in-interface=ether1 connection-state=new nth=4,1,0 \
    action=mark-connection new-connection-mark=1 passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=ether1 connection-mark=1 action=mark-routing \
    new-routing-mark=1 passthrough=no comment="" disabled=no
add chain=prerouting in-interface=ether1 connection-state=new nth=4,1,1 \
    action=mark-connection new-connection-mark=2 passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=ether1 connection-mark=2 action=mark-routing \
    new-routing-mark=2 passthrough=no comment="" disabled=no
add chain=prerouting in-interface=ether1 connection-state=new nth=4,1,2 \
    action=mark-connection new-connection-mark=3 passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=ether1 connection-mark=3 action=mark-routing \
    new-routing-mark=3 passthrough=no comment="" disabled=no
add chain=prerouting in-interface=ether1 connection-state=new nth=4,1,3 \
    action=mark-connection new-connection-mark=4 passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=ether1 connection-mark=4 action=mark-routing \
    new-routing-mark=4 passthrough=no comment="" disabled=no
add chain=prerouting in-interface=ether1 connection-state=new nth=4,1,4 \
    action=mark-connection new-connection-mark=5 passthrough=yes comment="" \
    disabled=no
add chain=prerouting in-interface=ether1 connection-mark=5 action=mark-routing \
    new-routing-mark=5 passthrough=no comment="" disabled=no

/ ip firewall nat
add chain=srcnat connection-mark=1 action=src-nat to-addresses=128.228.188.17 \
    to-ports=0-65535 comment="1" disabled=no
add chain=srcnat connection-mark=2 action=src-nat to-addresses=128.228.191.73 \
    to-ports=0-65535 comment="2" disabled=no
add chain=srcnat connection-mark=3 action=src-nat to-addresses=128.228.190.137 \
    to-ports=0-65535 comment="3" disabled=no
add chain=srcnat connection-mark=4 action=src-nat to-addresses=128.228.189.121 \
    to-ports=0-65535 comment="4" disabled=no
add chain=srcnat connection-mark=5 action=src-nat to-addresses=128.228.192.121 \
    to-ports=0-65535 comment="5" disabled=no

/ ip route
add dst-address=0.0.0.0/0 gateway=128.228.188.17 scope=255 target-scope=10 \
    routing-mark=1 comment="1" disabled=no
add dst-address=0.0.0.0/0 gateway=128.228.191.73 scope=255 target-scope=10 \
    routing-mark=2 comment="2" disabled=no
add dst-address=0.0.0.0/0 gateway=128.228.190.137 scope=255 target-scope=10 \
    routing-mark=3 comment="3" disabled=no
add dst-address=0.0.0.0/0 gateway=128.228.189.121 scope=255 target-scope=10 \
    routing-mark=4 comment="4" disabled=no
add dst-address=0.0.0.0/0 gateway=128.228.192.121 scope=255 target-scope=10 \
    routing-mark=5 comment="5" disabled=no
add dst-address=0.0.0.0/0 gateway=128.228.189.121 scope=255 target-scope=10 \
    comment="6" disabled=no

/ ip upnp interfaces
add interface=ether1 type=internal disabled=no
add interface=pppoe-out1 type=external disabled=no
add interface=pppoe-out2 type=external disabled=no
add interface=pppoe-out3 type=external disabled=no
add interface=pppoe-out4 type=external disabled=no
add interface=pppoe-out5 type=external disabled=no
/ ip upnp
set enabled=yes allow-disable-external-interface=yes show-dummy-rule=yes



在system schedule 粘入,设置为20秒自动更新
:local assign-address
:local new-address
:local status
:local x
:set x 5
: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 ([:len $new-address] -3)]
     :set assign-address [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
     :set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
        :if ($assign-address != $new-address) do={ /ip address set [/ip address find comment=$i] address=$new-
address network=$new-address broadcast=$new-address
        /ip route set [/ip route find comment=$i] gateway=$new-address
        /ip route set [/ip route find comment="6"] gateway=$new-address
        /ip fir nat set [/ip fir nat find comment=$i] to-addresses=$new-address
       }
   }

上面的脚本的解释
:local assign-address  #设本地变量名
:local new-address     #设本地变量名
:local status                #设本地变量名
:local x                        #设本地变量名
:set x 2                       #给变量赋值为2
:for i from=1 to=$x do={       #做x的循环x的数为多少就做多少次循环 $为变量调用符
    :set status [/interface get [/interface find  name=("pppoe-out" . $i)] running]    #获取PPPOE-out $i是否为运行状态 每运行一次循环,i的值加1,现在i的值应为1,所以就是做PPPOE-out1的运行状态的获取。
    :if ($status=true) do={   #前一句得到了PPPOE-out1的状态情况,这句就是对其状态的处理,如果运行状态为运行,那么就去行do={里的命令,如果为false的直接结束。
     :set new-address [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address] #获取 PPPOE-out $1的动态IP地址。这个IP是带有掩码的
     :set new-address [:pick $new-address 0 ([:len $new-address] -3)]  #去除掉刚才得到的IP的掩码。得到一个纯IP地址。
     :set assign-address [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]   #获取pppoe-out的静态IP。
     :set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)] 去除静态IP的掩码。
        :if ($assign-address != $new-address) do={ #对比PPPOE-out的静态IP和动态IP是否一样。一样就不修改。直接到结束
        /ip address set [/ip address find comment=$i] address=$new-address network=$new-address broadcast=$new-address #把动态IP写给静态IP。
        /ip route set [/ip route find comment=$i] gateway=$new-address #把动态IP写给标记了的网关 用comment号进行区别,第一次运行这条语句时$i为1所以就是修改comment=1的那个网关。
        /ip route set [/ip route find comment="3"] gateway=$new-address #这句话是我在原作者的基础上增加的,目的是将没有标记的线路指向最后一条adsl。
        /ip fir nat set [/ip fir nat find comment=$i] to-addresses=$new-address #把动态IP写向防火墙的net地址。
       }
   }
}


-------------------------------------------------------------------------------
-----------终于搞定了,理论速度可以五倍啊。。。。
HTTP速度特快马上满速,可BT速度上的慢无法满速只有两三倍速。挺满意了




歌曲:分享               与你分享的快乐胜过独自拥有

时间已做了选择
什麽人叫做朋友
偶而碰头心情却能一点就通
因为我们曾有过
太多感受绝非三言两语能形容
太多决定需要我们去选择
担心会犯错
难免会受挫
幸好一路上有你陪我
与你分享的快乐胜过独自拥有
好友如同一扇窗
能让视野不同
与你分享的快乐胜过独自拥有
至今我仍深深感动
好友如同一扇门
让世界(变)开阔
因为我们曾有过
理想类似的生活
理想类似的生活
太多感受绝非三言两语能形容
可能有时我们顾虑太多
可能有时我们顾虑太多
太多决定需要我们去选择
担心会犯错
难免会受挫
幸好一路上有你陪我
与你分享的快乐胜过独自拥有
至今我仍深深感动
好友如同一扇窗
能让视野不同
与你分享的快乐胜过独自拥有
至今我仍深深感动
好友如同一扇门
让世界(变)开阔
与你分享的快乐胜过独自拥有
至今我仍深深感动
至今我仍深深感动
好友如同一扇窗
能让视野不同
与你分享的快乐胜过独自拥有
至今我仍深深感动
好友如同一扇门
让世界(变)开阔

}

本帖子中包含更多资源

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

x
dpy111 该用户已被删除
发表于 2009-6-27 18:06:22 | 显示全部楼层
好复杂,我的貌似只有宽带
发表于 2009-6-27 21:40:28 | 显示全部楼层
呵呵,看的有点晕。不过还要谢谢分享!
发表于 2009-7-2 14:03:00 | 显示全部楼层
暂时看不懂
先收藏
发表于 2009-7-3 15:12:34 | 显示全部楼层
好复杂,看不懂,还是顶一下
发表于 2009-7-31 12:29:37 | 显示全部楼层
好复杂,看不懂,
发表于 2009-8-15 19:56:54 | 显示全部楼层
看不懂啊!
gao51 该用户已被删除
发表于 2009-8-16 12:16:05 | 显示全部楼层
感觉上还可以,我想问下楼主,直接在一个虚拟机添加5块网卡就可以了,为什么还要启动login admin   ,setup  a  a  192.168.0.1/24  x x这个是什么意思?
gao51 该用户已被删除
发表于 2009-8-16 12:17:27 | 显示全部楼层
[url=http://www.jsjbbs.cn/redi启动login admin   ,setup  a  a  192.168.0.1/24  x x    rect.php?goto=findpost&pid=31627&ptid=5805]1#[/url] axin 这个是什么意思?
发表于 2010-2-3 10:31:02 | 显示全部楼层
水平还有限,先看下
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

无图版|手机版|计算机技术论坛 JSJBBS.CN @ 2008-2024 ( 鲁ICP备17021708号 )

技术支持 : 北京康盛新创科技有限责任公司

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