当我只是将ip地址设置为连接到交换机的主机时,为什么交换机在mac-table中有记录?

网络工程 转变 交换 MAC地址 GNSS3
2021-07-31 22:22:36

我创建了一个新交换机并连接到 GNS3 中的两台主机。像这样:Host1--->LS<---Host2,我认为在两台主机之间发送数据之前,交换机中的 mac-table 应该是空的。但是当我刚刚为两台主机设置ip地址时,我发现交换机中有两台主机的mac地址!这是预期的结果吗?我连两台主机都ping不通,交换机怎么知道mac地址的?

转变:

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    cc01.1064.0000    DYNAMIC     Et0/0
   1    cc02.0a98.0000    DYNAMIC     Et0/1

主机 1:

R1#show interfaces 
FastEthernet0/0 is up, line protocol is up 
  Hardware is AmdFE, address is cc01.1064.0000 (bia cc01.1064.0000)
  Internet address is 12.1.1.1/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, 
R1#show running-config           
Building configuration...

Current configuration : 1056 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
no ip routing
no ip icmp rate-limit unreachable
ip tcp synwait-time 5
!
!
no ip cef
no ip domain lookup

主机 2:

R2#sh interfaces 
FastEthernet0/0 is up, line protocol is up 
  Hardware is AmdFE, address is cc02.0a98.0000 (bia cc02.0a98.0000)
  Internet address is 12.1.1.2/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100
1个回答

但是当我刚刚为两台主机设置ip地址时,我发现交换机中有两台主机的mac地址!这是预期的结果吗?我连两台主机都ping不通,交换机怎么知道mac地址的?

出于多种原因,主机可以自行发送流量,而无需用户或应用程序执行任何操作。一些常见的例子:

  • 网关可达性检查
  • 互联网可达性检查
  • 重复地址检测

如果我不得不根据您提供的有限信息进行猜测,我会怀疑上面的最后一个例子。许多主机在其操作系统/网络堆栈的核心中内置了符合RFC 5227 的重复地址检测。

但是,确认正在发生的事情的最佳方法是实际捕获流量以自己做出决定。