交换机依靠什么进行数据转发?
交换机是依靠mac地址表进行数据转发
1、什么是mac地址表?
交换机上----数据转发表----维护交换机正常的数据转发
2、交换机的mac地址转发表的构成?
由mac地址 + vlan + 交换机的接口构成
- mac地址----硬件地址/物理地址-----烧录在网卡芯片上--用于网卡的身份标识----唯一的、不可重复的
- Vlan----virtual lan----虚拟局域网----用于识别交换机上的接口是否属于同一网络的。默认情况下,交换机上的接口都是属于vlan 1的。
- 交换机的接口:连接终端设备的接口。
3、mac地址表的获取途径?
静态手工配置----通过在交换机上手动的将mac地址 + vlan + 接口捆绑在一起----static
动态的自动获取---- 一旦终端设备产生数据,到达交换机的接口,交换机就会自动记录下这个接口所对应终端设备的mac地址---mac地址 + vlan + 接口--dynamic
实验内容
静态手工配置 手工输入mac地址为:0000-0102-0304
<Huawei>sy
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo inf
[Huawei]undo info-center en
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sys
[Huawei]sysname LSW1
[LSW1]dis
[LSW1]display mac-add
[LSW1]display mac-address
[LSW1]mac-add
[LSW1]mac-address sta
[LSW1]mac-address static 0000-0102-0304 g0/0/1 vlan 1
[LSW1]display mac-address
MAC address table of slot 0:
---------------------------------------------------------------------------------------------------------------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
---------------------------------------------------------------------------------------------------------------------------------
0000-0102-0304 1 - - GE0/0/1 static -
---------------------------------------------------------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 1
动态自动获取
[LSW1]display mac-address
MAC address table of slot 0:
----------------------------------------------------------------------------------------------------------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
----------------------------------------------------------------------------------------------------------------------------
0000-0102-0304 1 - - GE0/0/1 static -
------------------------------------------------------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 1
MAC address table of slot 0:
------------------------------------------------------------------------------------------------------------------------------
MAC Address VLAN/ PEVLAN CEVLAN Port Type LSP/LSR-ID
VSI/SI MAC-Tunnel
------------------------------------------------------------------------------------------------------------------------------
5489-9816-2e54 1 - - GE0/0/1 dynamic 0/-
5489-98ca-32a6 1 - - GE0/0/2 dynamic 0/-
-----------------------------------------------------------------------------------------------------------------------------
Total matching items on slot 0 displayed = 2