批量创建网络设备命令脚本

cat command.sh 
#!/bin/bash
for ((i=3;i<20;i++))
do 
echo rule $i deny ip source 10.0.16.2 0 destination 10.0.16.$((i+10)) 0
done>>/root/script/apple.txt

cat apple.txt
rule 3 deny ip source 10.0.16.2 0 destination 10.0.16.13 0
rule 4 deny ip source 10.0.16.2 0 destination 10.0.16.14 0
rule 5 deny ip source 10.0.16.2 0 destination 10.0.16.15 0
rule 6 deny ip source 10.0.16.2 0 destination 10.0.16.16 0
rule 7 deny ip source 10.0.16.2 0 destination 10.0.16.17 0
rule 8 deny ip source 10.0.16.2 0 destination 10.0.16.18 0
rule 9 deny ip source 10.0.16.2 0 destination 10.0.16.19 0
rule 10 deny ip source 10.0.16.2 0 destination 10.0.16.20 0
rule 11 deny ip source 10.0.16.2 0 destination 10.0.16.21 0
rule 12 deny ip source 10.0.16.2 0 destination 10.0.16.22 0
rule 13 deny ip source 10.0.16.2 0 destination 10.0.16.23 0
rule 14 deny ip source 10.0.16.2 0 destination 10.0.16.24 0
rule 15 deny ip source 10.0.16.2 0 destination 10.0.16.25 0
rule 16 deny ip source 10.0.16.2 0 destination 10.0.16.26 0
rule 17 deny ip source 10.0.16.2 0 destination 10.0.16.27 0
rule 18 deny ip source 10.0.16.2 0 destination 10.0.16.28 0
rule 19 deny ip source 10.0.16.2 0 destination 10.0.16.29 0

 

转载于:https://www.cnblogs.com/vincent-liang/p/7232135.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值