一、H3C设备的权限默认分为0-3这四种级别
数值越小,用户的级别越低
(1)访问权限0 级 : ping、tracert、telnet 等网络诊断小程序,不可以dis current
(2)监控权限 1级: dis current、reset、可开debug这种高级系统诊断工具,不能进入system视图进行配置,命令不能保存
二、如何扩展低级别的命令呢?
修改命令级别的方法就是在系统视图下执行"command-privilege level level view view command"命令。可使用"undo command-privilege view view command"恢复默认情况。默认情况,各个视图下的每条命令都有指定的级别。命令中的参数说明如下:
level level:把后面指定的命令修改到的级别,取值范围为0~3。
view view:指定可以执行后面指定的命令的命令行视图名称,view的取值中shell表示用户视图, 用户模式提示符为> 。该参数必须是command所在的视图。
command:指定需要修改命令级别的命令。
例如给权限0的用户debugging权限的命令:
可以在系统模式下用:command-privilege level 0 view shell debugging,
三、我给机构IT人员分配了level 1的基本权限用于操作H3C S3100二层交换机,并附加如下命令
command-privilege level 1 view shell system-view
在用户模式(shell)下可以使用system命令进行系统视图
command-privilege level 1 view system quit
在system系统视图模式下将quit命令定义为可执行,否则不能退到用户(shell)模式
command-privilege level 1 view system save
command-privilege level 1 view shell save
授权level 1在在用户模式和system模式都可以save
command-privilege level 1 view system interface
授权level 1在system系统视图模式下可以进入interface接口。
command-privilege level 1 view system interface Ethernet
command-privilege level 1 view ethernet quit
授权level 1在system系统视图模式下可以进入interface ethernet接口.
如果不配置ethernet quit,则用户在ethernet接口模式下使用quit会直接退回到用户模式(提示符为>),而不是退回system系统视图
command-privilege level 1 view system interface Ethernet 1/0/1
command-privilege level 1 view system interface Ethernet1/0/1
两条命令仅有一个空格的区别,但建议同时写如上两条,以方便进入接口。虽然只写了eth1/0/1这一个接口,但同时可以对其他的ethernet端口进行,包括GigabitEthernet光接口均可以进入
command-privilege level 1 view ethernet shutdown
command-privilege level 1 view ethernet undo
command-privilege level 1 view ethernet undo shutdown
授权level 1在ethernet接口模式下可以对进行shutdown,undo shut操作,GigabitEthernet光接口则不可以
command-privilege level 1 view ethernet mac-address
command-privilege level 1 view ethernet mac-address max-mac-count
command-privilege level 1 view ethernet mac-address max-mac-count 1
command-privilege level 1 view ethernet undo
command-privilege level 1 view ethernet undo mac-address
command-privilege level 1 view ethernet undo mac-address max-mac-count
授权level 1在ethernet接口模式下可以限制该端口学习到的mac地址数
command-privilege level 1 view ethernet mac-address
command-privilege level 1 view ethernet mac-address static
command-privilege level 1 view ethernet mac-address static 0000-5e00-0001
command-privilege level 1 view ethernet mac-address static 0000-5e00-0001 vlan
command-privilege level 1 view ethernet mac-address static 0000-5e00-0001 vlan 70
command-privilege level 1 view ethernet undo mac-address
command-privilege level 1 view ethernet undo mac-address static
command-privilege level 1 view ethernet undo mac-address static 0000-5e00-0001
command-privilege level 1 view ethernet undo mac-address static 0000-5e00-0001 vlan
command-privilege level 1 view ethernet undo mac-address static 0000-5e00-0001 vlan 70
授权level 1在ethernet接口视图下可静态绑定mac地址到指定的端口、vlan
command-privilege level 1 view ethernet mac-address
command-privilege level 1 view system mac-address static
command-privilege level 1 view system mac-address static 0000-5e00-0000
command-privilege level 1 view system mac-address static 0000-5e00-0000 interface
command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet
command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 1/0/1
command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan
command-privilege level 1 view system mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan 70
command-privilege level 1 view system undo
command-privilege level 1 view system undo mac-address
command-privilege level 1 view system undo mac-address static
command-privilege level 1 view system undo mac-address static 0000-5e00-0000
command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface
command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet
command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 1/0/1
command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan
command-privilege level 1 view system undo mac-address static 0000-5e00-0000 interface Ethernet 1/0/1 vlan 70
授权level 1在system视图下可静态绑定mac地址到指定的端口、vlan
command-privilege level 1 view ethernet line-rate
command-privilege level 1 view ethernet line-rate inbound
command-privilege level 1 view ethernet line-rate inbound 64
command-privilege level 1 view ethernet line-rate outbound
command-privilege level 1 view ethernet line-rate outbound 64
command-privilege level 1 view ethernet undo line-rate
command-privilege level 1 view ethernet undo line-rate inbound
command-privilege level 1 view ethernet undo line-rate outbound
授权level 1在ethernet接口模式下可以限速
command-privilege level 1 view ethernet speed
command-privilege level 1 view ethernet speed 100
command-privilege level 1 view ethernet speed auto
command-privilege level 1 view ethernet speed 10
command-privilege level 1 view ethernet undo speed
授权level 1在ethernet接口模式下可以设定端口速率
command-privilege level 1 view shell reset
command-privilege level 1 view shell reset counters
command-privilege level 1 view shell reset counters interface command-privilege level 1 view shell reset counters interface Ethernet
command-privilege level 1 view shell reset counters interface Ethernet 1/0/1
授权level 1在用户模式下可以清除计数器
command-privilege level 1 view shell reset logbuffer
command-privilege level 1 view shell reset arp
command-privilege level 1 view shell reset stp
command-privilege level 1 view shell reset ndp
授权level 1在用户模式下可以清除日志,清除arp,清除stp,清除ndp