|
发表于 2008-9-26 00:14:51
|
显示全部楼层
使用vMWare作测试环境..客户端不能上网.
/ interface pppoe-client
add name="pppoe-out1" max-mtu=1480 max-mru=1480 interface=ether2 \
user="a" password="a" profile=default service-name="" \
ac-name="" add-default-route=yes 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="b" password="b" 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="c" password="c" 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=11.1.1.228/32 network=11.1.1.228 broadcast=11.1.1.228 \
interface=pppoe-out1 comment="1" disabled=no
add address=11.1.1.235/32 network=11.1.1.235 broadcast=11.1.1.235 \
interface=pppoe-out2 comment="2" disabled=no
add address=116.116.116.116/32 network=116.116.116.116 \
broadcast=116.116.116.116 interface=pppoe-out3 comment="3" disabled=no
/ ip route
add dst-address=0.0.0.0/0 gateway=11.1.1.228 scope=255 target-scope=10 \
routing-mark=1 comment="1" disabled=no
add dst-address=0.0.0.0/0 gateway=11.1.1.235 scope=255 target-scope=10 \
routing-mark=2 comment="2" disabled=no
add dst-address=0.0.0.0/0 gateway=116.116.116.116 scope=255 target-scope=10 \
routing-mark=3 comment="3" disabled=no
/ ip firewall nat
add chain=srcnat action=masquerade comment="" disabled=yes
add chain=srcnat connection-mark=1 action=src-nat to-addresses=11.1.1.228 \
to-ports=0-65535 comment="1" disabled=no
add chain=srcnat connection-mark=2 action=src-nat to-addresses=11.1.1.235 \
to-ports=0-65535 comment="2" disabled=no
add chain=srcnat connection-mark=3 action=src-nat to-addresses=116.116.116.116 \
to-ports=0-65535 comment="3" disabled=no
/ ip firewall mangle
add chain=prerouting dst-address-list=noNTH_IP action=mark-routing \
new-routing-mark=2 passthrough=yes comment="noNTH_IP" disabled=no
add chain=prerouting protocol=tcp dst-port=443 action=mark-routing \
new-routing-mark=1 passthrough=yes comment="dst.port_443mark1" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-state=new \
nth=2,3,0 dst-address-list=!noNTH_IP action=mark-connection \
new-connection-mark=1 passthrough=yes comment="" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-mark=1 \
dst-address-list=!noNTH_IP action=mark-routing new-routing-mark=1 \
passthrough=no comment="" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-state=new \
nth=2,3,1 dst-address-list=!noNTH_IP action=mark-connection \
new-connection-mark=2 passthrough=yes comment="" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-mark=2 \
dst-address-list=!noNTH_IP action=mark-routing new-routing-mark=2 \
passthrough=no comment="" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-state=new \
nth=2,3,2 dst-address-list=!noNTH_IP action=mark-connection \
new-connection-mark=3 passthrough=yes comment="" disabled=no
add chain=prerouting src-address=11.1.0.1-11.1.8.255 connection-mark=3 \
dst-address-list=!noNTH_IP action=mark-routing new-routing-mark=3 \
passthrough=no comment="" disabled=no
add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=1432 \
comment="" disabled=no
add chain=prerouting action=accept comment="" disabled=no
/ ip firewall address-list
add list=noNTH_IP address=202.118.118.0/24 comment="" disabled=no
add list=noNTH_IP address=222.121.112.51-222.121.112.60 comment="" disabled=no
/system script
add name="balance" source={
: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 ([: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 firewall nat set [/ip firewall nat find comment=$i] to-addresses=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
}
}
}
}
/ system scheduler
add name="adsl" on-event=balance start-date=jan/01/1970 \
start-time=00:00:00 interval=10s comment="" disabled=no
--------------------------------
我的QQ是76688980,期望得到指点.红色处有作修改,其他照抄.
[ 本帖最后由 seayou_wey 于 2008-9-26 00:16 编辑 ] |
|