DHCP的综合实验
需求
PC1、2、3、4,自动获得IP地址
且各个主机之间能互相通信
拓扑图
配置思路
配置DHCP客户端
配置DHCP服务器
配置DHCP中继
配置DHCP客户端和中继之间的交换网络
配置DHCP中继和服务器之间的路由网络
配置命令
AR ——DHCP服务器
设置为DHCP客户端设置DHCP服务器undoterminalmonitorsystem-viewsysnameDHCPdhcpenableippoolVLAN10network192.168.10.0mask24gateway-list192.168.10.254dns-list8.8.8.8leaseday10excluded-ip-address192.168.10.253quitippoolVLAN20network192.168.20.0mask24gateway-list192.168.20.254dns-list8.8.8.8leaseday20excluded-ip-address192.168.20.253quitinterfacegi0/0/0ipaddress192.168.66.124dhcpselectglobalquitiproute-static0.0.0.00192.168.66.254
注意: 默认路由不能丢,很多人都配置完成,却忘记了默认路由,主机始终获取不到IP地址
lsw1
lsw1:undoterminalmonitorsystem-viewsysnamelsw1vlanbatch102066dhcpenableinterfacevlanif10ipaddress192.168.10.25424dhcpselectrelaydhcprelayserver-ip192.168.66.1quitinterfacevlanif20ipaddress192.168.20.25424dhcpselectrelaydhcprelayserver-ip192.168.66.1quitinterfacevlanif66ipaddress192.168.66.25424
lsw2
undoterminalmonitorsystem-viewsysnamelsw2vlanbatch102066quitinterfaceEthernet0/0/1portlink-typeaccessportdefaultvlan10quitinterfaceEthernet0/0/2portlink-typeaccessportdefaultvlan10quitinterfaceGigabitEthernet0/0/1portlink-typetrunkporttrunkallow-passvlan2to4094quit
lsw3
undoterminalmonitorsystem-viewsysnamelsw3vlanbatch102066interfaceEthernet0/0/1portlink-typeaccessportdefaultvlan20quitinterfaceEthernet0/0/2portlink-typeaccessportdefaultvlan20quitinterfaceGigabitEthernet0/0/2portlink-typetrunkporttrunkallow-passvlan2to4094quit
验证