dhcp客户端的配置过程:
PC ------ DHCPDISCOVER -----> SERVER 广播
PC <----- DHCPOFFER ------ SERVER 广播 (之前ICMP地址池检查ip是否冲突)
PC ------ DHCPREQUST -----> SERVER 广播
PC <----- DHCPACK ------ SERVER 广播
help-address的说明:
help-address 缺省转发的8个udp服务:time37 , tacacs49 , dns53 , boot/dhcp服务器67 , boot/dhcp客户端68 , tftp69 , netbios名字服务137, netbios数据报服务138 。
除此之外,可以用全局命令 ip forward-protocol udp 端口号 来转发任意端口。
ip help-address 172.16.1.255 用于指定一个网段的ip(服务器网段)
前提是打开接口下的 ip directed-broadcast
Current configuration : 983 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname DHCP-SERVER
!
!
ip subnet-zero
!
!
ip dhcp excluded-address 192.168.1.1 192.168.1.10 //不用于动态地址分配的地址
!
ip dhcp pool cisco
network 192.168.1.0 255.255.255.0 //为所有客户机动态分配的地址段
dns-server 210.34.120.3 //为客户机配置DNS服务器
domain-name laoda.qd.com //为客户机配置域后缀
netbios-name-server 192.168.1.1
default-router 192.168.1.1 //为客户机配置默认的网关
lease 10 10 10 //配置地址租用期
!
interface Serial1/1
ip address 10.1.12.1 255.255.255.0
serial restart-delay 0
!
router eigrp 100
network 10.1.12.0 0.0.0.255
network 192.168.1.0
no auto-summary
!
RELAY#show run
Building configuration...
Current configuration : 770 bytes
!
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname RELAY
!
!
ip subnet-zero
!
interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
ip helper-address 10.1.12.1
duplex auto
speed auto
!
interface Serial1/0
ip address 10.1.12.2 255.255.255.0
serial restart-delay 0
!
!
router eigrp 100
network 10.1.12.0 0.0.0.255
network 192.168.1.0
no auto-summary
!
ip classless
ip http server
!
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
!
end
PC#show run int fa0/0
Building configuration...
Current configuration : 75 bytes
!
interface FastEthernet0/0
ip address dhcp
duplex auto
speed auto
end
相关的DHCP调试命令:
no service dhcp //停止DHCP服务[默认为启用DHCP服务]
sh ip dhcp binding //显示地址分配情况
show ip dhcp conflict //显示地址冲突情况
debug ip dhcp server {events | packets | linkage} //观察DHCP服务器工作情况