Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 255

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 325

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 326

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 327

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 330

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 333

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 336

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345
Cisco交换机里IP和MAC地址互查找出对应端口 – 理想社会

Cisco交换机里IP和MAC地址互查找出对应端口

交换机:Cisco2960、Cisco G3560X

服务器:10.15.44.164 AC-*-2D-*-84-*

PC:10.15.44.69

服务器44.164→port 2-Cisco2960-port1→G3560X-port5

通过IP地址查找这个IP在那台交换机的接口下

 

通过MAC、IP地址查询对应交换机端口

1.开始运行Nbtstat –a ip 查询出mac地址

或者直接到G3560X交换机上通过show arp查找mac地址

没发现对应关系是ARP信息超时了就被删除,ARP和MAC两张表的超时清理时间是不一样的,可以先到交换机上去ping下该IP地址在show arp

2.登陆G3560x

运行Switch#show mac address-table dynamic address AC-*-2D-*-84-*

可以看到mac地址为AC-*-2D-*-84-*连接G3560X交换机的端口是port5

3. 根据GigabitEthernet0/5查询该接口对接的设备

运行Switch#SHOw cdp neighbors gigabitEthernet 0/5

显示更详细的信息:Switch#SHOw cdp neighbors gigabitEthernet 0/5 detail

可以看到G0/5对接的设备是Cisco2960交换机的fas0/1端口

4.登陆Cisco2960,

运行cisco2960-sh-10-4-4#show mac address-table dynamic address AC-*-2D-*-84-*

可以看到mac地址为AC-*-2D-*-84-*连接C2960交换机的端口是port9

5.确认该mac是否是这个端口唯一活动mac地址

运行cisco2960-sh-10-4-4#show mac address-table dynamic interface gigabitEthernet 0/9

只显示一条,表明10.15.44.164就是连接到C2960交换机的9口;若有多条结果表明C2960 port9下接的还有其他路由交换设备,重复以上步骤查找

 

通过交换机端口地址查询对应服务器IP

上面通过IP查到了所连交换机对应的端口,下面通过交换机端口查询连接的是那台服务器,环境还是如上

查看C3650X port11对应连接的是哪台服务器,步骤和上面类似,逆推

1、查看C3650X port11查接口对接的设备mac地址

 

运行Switch#show mac address-table dynamic interface gigabitEthernet 0/11

 

 

1、通过mac地址查看对应IP

运行show arp | include mac_address

ARP和MAC两张表的超时清理时间是不一样的。使用Switch#clear arp-cache 可以清除arp信息表,使用Switch#show interfaces gigabitEthernet 0/11可以查看arp刷新时间  ARP type: ARPA, ARP Timeout 04:00:00;没发现对应关系是ARP信息超时了就被删除,如何刷新arp表有知道的大神请指教!

本文出自 “我本不是菜鸟” 博客,请务必保留此出处http://pvbutler.blog.51cto.com/7662323/1748384

评论

发表回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据