Introduction to Ethernet VLAN, the association between MAC address table and VLAN

2.8.1 Ethernet VLAN (Introduction, MAC address table and VLAN)

 VLAN (Virtual Local Area Network) divides different networks through VLAN, which can effectively improve the stability of the network and alleviate the impact of broadcast storms .

Different VLANs represent different virtual local area networks , so terminal devices under different VLANs cannot communicate without routing forwarding and VLAN tag operations.

The role of VLAN on broadcasting:

insert image description here

MAC address table of the switch:

 By default, all ports of the switch belong to VLAN1, so the learned MAC addresses belong to VLAN1 by default.

 The MAC addresses of different VLAN ports can be the same without conflicts (because they are in a virtual local area network and cannot perceive the existence of another same MAC address)

 Huawei switches use commands display mac-addressto view the information in the MAC address table.

1. Introduction to the key parameters of the fields in the MAC address table:

  • MAC Address : MAC address of the device under the interface Port

  • VLAN/VSI/SI : The VLAN to which the interface belongs, broadcast frames will only be flooded on ports under the same VLAN

  • Port : The port that generates MAC information

  • Type : Dynamic indicates the information automatically recorded when the switch receives a data frame from the port, and Static indicates the MAC address information manually set by the administrator

<Huawei>display mac-address
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/VSI/SI       PEVLAN CEVLAN  Port            Type      LSP/LSR-ID MAC-Tunnel 
-------------------------------------------------------------------------------
aabb-ccdd-eeff 		1          	   -      -     Eth0/0/1        dynamic   0/-         
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 1 


# 添加静态的MAC地址信息
[Huawei]mac-address static AA22-3344-5566 e0/0/5 vlan 1
[Huawei]display mac-address 
MAC address table of slot 0:
-------------------------------------------------------------------------------
MAC Address    VLAN/       PEVLAN CEVLAN Port            Type      LSP/LSR-ID  
               VSI/SI                                              MAC-Tunnel  
-------------------------------------------------------------------------------
aa22-3344-5566 1           -      -      Eth0/0/5        static    -           
-------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 1 

insert image description here

2. How are MAC entries generated? How to disappear?

 When the switch port receives a data frame, it will bind the SMAC (source MAC) address in the frame, the port receiving the frame, and the VLAN to which the port belongs , and record it in the MAC address table.

 The default aging time of the MAC address table is 300 seconds, which can mac-address aging-time 时间be modified by commands. Check the aging time display mac-address aging-time.

3. How to ensure communication quality with the same MAC and different VLANs?

 The MAC address table of the switch controls the forwarding of data frames, and the same MAC address can realize communication as long as they do not belong to the same VLAN.

How exactly do you communicate?

  • Assume that a terminal A belonging to VLAN1 is looking for a device with a MAC address of AA-BB-CC-DD-EE-FF
  • The switch will first check the VLAN to which the data frame belongs, and the result is VLAN1.
  • Then based on the MAC address table, search for MAC entries belonging to VLAN1. If there is an entry with the MAC Address of AA-BB-CC-DD-EE-FF, it will forward it accordingly. If it does not exist, the data frame is flooded to all ports of VLAN1 except the one that received the frame.
》先划分一下两台相同MAC地址的PC终端

interface Ethernet0/0/1
 port link-type access
 port default vlan 1	#默认不会显示
#
interface Ethernet0/0/2
 port link-type access
 port default vlan 2
#

》默认交换机并不会产生表项,需要在PC1、PC2上进行ping操作后,使得有数据帧通过交换机端口才会产生MAC地址表项。

insert image description here

Guess you like

Origin blog.csdn.net/qq_45443704/article/details/128180656