思科交換機vlan的劃分

spokes發表於2020-10-25

在這裡插入圖片描述

Switch>enable    #進入特權模式
Switch#config terminal      #進入全域性配置
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 20   
Switch(config-vlan)#name VLAN20    #給vlan20起個名字
Switch(config-vlan)#end            #退回到配置模式
Switch#show vlan brief             #檢視vlan資訊

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/3, Fa0/4, Fa0/5, Fa0/6
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10
                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22
                                                Fa0/23, Fa0/24
10   vlan10                           active    Fa0/1, Fa0/2   #vlan10是我們剛才用圖形介面配置的
20   VLAN20                           active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
Switch#


Switch#config terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface range fastEthernet 0/3 - 4   #將0/3和0/4群組
Switch(config-if-range)#switchport mode access        #指定為access模式
Switch(config-if-range)#switchport access vlan 20     #將0/3和0/4批量加入到vlan20

Switch(config-if-range)#end
Switch#show vlan brief                                #檢視vlan資訊

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
10   vlan10                           active    Fa0/1, Fa0/2
20   VLAN20                           active    Fa0/3, Fa0/4
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
Switch#

相關文章