
ros软路由实用技术-ros软路由ADSL双线 PPPOE服务器设置(讲解).doc
62页ros软路由ADSL双线+PPPOE效劳器设置详细图文教程减小字体 增大字体 一、先说下这几天泡论坛发现在自己以前及其错误的地方 登录winbox 初始化ros 以前都是把显示器键盘接到ros上,配置lan网卡地址后再将显示器键盘接到电脑上,把电脑本地连接配ros网段,连接winbox,等测试自动获取ip时又将本地连接设为自动获取 需要回复ros为初始时,又重复上面的过程 泡坛才知道,winbox可以用ros lan网卡的mac地址登录,不必管本地连接的ip的 初始化时在winbox里使用new terminal就可以初始化了,初始了后用mac登录winbox就可以配置了总结:把ros的电脑先设BIOS设为来电自动开机,忽略一切错误开机,就可以再也不接键盘和显示器了二、配置ros 双ADSl负载均衡走的弯路 因为夹杂了pppoe效劳,一直配不通,用脚本生成器生成的也不通,看很多教程,互相影响,自己最后也不知道在配什么了总结:先一步一步配,看到哪一步不通不如1、先配好lan,看winbox能否登陆winbox2、配置双线adsl,看2条adsl是否拨号成功,双线adsl脚本配置后,在ip里是不应该出现58类ip的,因为之前不理解自动刷新网关,看到脚本里58类ip,自己的机子里没有,以为不正常,重复添加脚本。
〔增加pppoe效劳后,拨号用户不通,这个后面详解〕3、客户机配置手动ip和dns,看能否上网3、增加pppoe效劳,导入pppoe账号,可以用脚本生成器生成三:配置双线adsl+pppoe效劳过程1、安装ros,这个这里省略2、配置lan ip3、电脑配ip,和ros一个网段,winbox登陆,获取到lan的MAC,把ip换为mac登陆 方法是ip登陆后点下后面小□〔里面有三个...的那个,connect左边那个〕在翻开的菜单里点mac就可以换了4、改网卡名字我把第一个改为wan1,第二个改为wan2,第三个改为lan5、用脚本生成器生成双pppoe负载均衡脚本,如果你后面还要像我一样增加pppoe效劳,接着要做一个重要的改动,不然pppoe拨号用户就不通后面的IP及掩码为你的局域网的..这段话后来我有走了湾路,先我不知道是替换生成双线ADSL的脚本,还是增加pppoe效劳的脚本,这里老大指的的是替换生成双线ADSL的脚本里的,我错误的设为ros局域网的网段,这个网段要设为你要增加的pppoe效劳的网段默认脚本生成器产生的网段是:6、增加pppoe效劳区7、增加pppoe用户至此配置成功配置的脚本:1、双线adsl负载均衡脚本〔红色的:替换你自己的dns、账号、密码,如果默认用脚本生成器生成的pppoe效劳网段,就不改了〕导入方法:登陆winbox,选择new terminal 〔用了new terminal 我不再喜欢用脚本导入框导入了,因为在new terminal导入出错会有提示,虽看不懂提示什么,但可以看出有出错信息〕在new terminal里右键pass+回车导入/ip address add address=192.168.0.254/255.255.255.0 interface=lan comment=lan/ip dns set primary-dns=222.172.200.68 secondary-dns=61.166.150.123 allow-remote-requests=yes/ip firewall mangle add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1440/interface pppoe-client add name="pppoe-out1" interface=wan1 user="账号1" password="密码1" add-default-route=no disabled=no/interface pppoe-client enable pppoe-out1/ip address add address=58.58.58.1/32 interface=pppoe-out1 comment="1"/ip route add gateway=58.58.58.1 routing-mark=1 comment="1"/ip firewall mangle add chain=prerouting src-address= connection-state=new nth=1,1,0 action=mark-connection new-connection-mark=1 passthrough=yes disabled=no/ip firewall mangle add chain=prerouting src-address= connection-mark=1 action=mark-routing new-routing-mark=1 passthrough=no disabled=no/ip firewall nat add chain=srcnat connection-mark=1 action=src-nat to-addresses=58.58.58.1 to-ports=0-65535 comment="1" disabled=no/interface pppoe-client add name="pppoe-out2" interface=wan2 user="账号2" password="密码2" add-default-route=no disabled=no/interface pppoe-client enable pppoe-out2/ip address add address=58.58.58.2/32 interface=pppoe-out2 comment="2"/ip route add gateway=58.58.58.2 routing-mark=2 comment="2"/ip firewall mangle add chain=prerouting src-address= connection-state=new nth=1,1,1 action=mark-connection new-connection-mark=2 passthrough=yes disabled=no/ip firewall mangle add chain=prerouting src-address= connection-mark=2 action=mark-routing new-routing-mark=2 passthrough=no disabled=no/ip firewall nat add chain=srcnat connection-mark=2 action=src-nat to-addresses=58.58.58.2 to-ports=0-65535 comment="2" disabled=no2、刷新网关脚本,方法是:winbox中,增加到任务里,winbox生成代码旁有提示:local assign-address:local new-address:local status:local x:set x 0: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 fir nat set [/ip fir nat find comment=$i] to-addresses=$new-address /ip route set [/ip route find comment=$i] gateway=$new-address } }}3、增加pppoe效劳〔在new terminal里右键pass+回车导入〕注意这个网段就是上面导入双线账号中提到的局域网网段/ ip pool add name=PPPoE_Pool ranges=.2-10.10.10.254/ interface pppoe-server server add service-name=PPPoE_Server interface=lan one-session-per-host=yes disabled=no/ ppp profile add n4、增加pppoe用户在new terminal里右键pass+回车导入/ ppp secret add name="201" password="123" service=pppoe profile=PPPoE_Profile/ ppp secret add name="bgs" password="123" service=pppoe profile=PPPoE_Profile/ ppp secret add name="bgs2" password="123" service=pppoe profile=PPPoE_Profile/ ppp secret add name="202" password="123" service=pppoe profile=PPPoE_Profile这个用记事本编一下,改为你需要增加的用户。
至此大功告成②ADSL 受最大连接限制可以控制每个IP的最大连接数,超过规定数字了,就无法建立新连接连接数可以自己实验下例如:下面的意思是限制每个IP 20个连接/ip firewall filter add chain=forward protocol=tcp tcp-flags=syn connection-limit=20,32 action=drop 上面给的例子里没有添加IP,你自己添加下。