X21237767 发表于 2010-7-28 20:19:41

求个ROS双线(电信+网通)负载+PPPOE服务器的教材

用DHCP成功,但是用PPPOE只走一条线,是不是NAT的问题

lijiahao 发表于 2010-9-19 01:29:54

把配置发出来,看看不就知道了

yagamixp 发表于 2010-9-20 14:41:53

这个是基本配置,,如须要做DHCP去找一下DHCP配置吧
/interface ethernet set ether1 name=lan
/interface ethernet set ether2 name=wan1
/interface ethernet set ether3 name=wan2
/ip address add address=192.168.1.1/24 interface=lan comment=lan
/ip dns set primary-dns=xxx.xxx.xxx.xxx secondary-dns=xxx.xxx.xxx.xxx 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=192.168.1.0/24 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=192.168.1.0/24 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=192.168.1.0/24 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=192.168.1.0/24 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=no
最后在添加更新网关脚本
在/system Sheduler 里添加下面的脚本,同时把Intervan时间改成30秒
:local assign-address
:local new-address
:local status
:local x
:set x 2
:for i from=1 to=$x do={
    :set status running]
    :if ($status=true) do={
   :set new-address address]
   :set new-address [:pick $new-address 0 ([:len $new-address] -3)]
   :set assign-address address]
   :set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
      :if ($assign-address != $new-address) do={ /ip address set address=$new-address network=$new-address

broadcast=$new-address
      /ip route set gateway=$new-address
      /ip fir nat set to-addresses=$new-address
      /ip route set gateway=$new-address
       }
   }
}

如须做动太限速PCQ可以去论坛里找找吧~~
页: [1]
查看完整版本: 求个ROS双线(电信+网通)负载+PPPOE服务器的教材