48344620 发表于 2008-9-16 13:49:13

批处理做路由表(希望加精

@echo off
echo /ip route rule >>testOne.txt
set "strOne=add dst-address="
set "strTwo=action=lookup table=tel"
for /f "tokens=*" %%i in (test.txt) do (
>>testOne.txt echo %strOne%%%i%strTwo%
)
pause

上面代码请存为.bat

把以下格式的test.txt
58.32.0.0/11
58.208.0.0/12
59.32.0.0/11
做成如下内容的testone.txt
/ip route rule
add dst-address=58.32.0.0/11 action=lookup table=tel
add dst-address=58.208.0.0/12 action=lookup table=tel
add dst-address=59.32.0.0/11 action=lookup table=tel

          原创作者cn-dos.net --->hackate
在此感谢....
页: [1]
查看完整版本: 批处理做路由表(希望加精