CP防火墙使用命令批量创建对象和策略
Step1:批量创建网络对象
使用mgmt_cli 命令批量创建host对象,注意该命令需要管理员账号和密码
mgmt_cli add host name Host_10.133.1.100 ip-address 10.133.1.100 -u admin -p pwd@123
mgmt_cli add host name Host_10.133.1.110 ip-address 10.133.1.110 -u admin -p pwd@123
mgmt_cli add host name Host_10.133.1.120 ip-address 10.133.1.120 -u admin -p pwd@123
mgmt_cli add host name Host_10.133.1.130 ip-address 10.133.1.130 -u admin -p pwd@123
mgmt_cli add host name Host_10.133.1.140 ip-address 10.133.1.140 -u admin -p pwd@123
mgmt_cli add host name Host_10.133.1.150 ip-address 10.133.1.150 -u admin -p pwd@123
执行后结果如下图:
在smartcenter上查看host对象如下图:
Step2:批量创建网络对象
mgmt_cli add network name "Net_10.54.1.0/24" subnet "10.54.1.0" subnet-mask "255.255.255.0" --format json -u admin -p pwd@123
mgmt_cli add network name "Net_10.55.1.0/24" subnet "10.55.1.0" subnet-mask "255.255.255.0" --format json -u admin -p pwd@123
mgmt_cli add network name "Net_10.94.1.0/24" subnet "10.94.1.0" subnet-mask "255.255.255.0" --format json -u admin -p pwd@123
执行后在smartcenter上查看,如下图:
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/add-nat-rule~v1.5%20
posted on 2019-10-20 16:12 CyberSecurityBook 阅读(525) 评论(0) 编辑 收藏 举报