H3C交换机基础配置及故障排查

文章2022-03-04
H3C交换机基础配置及故障排查-下一朵云

以下命令以H3C S5120为实验对象,其他设备命令可能略有不同

一、交换机基础配置

1.开启NTP服务

ntp enable

设置时区

clock timezone beijing add 8

自定义NTP服务器地址

ntp-service unicast-server 120.25.115.20

#如果使用域名作为ntp服务器的地址,需要配置dns
#可以通过多次执行ntp-service unicast-server命令配置多个服务器,客户端依据时钟优选来选择最优的时钟源

dns server 114.114.114.114
ntp-service unicast-server ntp1.aliyun.com

2.设备命名

sysname SW1_192.168.100.254(添加IP地址) 

3.开启生成树协议

stp global enale
stp enable

开启BPDU 核心交换机不能配置此命令

stp bpdu-protection

4.开启网络设备LLDP邻居发现协议

lldp global enable

5.开启远程服务

telnet server enable
ssh server enable

配置交换机远程管理

#
local-user admin
password simple admin
authorization-attribute level 3
service-type ssh telnet 
#
local-user admin class manage
password simple admin
service-type ssh telnet 
authorization-attribute user-role level-15
authorization-attribute user-role network-operator
#
line vty 0 4(虚拟终端连接)
authentication-mode scheme
#

二、端口配置

1.配置vlan和端口

display interface brief
interface GigabitEthernet 1/0/24
port link-type trunk 
port trunk permit vlan 200
# 
interface GigabitEthernet 1/0/24
port access vlan 200

2.配置默认路由

ip route-static 0.0.0.0 0.0.0.0 192.168.100.254

3.开启接口安全

interface GigabitEthernet 1/0/24(trunk口不能配置此命令)
stp edged-port

三、基础网络排查

  1. 主机物理链路是否互通
  2. 网关IP是否可达
  3. 目标IP是否可达
  4. 业务应用域名是否可达
  5. 域名端口是否可达
  6. 交换机设备是否正常
  7. 上网行为管理器策略是否允许通讯
  8. 无线AC、AP是否通讯
  9. 无线终端用户是否获取正常网络信息
  10. 公网、专线链路是否正常

常用命令

display arp (查看ARP表)
display mac-address (查看MAC)
display lldp neighbor-information list (查看设备邻居)
display current-configuration 
display  ip interface  brief
display mac-address mac-move