一   二层交换机 

   ①工作于 数据链路层,MAC地址 

   ②转发过滤决策

   ③ 环路的避免 

二  ARP(地址解析) 

   正:MAC-----IP

   逆 :IP------MAC 

三  VLAN  (虚拟局域网)

    ① 作用 

        隔离广播域,减小广播流量,提高网络性能。

    ② 优点

       分段,灵活性,安全性。

    ③ VLAN类型:

          基于端口的

          基于MAC 地址

          基于协议

          基于子网

注:创VLAN 前  要先 打  VLAN   da  (补全)

实验 

wKiom1eYGd6x6EbHAAA2g3CH3xY857.png-wh_50

SW1 

Switch>en

Switch#conf

Switch(config)#vl 10 

Switch(config-vlan)#vl 20 

Switch(config-vlan)#exi

Switch(config)#int f 0/2 

Switch(config-if)#switchport access vl 10 

Switch(config-if)#int f 0/3 

Switch(config-if)#switchport access vl 20 

Switch(config-if)#exi

Switch(config)#int f 0/1 

Switch(config-if)#switchport mode trunk 

Switch(config-if)#^Z

Switch#

SW2

Switch(config)#

Switch(config)#vl 10 

Switch(config-vlan)#vl 20 

Switch(config-vlan)#exi

Switch(config)#int f 0/2 

Switch(config-if)#switchport access vl 10 

Switch(config-if)#int f 0/3 

Switch(config-if)#switchport access vl 20 

Switch(config-if)#exi

Switch(config)#int f 0/1 

Switch(config-if)#switchport mode trunk 

Switch(config-if)#exi

Switch(config)#exi

Switch#

注:同一VLAN  ping



四   TRUNK  (干道模式)

    ①当一条链路,需要承载多VLAN    信息时,需要使用TRUNK 来实现。

     ② 让不同交换机上的相同VLAN之间能够通信

     注:打trunk 时要先封装



实验D单臂路由wKiom1eYGh7h1AycAAA7ixJzImQ796.png-wh_50

R1` 

Router>enable 

Router#conf

Router(config)#int f 0/0

Router(config-if)#no shu

Router(config-if)#int f 0/0.1 

Router(config-subif)#encapsulation dot1Q 10 

Router(config-subif)#ip add 192.168.1.254 255.255.255.0 

Router(config-subif)#no shu

Router(config-subif)#int f 0/0.2 

Router(config-subif)#encapsulation dot1Q 20 

Router(config-subif)#ip add 192.168.2.254 255.255.255.0 

Router(config-subif)#no shu

Router(config-subif)#

SW1

Switch>en

Switch#conf

Switch(config)#int f 0/3 

Switch(config-if)#switchport mode trunk 

Switch(config-if)#int f 0/2 

Switch(config-if)#switchport mode trunk 

Switch(config-if)#int f 0/1 

Switch(config-if)#switchport access vlan 10

Switch(config-if)#

SW2

Switch>enable 

Switch#conf

Switch(config)#int f 0/2 

Switch(config-if)#switchport mode trunk 

Switch(config-if)#int f 0/1 

Switch(config-if)#switchport mode access 

Switch(config-if)#switchport access vlan 20 

Switch(config-if)#


注:PC1 PING PC2 j_0046.gif


五   ISL (封装协议 )

注:思科私有



六   VTP 

 (1)    VTP(VLAN Trunking Protocol):虚拟局域网干道协议   VTP通过网络(ISL帧或cisco私有DTP帧)保持VLAN配置统一性。


      ①宣告VLAN 配置信息的信息系统  ② 通过一个共有的管理域,维持VLAN 配置信息的一致性   ③  VTP只能在主干端口发送宣告的信息  ④ 支持混合的介质主干连接 

   注:在交换机上管理整个局域网内的VLAN,用于同步VLAN信息.

   

(2)   VTP 三种模式

       服务器模式 (server)   :创建VLAN,修改VLAN,删除VLAN,发送/转发信息宣告 ,同步,存储于NYRAM中,(默认模式)

        客户机模式(client) :发送/转发信息宣告,不会存储NVRAM

        透明模式(Transparent):创建VLAN,修改VLAN,删除VLAN,转发,信息宣告,不同步,存储于NYRAM中