<!-- wp:quote -->

<p>NA阶段DHCP最后一节</p>
<!-- /wp:quote --> <!-- wp:more --> <!-- /wp:more --> <!-- wp:tadv/classic-paragraph --> <h1>DHCP中继是什么</h1> <!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <p></p> <!-- /wp:tadv/classic-paragraph --> <!-- wp:paragraph --> <p> 由于在IP地址动态获取过程中采取广播方式发送报文,一般情况下DHCP只适用于DHCP Client和Server处于同一个子网内的情况,DHCP Relay功能的引入解决了这一局限。Client可以通过DHCP中继与其他子网中的DHCP Server通信,最终获得IP地址。 </p> <!-- /wp:paragraph --> <!-- wp:tadv/classic-paragraph --> <h1>如何配置</h1> <!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <p></p> <!-- /wp:tadv/classic-paragraph --> <!-- wp:paragraph --> <p>在AR1上先创建一个地址池:</p> <!-- /wp:paragraph --> <!-- wp:tadv/classic-paragraph -->
ip pool DHCP-Relay
 gateway-list 192.168.1.254 
 network 192.168.1.0 mask 255.255.255.0 
 lease day 8 hour 8 minute 0 
 dns-list 8.8.8.8 
 domain-name yuanpeng666.top

<p>我们再AR1上面的地址池创建好之后,我们要给AR1的G0/0/0口设置为 global 的DHCP:</p>

[AR1-GigabitEthernet0/0/0]dhcp  select  global 
<!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <h2>方法一</h2> <!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <p>然后把AR1和AR2的基础IP自行配置好,这里就不赘述了,主要看AR2的中继配置了:</p>
interface GigabitEthernet0/0/0
 ip address 192.168.1.254 255.255.255.0 
 dhcp select relay
 dhcp relay server-ip 192.168.12.22

<p>最重要的是这个时候由于PC1是发送广播包来请求这个DHCP服务的,到了AR1但是AR1没有192.168.1.0网段的路由表,没法回包,所以我们要给AR1一个静态路由:</p>

ip route-static 192.168.1.0 255.255.255.0 192.168.12.1
<!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <p>测试一下:</p> <p></p> <!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <h2>方法二</h2> <!-- /wp:tadv/classic-paragraph --> <!-- wp:tadv/classic-paragraph --> <p>然后把AR1和AR2的基础IP自行配置好,这里就不赘述了,主要看AR2的中继配置了:</p> <p>现在AR2上面创建一个组:</p>
dhcp server group DHCP-Relay 
 dhcp-server 192.168.12.22 0

<p>再将接口绑定</p>

interface GigabitEthernet0/0/0
 ip address 192.168.1.254 255.255.255.0 
 dhcp select relay
 dhcp relay server-select DHCP-Relay

<p>测试:</p>
<p></p>
<!-- /wp:tadv/classic-paragraph -->

<!-- wp:paragraph -->
<p>喜欢的话点赞打赏支持一下吧(╹▽╹)</p>
<!-- /wp:paragraph -->

最后修改:2020 年 02 月 28 日 06 : 51 PM
请俺喝杯咖啡呗