ensp-DHCP综合实验笔记

你是慕鸢呀~ 发布于 2022-06-04 124 次阅读 785 字 预计阅读时间: 4 分钟


内容目录

DHCP综合实验

实验目的

  1. DHCP服务器属于vlan 88
  2. 市场部、运营部、设计部分别属于 vlan 10 /20 /30
  3. 规划每个部门的网关
  4. PC端自动获取IP地址参数
  5. 每个vlan 的网段为192.168.xx.0/24(XX是vlan号)
  6. 所有PC之间互通

老师效果图

image-20220604190429815

配置思路

  1. DHCP客户端
  2. DHCP服务器
  3. 中继 (网关接口)
  4. 客户端和中继之间的交换网络
  5. 中继与服务器之间的路由网络
  6. 验证互通

实验步骤

1.搭建框架

image-20220604191713868

2.配置PC1 - PC6 IP为DHCP

image-20220604191611233

3.对ar1进行配置

开启DHCP全局,配置IP池  默认路由
sys
sys DHCP
un t m
dhcp enable
in g0/0/1
ip add 192.168.88.1 24
dhcp select global
ip policy-based-route
ip pool vlan-10
network 192.168.10.0 mask 24
gateway-list 192.168.10.254 
dns-list 8.8.8.8
ip pool vlan-20
network 192.168.20.0 mask 24    
gateway-list 192.168.20.254
dns-list 8.8.8.8
ip pool vlan-30
network 192.168.30.0 mask 24
gateway-list 192.168.30.254
dns-list 8.8.8.8
ip route-static 0.0.0.0 0 192.168.88.254

image-20220604194848655

4.配置交换机1 DHCP中继

开启DHCP 建立vlan 10 20 30 88 配置聚合链路 ip地址
sys
sys SW1
un in en 
dhcp enable
vlan batch 10 20 30 88 12
in g0/0/1
port link-type access
port default vlan 88
port-group group-member g0/0/2 g0/0/3 g0/0/4
port link-type trunk
port trunk allow-pass vlan all  
q
interface Vlanif 10
ip add 192.168.10.254 24
dhcp select relay 
dhcp relay server-ip 192.168.88.1

interface Vlanif 30
ip add 192.168.30.254 24
dhcp select relay 
dhcp relay server-ip 192.168.88.1

interface Vlanif 12
ip add 192.168.12.1 24

interface Vlanif 88
ip add 192.168.88.254 24

q
ip route-static 192.168.20.0 24 192.168.12.2

image-20220604195546149

image-20220604195611602

5.配置交换机2 SW2

sys
sys SW2
un in en 
dhcp enable
vlan batch 10 20 30 12
port-group group-member g0/0/2 g0/0/23
port link-type trunk
port trunk allow-pass vlan all
q
in g0/0/11
port link-type access
port default vlan 10
in g0/0/12
port link-type access
port default vlan 20
q
in Vlanif 20
ip add 192.168.20.254 24
dhcp select relay 
dhcp relay server-ip 192.168.88.1

in Vlanif 12
ip add 192.168.12.2 24
q
ip route-static 192.168.88.0 24 192.168.12.1
ip route-static 192.168.10.0 24 192.168.12.1
ip route-static 192.168.30.0 24 192.168.12.1
至于为什么是LSW5 而不是LSW2,那是因为我配错了中间不知道哪里,排错排了一个小时未果,就删了再来了一遍,直接通了,玄学!

image-20220604220530640

image-20220604220605533

image-20220604220630583

6.配置交换机3

un t m
sys
sys SW3
vlan batch 10 20 30
port-group group-member g0/0/3 g0/0/23 g 0/0/24
port link-type trunk
port trunk allow-pass vlan all
q
in g0/0/13
port link-type access
port default vlan 10
in g0/0/14
port link-type access
port default vlan 30

image-20220604221021280

image-20220604221059021

7.配置交换机4

un t m 
sys
sys SW4
vlan batch 10 20 30
port-group group-member g0/0/4 g0/0/24
port link-type trunk
port trunk allow-pass vlan all
q
in g0/0/15
port link-type access
port default vlan 20
in g0/0/16
port link-type access
port default vlan 30

image-20220604221129524

image-20220604221150331

下面是PC1-PC6的截图

image-20220604221311585

image-20220604221335979

image-20220604221406755

image-20220604221426249

image-20220604221451952

image-20220604221515818

下面是PC1 ping通PC2-PC6的截图

image-20220604221731377

image-20220604221819244

image-20220604221925000

image-20220604222009927

image-20220604222047265

image-20220604222155658

到这里这个实验就结束了!,下面是最终成果图

image-20220604222303545

我本桀骜少年臣,不信鬼神不信人。
最后更新于 2022-06-04