1. 作用:实现企业大量主机IP的动态配置和集中管理。减少工作量,减少人为配置错误。
2. DHCP工作原理:
a) 发现阶段---发送DHCP discover 报文
b) 提供阶段---服务器回应offer
c) 选择阶段----发送request请求 报文
d) 确认阶段---服务器回应 ack确认
实验准备:
[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:查看地址获取情况
实验验证二:验证主机间通信
原文地址:http://blog.51cto.com/8149087/2114163