第六章:交换技术实验

一.实验拓扑

二.实验要求:

 1.全网可达

2.使用dhcp获取ip地址

三.实验思路:
1、在各个交换机上创建vlan
2、将接口加入相应vlan,并配置端口的链路模式
3、在trunk干道上放行vlan
4、配置路由器子接口
5、配置DHCP地址池,并测试
 

四.实验步骤:

步骤1:创建vlan划分接口

[SW1]vlan b    
[SW1]vlan batch 2 to 3
vlan 2
[SW2-vlan2]vlan 3
[SW3]vlan batch 2 to 3
[SW1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 2
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]port link-type access 
[SW1-Ethernet0/0/3]port default vlan 3
[SW2]int e0/0/3
[SW2-Ethernet0/0/3]port link-type access
[SW2-Ethernet0/0/3]port default vlan 2
[SW2-Ethernet0/0/3]int e0/0/4
[SW2-Ethernet0/0/4]port li    
[SW2-Ethernet0/0/4]port link-ty    
[SW2-Ethernet0/0/4]port link-type access
[SW2-Ethernet0/0/4]port  de    
[SW2-Ethernet0/0/4]port  default  vlan 3
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 2
[SW3-Ethernet0/0/3]port link-type access
[SW3-Ethernet0/0/3]port default vlan 3
[SW1-Ethernet0/0/1]port link-type trunk 

[SW1-Ethernet0/0/1]port trunk allow-pass vlan 2 3
[SW2-Ethernet0/0/2]port link-type trunk 
[SW2-Ethernet0/0/2]port trunk allow-pass vlan 2 3
[SW2-Ethernet0/0/1]port link-type trunk 
[SW2-Ethernet0/0/1]port trunk allow-pass vlan 2
[SW3-Ethernet0/0/1]port link-type trunk 
[SW3-Ethernet0/0/1]port trunk allow-pass vlan 2 3
[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]ip add 192.168.1.254 24
[R1-GigabitEthernet0/0/0.2]dot    
[R1-GigabitEthernet0/0/0.2]dot1q  t    
[R1-GigabitEthernet0/0/0.2]dot1q  termination vid 2
[R1-GigabitEthernet0/0/0.2]arp broadcast  enable 
[R1-GigabitEthernet0/0/0.3]ip add 192.168.2.254 24
[R1-GigabitEthernet0/0/0.3]dot1q termination  vid 3

[R1-GigabitEthernet0/0/0.3]arp broadcast enable 
[R1-GigabitEthernet0/0/1.2]ip add 192.168.3.254 24
[R1-GigabitEthernet0/0/1.2]dot1q termination vid 2
[R1-GigabitEthernet0/0/1.2]arp broadcast enable 
[R1-GigabitEthernet0/0/1.3]ip add 192.168.4.254 24
[R1-GigabitEthernet0/0/1.3]dot1q  termination vid 3
[R1-GigabitEthernet0/0/1.3]arp broadcast  enable 
 

步骤2:配置DHCP服务

[R1]ip pool aa

[R1-ip-pool-aa]net    
[R1-ip-pool-aa]network 192.168.1.0 mas    
[R1-ip-pool-aa]network 192.168.1.0 mask 24
[R1-ip-pool-aa]g    
[R1-ip-pool-aa]gateway-list 192.168.1.254
[R1-ip-pool-aa]d    
[R1-ip-pool-aa]dn    
[R1-ip-pool-aa]dns-list  8.8.8.8
[R1-ip-pool-aa]quit

[R1]int g0/0/0.2
[R1-GigabitEthernet0/0/0.2]dhcp    
[R1-GigabitEthernet0/0/0.2]dhcp s    
[R1-GigabitEthernet0/0/0.2]dhcp select g    
[R1-GigabitEthernet0/0/0.2]dhcp select global 
[R1-GigabitEthernet0/0/0.2]quit
[R1]ip pool bb
[R1-ip-pool-bb]net    
[R1-ip-pool-bb]netw    
[R1-ip-pool-bb]network 192.168.2.0 mask 24
[R1-ip-pool-bb]g    
[R1-ip-pool-bb]gateway-list 192.168.2.254
[R1-ip-pool-bb]dns    
[R1-ip-pool-bb]dns-list 8.8.8.8
[R1-ip-pool-bb]quit
[R1]int g0/0/0.3
[R1-GigabitEthernet0/0/0.3]dhcp select global
[R1-GigabitEthernet0/0/0.3]quit
[R1]ip pool cc
[R1-ip-pool-cc]ntew    
[R1-ip-pool-cc]net    
[R1-ip-pool-cc]netw    
[R1-ip-pool-cc]network 192.168.3.0 mask 24
[R1-ip-pool-cc]g    
[R1-ip-pool-cc]gateway-list 192.168.3.254
[R1-ip-pool-cc]dns    
[R1-ip-pool-cc]dns-list 8.8.8.8
[R1-ip-pool-cc]quit
[R1]int g0/0/1.2
[R1-GigabitEthernet0/0/1.2]dhcp s    
[R1-GigabitEthernet0/0/1.2]dhcp select g    
[R1-GigabitEthernet0/0/1.2]dhcp select global 
[R1-GigabitEthernet0/0/1.2]quit
[R1]ip pool dd
[R1-ip-pool-dd]netw    
[R1-ip-pool-dd]network 192.168.4.0 mask 24
[R1-ip-pool-dd]g    
[R1-ip-pool-dd]gateway-list 192.168.4.254
[R1-ip-pool-dd]dns    
[R1-ip-pool-dd]dns-list 8.8.8.8
[R1-ip-pool-dd]quit
[R1]int g0/0/1.3
[R1-GigabitEthernet0/0/1.3]dhcp s    
[R1-GigabitEthernet0/0/1.3]dhcp select g    
[R1-GigabitEthernet0/0/1.3]dhcp select global 
 

步骤3:测试

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值