HCIP---VLAN综合实验

一.实验拓扑

二.实验要求

1.pc1和pc3所在接口为access;pvlan vlan2 ,pc2/4/5/6处于同一网段;其中PC2可以访问 PC4/5/6;
但pc4可以访问pc5不能访问pc6
2.pc5不能访问pc6
3.pc1/3与pc2/4/5/6不在一个网段
4.所有pc通过DHCP获取,pc1/3可以正常访问pc2/4/5/6

三.实验步骤

1.在三台交换机上分别创建VLAN

[sw1]vlan batch 2 to 5  
 
[sw2]vlan batch 2 to 5
 
[sw3]vlan batch 2 to 5

2.接口处划入Vlan

SW1:
 
[sw1]int g 0/0/1
[sw1-Ethernet0/0/1]port link-type access 
[sw1-Ethernet0/0/1]port default vlan 2
 
[sw1]int g 0/0/2
[sw1-Ethernet0/0/2]port hybrid pvid vlan 3
[sw1-Ethernet0/0/2]port hybrid untagged vlan 2 to 5
 
 
SW2:
 
[sw2]int g 0/0/1
[sw2-Ethernet0/0/1]port link-type access 
[sw2-Ethernet0/0/1]port default vlan 2
 
[sw2]int g 0/0/2
[sw2-Ethernet0/0/2]port hybrid pvid vlan 4
[sw2-Ethernet0/0/2]port hybrid untagged vlan 2 to 4
 
 
SW3:
 
 
[sw3]int g 0/0/1
[sw3-Ethernet0/0/1]port hybrid pvid vlan 4
[sw3-Ethernet0/0/1]port hybrid untagged vlan 2 to 4
 
[sw3]int g 0/0/2
[sw3-Ethernet0/0/2]port hybrid pvid vlan 5
[sw3-Ethernet0/0/2]port hybrid untagged vlan 2 3 5

3.trunk干道

SW1:
 
[sw1]int g 0/0/3
 
[sw1-Ethernet0/0/3]port link-type trunk 
   
[sw1-Ethernet0/0/3]port trunk allow-pass vlan all
 
 
SW2:
 
[sw2]int g 0/0/3
 
[sw2-Ethernet0/0/3]port link-type trunk 
   
[sw2-Ethernet0/0/3]port trunk allow-pass vlan all
 
 
[sw2]int g 0/0/4
 
[sw2-Ethernet0/0/4]port link-type trunk 
   
[sw2-Ethernet0/0/4]port trunk allow-pass vlan all
 
 
SW3:
 
[sw3]int g 0/0/3
 
[sw3-Ethernet0/0/3]port link-type trunk 
   
[sw3-Ethernet0/0/3]port trunk allow-pass vlan all

4.配置VLAN间路由器 

SW1
 
[sw1]int g 0/0/4	
[sw1-Ethernet0/0/4]port hybrid untagged vlan 3 to 5  
[sw1-Ethernet0/0/4]port hybrid tagged vlan 2
 
 
R1:
 
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
 
[r1]int g 0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 2
[r1-GigabitEthernet0/0/0.1]ip add 192.168.2.1 24
[r1-GigabitEthernet0/0/0.1]arp broadcast enable  
 
[r1]dhcp enable 
[r1]ip pool a
[r1-ip-pool-a]network 192.168.1.0  mask  24	 
[r1-ip-pool-a]gateway-list  192.168.1.1   
[r1-ip-pool-a]dns-list 114.114.114.114 8.8.8.8 
 
[r1]ip pool b
[r1-ip-pool-b]network 192.168.2.0 mask  24
[r1-ip-pool-b]gateway-list 192.168.2.1 	
[r1-ip-pool-b]dns-list 114.114.114.114 8.8.8.8  
 
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]dhcp select global 
[r1-GigabitEthernet0/0/0]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dhcp select global

四.实验验证 

LSW1:

LSW2:

LSW3:

 

PC2可以ping通PC6 

PC4/5不能ping通PC6

实验完成 

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值