SW1

Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

Switch(config)#hostname R1

R1(config)#line console 0

R1(config-line)#logging synchronous 

R1(config-line)#exec-timeout 00
R1(config-line)#end

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#vlan 2
R1(config-vlan)#name caiwu

R1(config-vlan)#vlan 3
R1(config-vlan)#name it
R1(config-vlan)#end
 
R1(config)#interface range fastEthernet 0/1-2

R1(config-if-range)#switchport mode access 

R1(config-if-range)#switchport access vlan 2
R1(config-if-range)#exit

R1(config)#interface range fastEthernet 0/3-5

R1(config-if-range)#switchport mode access 

R1(config-if-range)#switchport access vlan 3
R1(config-if-range)#exit
R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#show vlan brief 

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    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, Gig0/1
                                                Gig0/2
2    caiwu                            active    Fa0/1, Fa0/2
3    it                               active    Fa0/3, Fa0/4, Fa0/5
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active    
R1#

 

posted on 2018-07-31 17:31  彼de潘  阅读(198)  评论(0编辑  收藏  举报