H3C DHCP Relay配置

H3C DHCP Relay配置

由于在IP地址动态获取过程中采用广播方式发送请求报文,因此DHCP只适用于DHCP客户端和服务器处于同一个子网内的情况。DHCP中继功能就解决了客户端可以通过DHCP中继与其他网段的DHCP服务器通信,最终获取到IP地址。

本篇介绍以Windows Server 2019作为DHCP服务器,H3C交换机配置DHCP Relay到服务器上为客户端分配地址方法,Relay agent地址务必要与服务器互通。

拓扑图:

DHCP_Server(192.168.1.200) --------- 核心交换机(192.168.1.100) ----------- 终端

核心交换机地址:192.168.1.100,服务器网卡地址:192.168.1.200。

DHCP服务器配置:

在这里插入图片描述

H3C交换机基本配置:

[H3C]vlan 10 to 30 
[H3C]interface  Vlan-interface 1
[H3C-Vlan-interface1]ip address  192.168.1.100 24
[H3C-Vlan-interface1]quit
[H3C]interface  Vlan-interface 10
[H3C-Vlan-interface10]ip address 172.16.10.254 24
[H3C-Vlan-interface10]interface  Vlan-interface 20
[H3C-Vlan-interface20]ip address 172.16.20.254 24 
[H3C-Vlan-interface20]interface  Vlan-interface 30
[H3C-Vlan-interface30]ip address 172.16.30.254 24 
[H3C-Vlan-interface30]quit

H3C交换机DHCP Relay配置:

[H3C]dhcp enable      #开启DHCP功能
[H3C]interface  Vlan-interface 10
[H3C-Vlan-interface10]dhcp select relay 
[H3C-Vlan-interface10]dhcp relay server-address 192.168.1.200    #可以配置多个服务器
[H3C-Vlan-interface10]quit
[H3C]interface Vlan-interface 20
[H3C-Vlan-interface20]dhcp select relay 
[H3C-Vlan-interface20]dhcp relay server-address 192.168.1.200
[H3C-Vlan-interface20]quit
[H3C]interface Vlan-interface 30
[H3C-Vlan-interface30]dhcp select relay 
[H3C-Vlan-interface30]dhcp relay server-address 192.168.1.200
[H3C-Vlan-interface30]quit

交换机debugging日志:

From 0.0.0.0 port 68, interface Vlan-interface10
    Message type: REQUEST (1)
    Hardware type: 1, Hardware address length: 6
    Hops: 0, Transaction ID: 484277912
    Seconds: 0, Broadcast flag: 1
    Client IP address: 0.0.0.0   Your IP address: 0.0.0.0
    Server IP address: 0.0.0.0   Relay agent IP address: 0.0.0.0
    Client hardware address: 3cf5-ccbd-09ed
    Server host name: not configured
    Boot file name: not configured
    DHCP message type: DHCPREQUEST (3)
*Jan  1 00:35:02:369 2013 H3C DHCPR/7/PACKET: 
To 192.168.1.200 port 67, interface is selected by routing table
    Message type: REQUEST (1)
    Hardware type: 1, Hardware address length: 6
    Hops: 1, Transaction ID: 484277912
    Seconds: 0, Broadcast flag: 1
    Client IP address: 0.0.0.0   Your IP address: 0.0.0.0
    Server IP address: 0.0.0.0   Relay agent IP address: 172.16.10.254      #Relay agent地址务必要与服务器互通。
    Client hardware address: 3cf5-ccbd-09ed
    Server host name: not configured
    Boot file name: not configured
    DHCP message type: DHCPREQUEST (3)
*Jan  1 00:35:02:374 2013 H3C DHCPR/7/PACKET: 
From 192.168.1.200 port 67, interface Vlan-interface10
    Message type: REPLY (2)
    Hardware type: 1, Hardware address length: 6
    Hops: 0, Transaction ID: 484277912
    Seconds: 0, Broadcast flag: 1
    Client IP address: 0.0.0.0   Your IP address: 172.16.10.10            #客户端获取的到的地址
    Server IP address: 0.0.0.0   Relay agent IP address: 172.16.10.254
    Client hardware address: 3cf5-ccbd-09ed
    Server host name: not configured
    Boot file name: not configured
    DHCP message type: DHCPACK (5)
*Jan  1 00:35:02:375 2013 H3C DHCPR/7/PACKET: 
To 255.255.255.255 port 68, interface Vlan-interface10
    Message type: REPLY (2)
    Hardware type: 1, Hardware address length: 6
    Hops: 0, Transaction ID: 484277912
    Seconds: 0, Broadcast flag: 1
    Client IP address: 0.0.0.0   Your IP address: 172.16.10.10
    Server IP address: 0.0.0.0   Relay agent IP address: 172.16.10.254
    Client hardware address: 3cf5-ccbd-09ed
    Server host name: not configured
    Boot file name: not configured
    DHCP message type: DHCPACK (5)

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

zdl244

你的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值