CCNA实验之--三层交换

       好长时间没写了,最近在预习NP的书,顺便回顾一下NA的实验吧。

 

 

CCNA实验之--三层交换_第1张图片

 

Switch1基本配置:

Switch>en

Switch#conf t

Switch(config)#hostname Switch1

Switch1(config)#vlan 10

Switch1(config-vlan)#name vlan_10

Switch1(config)#int fa0/1

Switch1(config-if)#switchport access vlan 20

Switch1(config-if)#switchport mode trunk

Switch1(config-if)#end

 

Switch2基本配置:

Switch>en

Switch#conf t

Switch(config)#hostname Switch2

Switch2(config)#vlan 20

Switch2(config-vlan)#name vlan_20

Switch2(config-vlan)#int fa0/1

Switch2(config-if)#switchport access vlan 20

Switch2(config-if)#switchport mode trunk

Switch2(config-if)#end

 

三层交换机上的配置:

Switch>en

Switch#conf t

Switch(config)#hostname Switch0

 

Switch0(config)#vlan 10

Switch0(config-vlan)#name vlan_10   

                                                   //注意,这里一定要创建vlan 10和vlan  20

Switch0(config-vlan)#vlan 20

Switch0(config-vlan)#name vlan _20

Switch0(config-vlan)#int vlan 10           //作为PC1的网关

Switch0(config-if)#ip address 192.168.10.254 255.255.255.0

Switch0(config-if)#int vlan 20                //作为PC2的网关

Switch0(config-if)#ip address 192.168.20.254 255.255.255.0

 

Switch0(config-if)#int fa0/1

Switch0(config-if)#switchport mode trunk

Switch0(config-if)#int fa0/2

Switch0(config-if)#switchport mode trunk

Switch0(config-if)#end

 

在三台交换机上验证配置,

Switch1#sh vlan brief

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, Gig1/1, Gig1/2
10   vlan_10                          active    Fa0/2
20   VLAN0020                         active   
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   

 

Switch2#sh vlan brief

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, Gig1/1, Gig1/2
20   vlan_20                          active    Fa0/2
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   

 

Switch0#sh vlan brief

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, Gig0/1, Gig0/2
10   vlan_10                          active   
20   vlan_20                          active   
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   

 

Switch0#sh int trunk
Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1
Fa0/2       on           802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/1       1-1005
Fa0/2       1-1005

Port        Vlans allowed and active in management domain
Fa0/1       1,10,20,1002,1003,1004,1005
Fa0/2       1,10,20,1002,1003,1004,1005

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1,10,20,1002,1003,1004,1005
Fa0/2       1,10,20,1002,1003,1004,1005

 

Switch0#sh ip route

【cut out】

Gateway of last resort is not set

C    192.168.10.0/24 is directly connected, Vlan10
C    192.168.20.0/24 is directly connected, Vlan20

 

 

验证连通性,

 

 

 

PC1可以与PC2通信,实验成功。

 

你可能感兴趣的:(职场,休闲,CCNA,三层交换)