Cisco switches/router useful commands

useful show commands 34

COMMAND

DESC

sh log

Will show the log

sh run

Will show the switch config

sh run int g0/1

Will show the config for g0/1

sh int status

Will show all interfaces status

sh mac address-table

Will show mac address table

sh ip arp

Will show ARP table

sh cdp neighbors

Print Cisco connected device  

 

 

 

 

 

 

 

 

 

 

 

 

 

查看vlan命令 show vlan brief

查看各个接口的名称、ip、状态等 show ip interface brief

show ip route //查看路由表

 show ip nat translations //查看NAT表

查看交换机里配置的路由

sh run | inc route

 

然后是知道某电脑的IP,怎么查其接的交换机哪个口?

1、首先查ARP表中该IP对应的mac

sh ip arp | inc 24.62

2、然后根据得到的mac在mac地址表里查对应的端口

sh mac address-table | inc e78d

 但比如ssh登录到的交换机是一个二层交换机,但要查的IP地址的电脑是连在三层交换机上的,怎么查?

按照Thibault的方法,二层交换机上现在应该没有缓存该ip的arp,所以sh ip arp | inc 10.25.24.62是空的

那就先ping一次,ping通了之后再sh ip arp | inc 10.25.24.62,就看得到该电脑的mac地址了,

然后sh mac address-table | inc e78d就可以查到在二层交换机上对应的端口,然后查看这个端口的状态

sh int status | inc Gi0/2

we can see switchport is configured in trunk mode, probably another switch, we dig

下面这个命令挺有用,可以看一台交换机上接了哪些设备

sh cdp neig

可以看到gi0/2是对应的sw01,最后ssh登录到sw01去就可以查找了

posted @   Expl  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
点击右上角即可分享
微信分享提示