|
发表于 2011-1-1 23:13:01
|
显示全部楼层
本帖最后由 blacker 于 2011-1-1 23:16 编辑
给你改写一下
/ip firewall address-list add list=lan address=0.0.0.0/0
:global x 11
:for i from=2 to=$x do={/interface vlan add name=("vlan".$i) vlan-id=$i interface=ether1}
:for i from=2 to=$x do={/interface bridge add name=("bridge".$i) protocol-mode=rstp admin-mac=("00:0C:42:2B:75:8".($i-2))}
:for i from=2 to=$x do={/interface bridge port add interface=("vlan".$i) bridge=("bridge".$i)}
:for i from=2 to=$x do={/ppp profile add change-tcp-mss=default comment="" name=("pppoe-nat".$i) only-one=default remote-address=("10.0.0.".$i) use-compression=default use-encryption=default use-vj-compression=default}
:for i from=2 to=$x do={/interface pppoe-client add name=("pppoe-out".$i) interface=("bridge".$i) profile=("pppoe-nat".$i)}
/ip firewall nat add action=masquerade chain=srcnat comment="" disabled=no
:for i from=2 to=$x do={/ip firewall mangle add action=mark-connection chain=prerouting connection-state=new disabled=no in-interface=lan new-connection-mark=(.$i) nth=((.$x)","(.$i)) passthrough=yes}
:for i from=2 to=$x do={/ip route add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=("10.0.0.".$i) routing-mark=(.$i) scope=255 target-scope=10}
最后这个
add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=\
1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4 scope=255 target-scope=10
没搞懂怎么加不上去
我的代码是这样写的
/ip route add comment="" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=(:for i=2 to=(.$x-1) do={("10.0.0.".$i),}10.0.0.$x) scope=255 target-scope=10
加不上去,只有在winbox里手动搞一下,ROS 4.16 版本在2011元旦测试通过
|
|