H3C S5800
显示当前配置
恢复出厂设置
转到命令行
保存配置
[H3C]save
显示全部vlan
[H3C]dis vlan all
创建VLAN
[H3C] vlan 100
删除VLAN
[H3C] undo vlan 100
查看当前端口配置
[H3C-GigabitEthernet1/0/1]dis this
端口配置为trunk口并划分vlan
interface GigabitEthernet1/0/1 /缩写 interface g 1/0/1
port link-type trunk
port trunk permit vlan 1 100
设置tag口(hybrid)
[H3C]interface GigabitEthernet 1/0/12
[H3C-GigabitEthernet1/0/12]port link-type hybrid
[H3C-GigabitEthernet1/0/12]port hybrid vlan 100 200 tagged
端口配置为access口并划分vlan
interface GigabitEthernet1/0/2
port link-type access
port access vlan 100
删除端口配置:
undo port access vlan
端口配置为hybrid口并划分vlan(同一个端口配置tag和untag)
interface GigabitEthernet1/0/10
port link-type hybrid
port hybrid vlan 210 tagged
port hybrid vlan 20 untagged
port hybrid pvid vlan 20
删除端口配置:
[H3C-GigabitEthernet1/0/10]undo port hybrid vlan 210
[H3C-GigabitEthernet1/0/10]undo port hybrid vlan 20
[H3C-GigabitEthernet1/0/10]undo port link-type
设置vlan口IP地址
interface Vlan-interface 20 /缩写 interface vlan 20
ip add 192.168.20.254 24
启用dhcp
[H3C]dhcp enable
设置dhcp
[H3C] dhcp server ip-pool 20
[dhcp server ip-pool 20] network 192.168.20.10 mask 255.255.255.0
dns-list 218.2.135.1
gateway-list 192.168.20.254
expired day 10 hour 0 minute 0
option 43 hex 0106 0104 c0a8 645a (192.168.100.90)
vlan口设置dhcp server
[H3C]interface vlan-interface 20
[H3C-VLAN-interface20]dhcp select server global-pool
静态路由设置
[H3C] ip route-static 0.0.0.0 0.0.0.0 192.168.100.1 (公网网关)
查看路由
[H3C]display ip routing-table
[H3C-Vlan-interface210]arp send-gratuitous-arp
镜像端口配置
配置镜像口-目的端口
[H3C]mirroring-group 1 local
[H3C]interface GigabitEthernet 1/0/24
[H3C-GigabitEthernet1/0/24]mirroring-group 1 monitor-port
或者:(全局视图)
[H3C]mirroring-group 1 monitor-port G 1/0/24
配置镜像口-源端口(端口视图)
[H3C]interface GigabitEthernet 1/0/1
[H3C-GigabitEthernet1/0/1]mirroring-group 1 mirroring-port both
删除镜像端口:
先解除端口绑定:
H3C]interface GigabitEthernet 1/0/1
[H3C-GigabitEthernet1/0/1]undo mirroring-group 1 mirroring-port both
端口隔离配置
H3C]interface GigabitEthernet 1/0/10
[H3C-GigabitEthernet1/0/10]port-isolate enable
查看交换机文件
通过tftp导入、导出交换机配置文件(config.cfg)
tftpPC可以ping通交换机端口IP
将配置文件导出(备份)
将配置文件导入(恢复)
H3C S5560
端口隔离
创建隔离组1-8
[H3C] port-isolate group 2
将端口GigabitEthernet1/0/10加入隔离组2。
[H3C-GigabitEthernet1/0/10]port-isolate enable group 2
显示所有隔离组的信息。
Port isolation group information:
Group ID: 2
Group members:
GigabitEthernet1/0/10 GigabitEthernet1/0/11