HCIP的vlan的实验

目录

1.题型及要求

 2.拓扑

 3.在sw1上的配置

3.1创建vlan

3.2 pc2,4,5,6用hybird

3.3在sw2上的配置

3.4trunk

3.5DHCP

4.演示


1.题型及要求

HCIP的vlan的实验_第1张图片

 2.拓扑

HCIP的vlan的实验_第2张图片

 3.在sw1上的配置

3.1创建vlan

[sw1]vlan batch 2 to 6
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access 
[sw1-Ethernet0/0/1]port default vlan 2
[sw1]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access 
[sw1-Ethernet0/0/3]port default vlan 2

3.2 pc2,4,5,6用hybird

[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port hybrid pvid vlan 3
[sw1-Ethernet0/0/2]port hybrid untagged vlan 2 to 6
 
[sw1-Ethernet0/0/2]int e0/0/4
[sw1-Ethernet0/0/4]port hybrid pvid vlan 4
[sw1-Ethernet0/0/4]port hybrid untagged vlan 2 to 4

3.3在sw2上的配置

[sw2]int e0/0/1
[sw2-Ethernet0/0/1]port hybrid pvid vlan 5
[sw2-Ethernet0/0/1]port hybrid untagged vlan 2 3 5
[sw2-Ethernet0/0/1]int e0/0/2
[sw2-Ethernet0/0/2]port hybrid pvid vlan 6
[sw2-Ethernet0/0/2]port hybrid untagged vlan 2 3 6

3.4trunk

[sw1-Ethernet0/0/4]int e0/0/5
[sw1-Ethernet0/0/5]port hybrid tagged vlan 2 to 6	
[sw1-Ethernet0/0/5]int e0/0/6
[sw1-Ethernet0/0/6]port hybrid tagged vlan 2
[sw1-Ethernet0/0/6]port hybrid untagged vlan 3 to 6 

[sw2-Ethernet0/0/3]port hybrid tagged vlan 2 to 6

3.5DHCP

[r1]dhcp enable 
[r1]ip pool v2
[r1-ip-pool-v2]network 192.168.1.0 mask 24
[r1-ip-pool-v2]gateway-list 192.168.1.250
[r1]ip pool v3to6
[r1-ip-pool-v3to6]network 192.168.2.0 mask 24
[r1-ip-pool-v3to6]gateway-list 192.168.2.250
vlan2加标签
[r1]int g0/0/0.1 
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]ip add 192.168.1.250 24
[r1-GigabitEthernet0/0/0.1]arp broadcast enable 
[r1-GigabitEthernet0/0/0.1]dhcp select global 
 
vlan3到6不加标签
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.2.250 24
[r1-GigabitEthernet0/0/0]dhcp select global 

4.演示

 pc1/3能访问2456

HCIP的vlan的实验_第3张图片

 pc4不能访问56

HCIP的vlan的实验_第4张图片

你可能感兴趣的:(网络,运维,linux)