一、DHCP背景
DHCP 服务可为主机自动分配 IP 地址,省去手动静态配置IP地址的麻烦,有效动态分配IP地址
二、 拓扑
三、DHCP配置
R1 为 DHCP 服务器,和 R2 同属于 VLAN 10,R3 属于 VLAN 20。R1、R2 模拟成 PC 机首先进行基本配置R2 上的配置
Router>en
Router#conf t
Router(config)#hostname r2
R2(config)#no ip routing /关闭路由器路由功能,模拟成 PC 机
R2(config)#int e0/0
R2(config-if)#ip add dhcp
R2(config-if)#no shutdown
R3 上的配置
Router>en
Router#conf t
Router(config)#hostname r3
R3(config)#no ip routing
R3(config)#int e0/0
R3(config-if)#ip add dhcp
R3(config-if)#no shutdown
sw1 上的配置
sw1#conf t
sw1(con