H3C交换机基本命令

1 验证类命令

1.1 查看配置文件

display current-configuration [ { begin | include | exclude } regular-expression ]
display saved-configuration
display startup

1.2 用户级别切换

super

1.3 显示接口状态及所属VLAN

display brief interface
display interface interface-type interface-number

1.4 显示MAC地址列表

display mac-address [ dynamic | static ] [ interface-type interface-number ] [ vlan vlan-id ]

1.5 显示ARP列表

display arp [ static | dynamic | ip-address ]
display arp [ static | dynamic ] | { begin | include | exclude } text

1.6 显示环路检测状态

display loopback-detection

1.7 显示DHCP Snooping状态

display dhcp-snooping
display dhcp-snooping trust

2 配置类命令

鉴于独立的配置命令难以理解,下面都以具体的配置任务为例,列出完成此任务需要的所有命令,可能会有重复。

2.1 端口配置

system-view
interface interface-type interface-number

2.1.1 配置为access并设置VLAN

port link-type access
port access vlan vlan-id

2.1.2 配置为trunk并允许所有VLAN通过

port link-type trunk
port trunk permit vlan all

2.2 开启端口环路检测

注意loopback-detection multi-port-mode,及loopback-detection action这两个命令在较新的交换机上才支持。

system-view
loopback-detection enable
loopback-detection multi-port-mode enable

2.2.1 开启access口环路检测

interface interface-type interface-number
loopback-detection enable
loopback-detection action { no-learning | semi-block | shutdown }

2.2.2 开启hybrid/trunk口环路检测

interface interface-type interface-number
loopback-detection enable
loopback-detection control enable
loopback-detection per-vlan enable
loopback-detection action { no-learning | semi-block | shutdown }

2.3 配置telnet登录

注意user privilege level是可选命令

system-view
user-interface vty first-number [ last-number ]
authentication-mode password
set authentication password { cipher | simple } password
user privilege level level

2.4 配置DHCP服务器

注意gateway-listdns-list后最多可跟8个IP地址。

system-view
dhcp server ip-pool pool-name
network ip-address [ mask mask ]
gateway-list ip-address
dns-list ip-address
quit
dhcp server forbidden-ip low-ip-address [ high-ip-address ]
dhcp select global { interface interface-type interface-number [ to interface-type interface-number ] | all }

2.5 配置DHCP Snooping

system-view
interface interface-type interface-number
dhcp-snooping trust
quit
dhcp-snooping

点击量:29

发表评论

电子邮件地址不会被公开。 必填项已用*标注

4 − 3 =