how to find out the switch port by IP address

Subject:
How to find out the port number by IP address

Solution:

In core
switch, ping  the IP address,

Ex:

[email protected]#ping 10.20.12.111

Sending 1, 16-byte ICMP Echo to 10.20.12.111, timeout
5000 msec, TTL 64

Type Control-c to abort

Reply from 10.20.12.111    : bytes=16 time=1ms TTL=128

Success rate is 100 percent (1/1), round-trip
min/avg/max=1/1/1 ms.

[email protected]#

And then:

[email protected]#sh arp 10.20.12.111

IP Address           Mac Address      Type         Age          Port       
Status

1     10.20.12.111   6c62.6d99.023c Dynamic     1            1/19        Valid

[email protected]#

And we find one device be connected to Port:1/19

But the device‘s IP address is 10.20.12.111?

Let show MAC address again.

[email protected]#sh mac ethernet 1/19

Total active entries from port 19 = 10

MAC-Address    
Port         Type       Index      VLAN

0012.f20c.d234 
1/19         Dynamic    15838     
2

001b.78a5.1abb 
1/19         Dynamic    1186      
11

6c62.6d99.023c  1/19        
Dynamic    9116       12

0022.641b.a7d6 
1/19         Dynamic    14968     
11

0022.641b.a89f 
1/19         Dynamic    7876      
11

1cc1.de13.3269 
1/19         Dynamic    14167     
11

0015.5d0c.6f0b 
1/19         Dynamic    10006     
12

4061.86c6.9d40 
1/19         Dynamic    567       
11

9cb6.543a.d6b6 
1/19         Dynamic    9426      
11

000d.f411.af84 
1/19         Dynamic    5002      
12

[email protected]#

We can find not only 6c62.6d99.023cdevice  communication by this switch port. So we know
a switch or router be connected to this switch port number.

Let me show fdp(Cisco named CDP) neighbor.

[email protected]#sh  fdp neighbors ethernet 1/19

Device ID: HF-OA-B1-1C

configured as tag-type8100

Entry address(es):

IP address:
10.20.0.20

Platform: FES4802 Switch,  Capabilities: Switch

Interface: ethernet1/19

Port ID (outgoing port): ethernet50 is TAGGED in
following VLAN(s):

2 11

Holdtime : 122 seconds

Foundry Networks, Inc. FES4802, IronWare Version
03.6.00cTc1 Compiled on Oct 31 2006 at 22:18:23 labeled as FES03600c

One device named HF-OA-B1-1C be connected to this
port.

Now let‘s login this switch by telnet.

Let‘s ping the IP address: 10.20.12.111 at first.

[email protected]#ping 10.20.12.111

Sending 1, 16-byte ICMP Echo to 10.20.12.111, timeout
5000 msec, TTL 64

Type Control-c to abort

Reply from 10.20.12.111    : bytes=16 time<1ms TTL=127

Success rate is 100 percent (1/1), round-trip
min/avg/max=0/0/0 ms.

[email protected]#^C

[email protected]#

And then let‘s show the mac address:

[email protected]#sh mac-address

Total active entries from all ports = 31

MAC-Address    Port     Type  
VLAN

6c62.6d99.0129    
50  Dynamic     12

6c62.6d99.0309    
50  Dynamic     12

6c62.6d99.023f    
50  Dynamic     12

6c62.6d99.023c      7 
Dynamic     12

d067.e531.3ec0    
50  Dynamic     12

02e0.52ea.ca0c    
50  Dynamic     12

02e0.52c5.ca0b    
50  Dynamic     11

02e0.522e.ca02    
50  Dynamic      2

9cb6.543a.d6b6    
22  Dynamic     11

000d.f411.d7d2    
50  Dynamic     12

0012.f21a.da00    
50  Dynamic     11

0012.f21a.da12    
50  Dynamic     11

000d.f410.c492    
50  Dynamic     12

0015.5d0c.6f0b     
7  Dynamic     12

000d.f411.c18e    
50  Dynamic     12

000d.f411.4920    
50  Dynamic     11

0022.641b.a7d6    
21  Dynamic     11

0022.641b.a89f    
14  Dynamic     11

4061.86c8.12a1    
50  Dynamic     11

0012.f21b.2500    
50  Dynamic     11

000d.f411.af84     
7  Dynamic     12

MAC-Address    Port     Type  
VLAN

4061.86c6.9d60    
50  Dynamic     12

4061.86c6.9d40    
25  Dynamic     11

001b.78a5.1abb    
23  Dynamic     11

001c.c41e.a6cf    
50  Dynamic     11

1cc1.de13.3269    
16  Dynamic     11

0012.f21a.da12    
50  Dynamic     12

0012.f21b.2500    
50  Dynamic     12

0012.f21a.da12    
50  Dynamic      2

0012.f21b.2500    
50  Dynamic      2

0012.f21a.da00    
50  Dynamic     12

We can find the mac-address 6c62.6d99.023c matching with IP address, and the switch port
number  is 7.  but we find not only the mac address
communication by this switch port. Let‘s check it again. We find one a small
hub is connected to this switch port. So we can ignore this small HUB and think
the device directly connected to this port.

Now we have found the switch port.

时间: 2024-10-06 06:12:38

how to find out the switch port by IP address的相关文章

18-RSAPN:Remote switch port analyzer //GNS3 2.1.5

一.实验拓扑:二.实验要求:1.R1.R2网段地址为:100.1.1.X/24,SW1和SW2之间部署Trunk中继链路:2.SW1.SW2分别部署RSPAN技术,分别部署本地和远程源目监听地址:使得远程云能够监听SW1的VLAN1收发流量:3.抓包验证是否可以成功?三.命令部署:1.R1.R2命令部署:R1(config)#int f0/0R1(config-if)#no shutdown R1(config-if)#ip add 100.1.1.1 255.255.255.0R2(confi

LVS集群中的IP负载均衡技术

章文嵩 ([email protected]) 转自LVS官方参考资料 2002 年 4 月 本文在分析服务器集群实现虚拟网络服务的相关技术上,详细描述了LVS集群中实现的三种IP负载均衡技术(VS/NAT.VS/TUN和VS/DR)的工作原理,以及它们的优缺点. 1.前言在 前面文章中,讲述了可伸缩网络服务的几种结构,它们都需要一个前端的负载调度器(或者多个进行主从备份).我们先分析实现虚拟网络服务的主要技术,指出 IP负载均衡技术是在负载调度器的实现技术中效率最高的.在已有的IP负载均衡技术

思科和华为交换机常用命令之对比学习

思科和华为交换机应该是网络项目中大家接触比较多的了,这两种交换机的常用 命令各有不同,本文结合网络项目中两种交换机的常用命令从对比的角度帮助大家来学习. 一. Switch#show  run 显示所有配置命令 Switch#show   ip   inter   brief   显示所有接口状态 Switch#show vlan  brief   显示所有VLAN的信息 Switch#show   version   显示版本信息 [Quidway]dis cur 显示所有配置命令 [Quid

VMware ESXI4.1 常用命令

一. VMware ESX Command 1. # vmware –v  (查看esx版本) 2. # esxcfg-info -a(查看显示ESX硬件,内核,存储,网络等信息) # esxcfg-info -w(显示esx上硬件信息) 3. # esxcfg-firewall –s  (列出esx里知道的服务) 4. # esxcfg-firewall -q sshclinet  查看具体服务的情况 5. # service mgmt-vmware restart  重新启动vmware服务

esxi常用的命令

今天本想在vcenter上建个分布式交换机,没想到在迁移主机端口时,由于主机只连了一个物理网卡,导致在迁移到分布式交换机而失去连接,几近周折,从网上找了几篇不错的文章,与众同乐 假如一台ESX主机先通过标准虚拟交换机vSwitch0上的服务控制台IP(192.168.100.101)连接到vCenter Server.然后新建一个DVS,uplink仍然连接到同一子网(192.168.100.0/24).此时将主机中空闲的物理网卡添加到uplink是没有问题的,但如果迁移和vSwitch0连接的

负载均衡汇总

负载均衡学习笔记 一.总体介绍 1.1 定义 1.1.1 Load balancing Load Balancing is the process of distributing data across disparate services to provide redundancy, reliability, and improve performance. The entire intent of load balancing is to create a system that virtu

Rhel6-lvs配置文档

系统环境: rhel6 x86_64 iptables and selinux disabled 相关网址:http://zh.linuxvirtualserver.org/ yum仓库配置: [rhel-source] name=Red Hat Enterprise Linux $releasever - $basearch - Source baseurl=ftp://192.168.122.1/pub/yum enabled=1 gpgcheck=1 gpgkey=file:///etc/

Internet protocol optimizer

A method for optimizing the throughput of TCP/IP applications by aggregating user application data and consolidating multiple TCP/IP connection streams into a single optimized stream for delivery to a destination application. Optimization of the inte

Linux服务器集群LVS

本文主要介绍了Linux服务器集群系统–LVS(Linux Virtual Server),并简单描述下LVS集群的基本应用的体系结构以及LVS的三种IP负载均衡模型(VS/NAT.VS/DR和VS/TUN)的工作原理,以及它们的优缺点和LVS集群的IP负载均衡软件IPVS在内核中实现的各种连接调度算法. 参考文献 http://www.linuxvirtualserver.org/zh/index.html 前言 LVS(Linux Virtual Server)的简写,翻译为Linux虚拟服