51.2. 三层交换机上的配置

交换机详细图解

  .-------------------------------------+
 /           华为s3526c                /|
+---+---+---+----------------------+--+ |
| 1 | 3 | 5 |   ...                |23| |
+--+---+---+--------------- -------+--+ |       
| 2| 4 | 6 |    ...                |24|/ 
+---+---+---+----------------------+-+     
                                    | trunk     +------------------+
                                    ------------| Hi-Spider Router |-------- 二层交换机 ---- 客户机
                                      802.1q    +------------------+       
                                             
     
     
  1. 由于有20条ADSL需要接入,故需要在三层交换机上划分20个VLAN,每个VLAN中只包括一个端口,每个端口与一根ADSL相连。以华为s3526c为例,交换机配置如下所示:

    
    #
    interface Aux0/0
    #
    interface Ethernet0/1
     
    #
    interface Ethernet0/2
      port access vlan 2
    #
    interface Ethernet0/3
      port access vlan 3
    #
    interface Ethernet0/4
      port access vlan 4
    #
    interface Ethernet0/5
      port access vlan 5
    #
    interface Ethernet0/6
       port access vlan 6
    #
    interface Ethernet0/7
      port access vlan 7
    #
    interface Ethernet0/8
     port access vlan 8
    #
    interface Ethernet0/9
     port access vlan 9
    #
    interface Ethernet0/10
     port access vlan 10
    #
    interface Ethernet0/11
     port access vlan 11
    #
    interface Ethernet0/12
     port access vlan 12
    #
    interface Ethernet0/13
     port access vlan 13
    #
    interface Ethernet0/14
     port access vlan 14
    #
    interface Ethernet0/15
     port access vlan 15
    #
    interface Ethernet0/16
     port access vlan 16
    #
    interface Ethernet0/17
     port access vlan 17
    #
    interface Ethernet0/18
     port access vlan 18
    #
    interface Ethernet0/19
     port access vlan 19
    #
    interface Ethernet0/20
     port access vlan 20
    #
    interface Ethernet0/21
     
    #
    interface Ethernet0/22
     
    #
    interface Ethernet0/23
     
    #
    interface Ethernet0/24
     
    #
    interface GigabitEthernet1/1
    #
    interface NULL0
    
           
           
           
  2. 连接交换机与路由器

    这里用24号端口与海蜘蛛路由WAN接口相连,24号端口不需要划入任何VLAN,默认属于VLAN1即可。

    交换机上24号端口的配置:

            #
            interface Ethernet0/24
            port link-type trunk
            port trunk permit vlan all
            dot1x