routeros批量开通端口映射

3680阅读 0评论2013-03-14 zhengsenlin888
分类:PERL

昨晚误删了routeros上的端口映射。要手动添加200条映射规则,写脚本了。。。将输出复制到routeeros的终端就执行了。

#!/usr/bin/perl -w

for(8000..8200) {
say "ip firewall nat add chain=dstnat dst-address=118.x.x.x dst-port=$_ action=dst-nat protocol=tcp to-address=192.168.100.6 to-port=$_";
}
上一篇:perl 利用Time::Piece 模块进行对时间戳转换成我们常看的时间
下一篇:sort对ip地址进行排序