CCNA ---LAB6

一.实验目的

  • 掌握trunk的配置
  • 掌握VTP基本操作、
  • 理解VTP角色之间的区别

二.拓扑与需求

拓扑:

 

需求:

1.MSW1和SW2之间的线路需配置为Trunk,采用Dot1q封装协议
2.MSW1和SW2上创建VLAN 10、20,MSW1 配置SVI 10的IP为192.168.10.254,SVI 20的IP为192.168.20.254,作为PC1和PC2的网关,SW2将接口E0/1划分到VLAN 10,E0/2划分到VLAN 20
3.在MSW1上配置两个DHCP地址池,地址池名Produce,分发地址范围192.168.10.0/24,网关为192.168.10.254,DNS地址为114.114.114.114,要求下发IP地址时不允许下发192.168.10.254;地址池名Office,分发地址范围192.168.20.0/24,网关为192.168.20.254,DNS地址为114.114.114.114,要求下发IP地址时不允许下发192.168.20.254



三.配置与实现

1.MSW1和SW2之间的线路需配置为Trunk,采用Dot1q封装协议

 MSW1

MSW1(config)#interface ethernet 0/0
MSW1(config-if)#switchport trunk encapsulation dot1q 
MSW1(config-if)#switchport mode trunk 

 

SW2

sw2(config)#int e0/0
sw2(config-if)#switchport trunk encapsulation dot1q                                                                                                                             sw2(config-if)#switchport mo t                                                                                                                                                                                                                   

2.MSW1和SW2上创建VLAN 10、20,MSW1 配置SVI 10的IP为192.168.10.254,SVI 20的IP为192.168.20.254,作为PC1和PC2的网关,SW2将接口E0/1划分到VLAN 10,E0/2划分到VLAN 20

MSW1

MSW1(config)#vlan 10,20
MSW1(config-vlan)#interface vlan 10
MSW1(config-if)#ip address 192.168.10.254 255.255.255.0
MSW1(config-if)#no shutdown 
MSW1(config-if)#interface vlan 20
MSW1(config-if)#ip address 192.168.20.254 255.255.255.0
MSW1(config-if)#no shutdown 

SW2

SW2(config)#interface ethernet 0/1
SW2(config-if)#switchport mode access 
SW2(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
SW2(config-if)#interface ethernet 0/2
SW2(config-if)#switchport mode access 
SW2(config-if)#switchport access vlan 20
% Access VLAN does not exist. Creating vlan 20

3.在MSW1上配置两个DHCP地址池,地址池名Produce,分发地址范围192.168.10.0/24,网关为192.168.10.254,DNS地址为114.114.114.114,要求下发IP地址时不允许下发192.168.10.254;地址池名Office,分发地址范围192.168.20.0/24,网关为192.168.20.254,DNS地址为114.114.114.114,要求下发IP地址时不允许下发192.168.20.254

MSW1

MSW1(config)#ip dhcp pool Produce
MSW1(dhcp-config)#network 192.168.10.0 /24
MSW1(dhcp-config)#default-router 192.168.10.254
MSW1(dhcp-config)#dns-server 114.114.114.114
MSW1(config)#ip dhcp pool Office
MSW1(dhcp-config)#network 192.168.20.0 /24                     
MSW1(dhcp-config)#default-router 192.168.20.254
MSW1(dhcp-config)#dns-server 114.114.114.114


MSW1(config)#ip dhcp excluded-address 192.168.10.254
MSW1(config)#ip dhcp excluded-address 192.168.20.254

pc

PC1(config)#interface ethernet 0/1
PC1(config-if)#ip address dhcp
PC1(config-if)#no shutdown 


PC2(config)#interface ethernet 0/2
PC2(config-if)#ip address dhcp
PC2(config-if)#no shutdown 

最后在PC上查看IP信息即可

 


实验结束

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值