> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lwops.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 5.3. 思科设备

### 5.3.1. ssh登录交换机

### 5.3.2.配置snmp、snmptrap

```text theme={null}
# conf t   //进入配置模式
(config)# snmp-server enable traps    //启用snmptrap
(config)# snmp-server community ITCloud ro   //配置snmp只读团体名为ITCloud
(config)# snmp-server host 10.140.20.183 traps version 2c ITCloud123  //配置snmptrap团体名（ITCloud123）、trap接收服务器地址（10.140.20.183）
(config)# snmp-server host 10.140.20.183 source-interface mgmt0  //配置snmptrap源地址为管理口（mgmt0）
(config)# exit  //退出配置模式
# copy running-config startup-config     //保存配置
```

### 5.3.3. SNMP测试连接

监控平台Server执行以下命令进行snmp测试

```text theme={null}
snmpwalk -v 2c -c ITCloud 10.240.1.124 system
```

![5.3. 思科设备 操作截图 1](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/cisco/image-01.png)

### 5.3.4. SNMPTRAP配置

配置trap前，先ssh登录进Trap接收服务器地址，输入udp信息监听命令：

```text theme={null}
tcpdump -nn "udp" and host 192.168.145.9
# 命令格式为：tcpdump -nn "udp" and host 设备IP
```

测试snmptrap，查看trap接收服务器上，可以看到带有‘Trap’字样的信息出现，表示成功

![5.3. 思科设备 操作截图 2](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/cisco/image-02.png)
