CCNA实验七 VLAN

文章目录

  • 实验内容
  • 实验环境
  • 实验内容
  • 测试

实验内容

VLAN划分

实验环境

[外链图片转存失败(img-xFRJU0vP-1563713668879)(C:\Users\gj\AppData\Roaming\Typora\typora-user-images\1563603240793.png)]

实验内容

PC3

VPCS> ip 10.1.1.3 255.255.255.0 10.1.1.254
Checking for duplicate address...
PC1 : 10.1.1.3 255.255.255.0 gateway 10.1.1.254

PC4

VPCS> ip 20.1.1.4 255.255.255.0 20.1.1.254
Checking for duplicate address...
PC1 : 20.1.1.4 255.255.255.0 gateway 20.1.1.254

PC5

VPCS> ip 20.1.1.5 255.255.255.0 20.1.1.254
Checking for duplicate address...
PC1 : 20.1.1.5 255.255.255.0 gateway 20.1.1.254

PC6

VPCS> ip 10.1.1.6 255.255.255.0 10.1.1.254
Checking for duplicate address...
PC1 : 10.1.1.6 255.255.255.0 gateway 10.1.1.254

SW1

Switch>en
Switch#configure t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name IT
Switch(config-vlan)#VLAN
Switch(config-vlan)#VLAN 20
Switch(config-vlan)#NAME SALES
Switch(config-vlan)#END
Switch#show vlan b
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/0, Et0/1, Et0/2, Et0/3
10   IT                               active    
20   SALES                            active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 

Switch(config)#int e 0/2
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 20

Switch(config)#int e 0/1
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 10

Switch(config)#int e 0/0
Switch(config-if)#switchport trunk encapsulation do
Switch(config-if)#switchport trunk encapsulation dot1q 
Switch(config-if)#
*Jul 20 12:18:57.045: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to down
*Jul 20 12:18:58.049: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0/0, changed state to up
Switch(config-if)#switchport mode trunk 
Switch(config-if)#end

SW2

Switch>en
Switch#show vlan b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/0, Et0/1, Et0/2, Et0/3
10   IT                               active    
20   sales                            active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup 
Switch#configure t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int e 0/1
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit

Switch(config)#int e 0/2
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 20
Switch(config-if)#end

Switch(config)#int e 0/0
Switch(config-if)#switchport trunk encapsulation do
Switch(config-if)#switchport mode trunk 
Switch(config-if)#end

测试

PC5 PING PC4

VPCS> ping 20.1.1.4

84 bytes from 20.1.1.4 icmp_seq=1 ttl=64 time=0.714 ms
84 bytes from 20.1.1.4 icmp_seq=2 ttl=64 time=1.331 ms
84 bytes from 20.1.1.4 icmp_seq=3 ttl=64 time=1.073 ms
84 bytes from 20.1.1.4 icmp_seq=4 ttl=64 time=1.421 ms
84 bytes from 20.1.1.4 icmp_seq=5 ttl=64 time=1.240 ms

你可能感兴趣的:(训练中的网工)