1. 做用:实现企业大量主机IP的动态配置和集中管理。 减小工做量,减小人为配置错误。 2. DHCP工做原理: a) 发现阶段---发送DHCP discover 报文 b) 提供阶段---服务器回应offer c) 选择阶段----发送request请求 报文 d) 确认阶段---服务器回应 ack确认
1.启用DHCP功能 2.配置IP POOL, 并排除已经被静态分配的地址 好比: 网关 、服务器IP、网络设备接口等 3. IP pool XX netework :X.X.X.X MASK 24 gateway-list: X.X.X.X DNS-list: X.X.X.X Excluded-ip-address:X.X.X.X X.X.X.X **DHCP中继:当DHCP客户端 与 DHCP 服务器不在同一个网段的时候, 咱们须要配置 DHCP 中继**
实验准备:服务器
[R1]dhcp enable
[R1]ip pool 20
[R1-ip-pool-20]network 192.168.20.0 mask 255.255.255.0
[R1-ip-pool-20]gateway-list 192.168.20.254
[R1-ip-pool-20]dns-list 8.8.8.8
[R1]ip pool 30
[R1-ip-pool-30]network 192.168.30.0 mask 255.255.255.0
[R1-ip-pool-30]gateway-list 192.168.30.254
[R1-ip-pool-30]dns-list 8.8.8.8
[R1]ip pool 40
[R1-ip-pool-40]network 192.168.40.0 mask 255.255.255.0
[R1-ip-pool-40]gateway-list 192.168.40.254
[R1-ip-pool-40]dns-list 8.8.8.8
[R1-GigabitEthernet0/0/0]ip add 192.168.88.1 24
[R1-GigabitEthernet0/0/0]dhcp select global
把VLAN加IP,设置DHCP中继模式
[H1]int vlan 20
[H1-Vlanif20]ip add 192.168.20.254 24
[H1-Vlanif20]dhcp select relay
[H1-Vlanif20]dhcp relay server-ip 192.168.88.1
[H1-Vlanif30] ip add 192.168.30.254 24
[H1-Vlanif30]dhcp select relay
[H1-Vlanif30]dhcp relay server-ip 192.168.88.1
[H1-Vlanif40]ip address 192.168.40.254 24
[H1-Vlanif40]dhcp select relay
[H1-Vlanif40]dhcp relay server-ip 192.168.88.1
[H1-Vlanif88]ip add 192.168.88.254 24
实验验证一:
打开pc1 pc2 pc3 运行:ipconfig:查看地址获取状况网络
实验验证二:验证主机间通讯ide