实验环境:华为模拟器

Juzi_20180202200146279.png

1.给交换机1添加vlan10,VLAN20,

     vlan 10

 quit

Vlan 20

 Quit

 Interface g0/0/1

    Port link-type access

    Port   default vlan 10

    Quit

   Interface   g0/0/2

Port   link-type access

  Port access vlan 20

 配置三层交换机2

  vlan   10

Quit

Vlan 20

Quit

    interface g0/0/1

     Port link-type access

     Port default vlan 10

Quit

Intface   g0/0/2

Port   link-type  access

Port   default vlan 20

Quit

3,配置trunk 链路

   在交换机2上,

     Interface g0/0/24

      Port link-type trunk

      Port trunk allow-pass vlan all

   在交换机1上

     Interface g0/0/24

     Port link-type trunk

Port   trunk  allow-paas vlan

4,验证:ping192.168.10.2

配置 Trunk链路思路:(华为)
     1、配置端口的链路类型
         interface(端口)
      port link-type trunk
     2、设置 Trunk 链路上允许通过的 VLAN
         interface (端口)
      port trunk allow-pass vlan all 

配置access思路

华为交换机配置 VLAN :

     1、创建VLAN

           [sw1]vlan 10    //创建一个VLAN,并进入 VLAN 10 ;

           [sw1-vlan10]description AAA // 为vlan配置一个名字;

     2、配置端口模式

           [sw1]interface gi0/0/1

           [sw1-gi0/0/1]port link-type access //指定端口为access模式           

     3、将端口放入指定的 VLAN

           [sw1]interface gi0/0/1

           [sw1-gi0/0/1]port default vlan 10 //将端口放入vlan10


  3、查看
      display port vlan