跳过导航链接 | |
退出打印视图 | |
Oracle Solaris 管理:网络接口和网络虚拟化 Oracle Solaris 11 Information Library (简体中文) |
使用 netcfg destroy -a 命令,可从内存和持久性存储中删除所有的或指定的用户定义的配置文件。
注 - 不能删除系统定义的配置文件,包括“自动”NCP、“无网络”“自动”位置配置文件。
destroy 命令的语法如下:
netcfg destroy object-type [ class ] object-name
也可以使用以下命令删除系统中所有的用户定义的配置文件:
netcfg destroy -a
示例 4-6 使用 netcfg 命令行模式删除所有的用户定义的配置文件
要删除系统中所有的用户定义的配置文件,请键入以下命令:
$ netcfg destroy -a
因为在任何时间都必须至少有一个配置文件在系统中处于活动状态,所以请确保在使用 destroy -a 命令之前启用“自动”NCP,这也是为了避免在删除用户定义的配置文件时出现正在使用中错误。
示例 4-7 使用 netcfg 命令行模式删除指定用户定义的配置文件
要删除系统中特定的用户定义的配置文件,例如要删除名为 User 的 NCP,请键入以下命令:
$ netcfg destroy ncp User
destroy 命令还可用于从现有 NCP 删除 NCU。在以下示例中,从用户定义的 NCP 中删除了一个名为 net1 的接口 NCU:
$ netcfg "select ncp User; destroy ncu ip net1"
要确认配置文件已删除,请使用 list 子命令,如下所示:
$ netcfg netcfg> select ncp User netcfg:ncp:User> list NCUs: phys net1 netcfg> exit Nothing to commit $
示例 4-8 以交互方式删除配置文件
在以下示例中,删除了名为 net2 的IP NCU。
$ netcfg list NCPs: Automatic User Locations: Automatic NoNet test foo $ netcfg netcfg> select ncp User netcfg:ncp:User> list NCUs: phys net2 ip net2 netcfg:ncp:User> destroy ncu ip net2 Destroyed ncu 'net2' netcfg:ncp:User> list NCUs: phys net2 netcfg:ncp:User> end netcfg> exit Nothing to commit $