锐捷网管交换机MAC 地址变化通知功能配置举例

一、 组网需求
如下图所示,Device A下的网络中有User A、User B和User C等多个设备,为了对Device A从接口GigabitEthernet 0/1上学习到的MAC地址表项以及老化的MAC地址表项进行记录,并将设备MAC地址变化通知以SNMP Trap消息的方式将发送给指定的网络管理工作站,同时还需要尽量避免短时间内产生大量的MAC地址变化信息,以免占用过多的网络资源。

二、组网图
组网图

三、 配置要点
● 在Device A上配置开启全局MAC地址通知功能,并配置发送MAC地址Trap消息的时间间隔。
● 在Device A的接口GigabitEthernet 0/1上配置开启接口的MAC地址通知功能。
● 指定SNMP主机的地址,并配置开启MAC地址事件的Trap通知。
● 需要保证Device A与网络管理工作站之间路由可达。

四、 配置步骤
# 配置开启全局MAC地址通知功能,并指定发送MAC地址Trap消息的时间间隔为300秒。
DeviceA# configure terminal
DeviceA(config)# mac-address-table notification
DeviceA(config)# mac-address-table notification interval 300

# 在接口GigabitEthernet 0/1上配置开启接口的MAC地址通知功能,指定在MAC地址增加与删除时均发送Trap通告。
DeviceA(config)# interface gigabitethernet 0/1
DeviceA(config-if-GigabitEthernet 0/2)# snmp trap mac-notification added
DeviceA(config-if-GigabitEthernet 0/2)# snmp trap mac-notification removed

# 指定SNMP主机的地址为192.168.1.1,SNMP版本为SNMP v1版本,团体字符串为“123”,主动发送MAC地址类型的Trap信息。
DeviceA(config-if-GigabitEthernet 0/2)# exit
DeviceA(config)# snmp-server host 192.168.1.10 traps version 2c 123 mac-notification

# 配置启动MAC地址事件的Trap通知。
DeviceA(config)# snmp-server enable traps

五、验证配置结果
上述配置完成后,通过show mac-address-table notification命令可以查看全局MAC地址通知功能的配置状态。同时,可以通过show mac-address-table notification history命令查看MAC通知历史记录表信息。
# 查看全局MAC地址通知功能的配置状态。
DeviceA# show mac-address-table notification
查看全局MAC地址通知功能的配置状态

# MAC地址变化后,查看MAC通知历史记录表信息。
DeviceA# show mac-address-table notification history
查看MAC通知历史记录表信息

六、配置文件
●Device A的配置文件
hostname DeviceA
!
mac-address-table notification
mac-address-table notification interval 300
!
!
interface GigabitEthernet 0/1
snmp trap mac-notification added
snmp trap mac-notification removed
!
!
snmp-server host 192.168.1.10 traps version 2c 7 $10$135$2c+O$ mac-notification
snmp-server enable traps
!

 

ICP备案号:晋ICP备18007549号-1
站长微信:15534641008