DHCP中继协议--原理,配置与验证

DHCP中继

一、原因

  1. DHCP服务器和终端不在同一个网络中,终端无法通过广播到达DHCP服务器,必须采用DHCP中继到达DHCP服务器。

二、原理

  1. 中继的核心问题是DHCP服务器地址与终端网关的单播通信的问题。

    SW1(config)#int vlan 10  
    SW1(config-if)# ip helper-address 172.16.1.100 
    

    注:环回接口 逻辑接口 只要设备不down,就不会down掉,所以服务器所连接的接口一般为环回接口

  2. 原理图:

    0.0.0.0-----255.255.255.255(广播到网关)
    10.1.10.254(网关)----10.1.30.253(DHCP服务器)  
    SVI网关将广播封装为单播,然后路由转发
    10.1.30.253----10.1.10.243
    10.1.10.254----255.255.255.255

三、配置

SW1(config)#int vlan 10
SW1(config-if)# ip helper-address 10.1.30.253
SW1(config)#do show run | s helper
ip helper-address 10.1.30.253
ip helper-address 10.1.30.253
ip helper-address 10.1.30.253

四、验证

1. 客户端验证

PC1#debug dhcp
PC1(config)#int e0/1
PC1(config-if)#shu
*Sep 22 16:11:41.383: DHCP: deleting entry B1C6F278 10.1.10.1 from list
*Sep 22 16:11:41.383: DHCP: Client socket is closed
PC1(config)#int e0/1
PC1(config-if)#no shu
*Sep 22 15:38:36.439: RAC: Starting DHCP discover on Ethernet0/
*Sep 22 15:38:36.453:  B'cast on Ethernet0/1 interface from 0.0.0.0
*Sep 22 15:38:38.461: DHCP: Received a BOOTREP pkt
*Sep 22 15:38:38.461: DHCP: offer received from 10.1.10.254
*Sep 22 15:38:38.461: DHCP: SRequest- Server ID option: 10.1.10.254
*Sep 22 15:38*Sep 22 15:38:38.462: DHCP: Received a BOOTREP pkt
*Sep 22 15:38:42.486: DHCP: Sending notification of ASSIGNMENT:
*Sep 22 15:38:42.486:   Address 10.1.10.2 mask 255.255.255.0
PC1#undebug all

 

你可能感兴趣的:(Computer,Network)