博威---云架构决胜云计算

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2611|回复: 8

dbedit——应对大型网络环境的好工具

[复制链接]
发表于 2010-5-28 10:27:17 | 显示全部楼层 |阅读模式
dbedit
功能说明:后台命令行模式创建/修改/重命名/删除所有对象(包括主机,网络,组等)
重点是,支持批处理文件,进行批量生成对象,可用于对象数目很大的网络环境中使用

进入expert模式使用此命令
 楼主| 发表于 2010-5-28 10:28:02 | 显示全部楼层

dbedit帮助信息

本帖最后由 bbl164 于 2010-5-28 10:31 编辑

1.jpg
 楼主| 发表于 2010-5-28 10:32:13 | 显示全部楼层

dbedit官方使用范例

This procedure will create a script file to add Network objects and Network Group objects to the objects_5_0.C file.

This is ideal for environments that are not able to take advantage of GuiDBedit, or where creating a large number of objects at one time is required.
On the SmartCenter Server, close all GUI sessions, including SmartView Tracker, SmartUpdate, etc.
Create a text file containing the following lines:

create network internal_net
modify network_objects internal_net ipaddr 192.168.1.0
modify network_objects internal_net netmask 255.255.255.0
update network_objects internal_net
create host_plain web_server
modify network_objects web_server ipaddr 192.168.1.1
update network_objects web_server
create network_object_group net_group
addelement network_objects net_group '' network_objects:internal_net
addelement network_objects net_group '' network_objects:web_server
update network_objects net_group Save the edited file as: network_script.txt

Below is an explanation of what each section in the network_script.txt file does.

The following section creates a network object called "internal_net" with IP address 192.168.1.0/24:

create network internal_net
modify network_objects internal_net ipaddr 192.168.1.0
modify network_objects internal_net netmask 255.255.255.0
update network_objects internal_net

The following section creates a host object called "web_server" with IP address 192.168.1.1:

create host_plain web_server
modify network_objects web_server ipaddr 192.168.1.1
update network_objects web_server

The following section creates a network object group called "network_object_group" and adds the network object "internal_net" and host object "web_server" to this group object:

create network_object_group net_group
addelement network_objects net_group '' network_objects:internal_net
addelement network_objects net_group '' network_objects:web_server
update network_objects net_group Open a command prompt and change the current directory to the directory, in which the network_script.txt file is located.
Issue the following command to make dbedit run the script.

Note: In the following example the IP address of the SmartCenter Server is 192.168.2.100, the FireWall-1 Administrator name is "fwadmin", and the FireWall-1 Administrator password is "abc123"):

dbed
 楼主| 发表于 2010-5-28 10:50:38 | 显示全部楼层

使用方法

使用此命令之前,关闭所有的GUI界面,包括SmartView Tracker,SmartUpdate等建立一个包含以下内容的文本文件create network internal_net  //创建一个网络对象名为internal_net
modify network_objects internal_net ipaddr 192.168.1.0  //修改网络对象internal_net 的网络为192.168.1.0
modify network_objects internal_net netmask 255.255.255.0  //修改网络象internal_net 的子网掩码为 255.255.255.0
update netwrk_objects internal_net  //更新网络对象internal_net,使之升效create host_plain web_server  //创建一个名为host_plain的主机对象
modify network_objects web_server ipaddr 192.168.1.1  //修改对象web_server的IP地址为192.168.1.1
update network_objects web_server  //更新对象web_server,使之生效create network_object_group net_group  //创建一个名为net_group的网络组
addelement network_objects net_group '' network_objects:internal_net  //将网络对象internal_net加入网络组net_group中
addelement network_objects net_group '' network_objects:web_server  //将对象web_server加入网络组net_group中
update network_objects net_group  //更新网络组net_group,使之生效将该文件保存为名为network_script.txt的文本文件将其上传至CP中的某个目录(/usr/script)
进入该目录,运行命令生成各网络对象
dbedit -local -u admin -p xinboway -f network_script.txt-local 指本机服务器
-s 192.168.1.1 指向IP为192.168.1.1的服务器
-u 管理员名称
-p 密码
-f 脚本文件名
发表于 2010-5-28 10:51:23 | 显示全部楼层
 楼主| 发表于 2010-5-28 10:59:05 | 显示全部楼层
对象很多的话,用dashboard添加效率很低的
发表于 2010-6-27 10:11:15 | 显示全部楼层
确实是个好东东啊  CP不像其他完成可以使用CLI的设备,在添加大量的规则的时候这个特别有用啊。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|boway Inc. ( 冀ICP备10011147号 )

GMT+8, 2024-4-26 17:20 , Processed in 0.097868 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表