---
title: DHCP Relay
slug: aidc/dhcp-relay
createdAt: 2025-12-29T10:28:22.830Z
---

DHCP (Dynamic Host Configuration Protocol) Relay.

## <font color="#1d50a2">URLs Summary</font>

| **URL**                                                            | **GET** | **POST** | **PATCH** | **PUT** | **DELETE** |
| ------------------------------------------------------------------ | ------- | -------- | --------- | ------- | ---------- |
| /rest/v1/running/dhcp-relay/&#x7B;name}                            | Y       | Y        | Y         | N       | Y          |
| /rest/v1/running/dhcp-relay/&#x7B;name}/downlink-vlans/&#x7B;vlan} | Y       | Y        | N         | N       | Y          |
| /rest/v1/rpc/show-dhcp-relay                                       | N       | Y        | N         | N       | N          |

## <font color="#1d50a2">Examples</font>

### <font color="#1d50a2">Create a DHCP relay instance.</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/dhcp-relay
{
    "name": "test1",
    "type": "v4",
    "vrf": "Vrf1",
    "downlink-vlans": [
        {"vlan": "Vlan100", "option82-sub5": "100.0.0.1"},
        {"vlan": "Vlan300", "gateway-ip-address": "3.3.3.4"},
    ],
    "uplink-interfaces": ["Vlan200"],
    "server-ips": ["12.3.3.3", "15.3.3.3"]
}
```

### <font color="#1d50a2">Create a downlink vlan for a DHCP relay instance named &#x7B;name\}</font>

```json
POST HTTPS://{switch IP}/rest/v1/running/dhcp-relay/test/downlink-vlans/Vlan100
{
    "gateway-ip-address": "10.0.0.1"
}
```

## <font color="#1d50a2">Properties Descriptions</font>

### <font color="#1d50a2">DHCP Relay instance</font>

**Tree Diagrams**

```plaintext
  +--rw dhcp-relay
     +--rw dhcp-relay-agent* [name]
        +--rw name
        +--rw type?
        +--rw vrf?
        +--rw downlink-vlans* [vlan]
        |  +--rw vlan
        |  +--rw gateway-ip-address?
        |  +--rw option82-sub5?
        |  +--rw rfc6939_support?
        +--rw uplink-interfaces*
        +--rw gateway-interface?
        +--rw server-ips*
```

**Table of Properties**

| **Name**           | **Required** | **Type/Range**                              | **Description**                                                                                      |
| ------------------ | ------------ | ------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| dhcp-relay         | M            |                                             | Path-only node, has no configurable value.<br />DHCP relay.                                          |
| name               | M            | word not contain '\_'                       | (sub-property of dhcp-relay)<br />DHCP relay name.                                                   |
| type               | O            | "v4"<br />"v6"                              | (sub-property of dhcp-relay)<br />Default value: "v4"                                                |
| vrf                | O            | "default"<br />vrf name                     | (sub-property of dhcp-relay)<br />Set DHCP relay VRF.                                                |
| downlink-vlans     | M            |                                             | (sub-property of dhcp-relay)<br />Path-only node, has no configurable value.                         |
| vlan               | M            | Vlan1..4094                                 | (sub-property of downlink-vlans)<br />Downlink vlan                                                  |
| gateway-ip-address | O            | A.B.C.D                                     | (sub-property of downlink-vlans)<br />IP address of DHCP relay agent.<br />Default value: "0.0.0.0"  |
| option82-sub5      | O            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX | (sub-property of downlink-vlans)<br />One IP address of downlink vlan.<br />Default value: "0.0.0.0" |
| rfc6939\_support   | O            | "true"<br />"false"                         | (sub-property of downlink-vlans)<br />Set rfc6939 for the relay.<br />Default value: "false"         |
| uplink-interfaces  | O            | Ethernet name<br />VLAN name                | (sub-property of dhcp-relay)<br />Uplink interface                                                   |
| gateway-interface  | O            | Loopback0..199                              | (sub-property of dhcp-relay)<br />Set loopback interface as DHCP relay gateway                       |
| #server-ips        | O            | A.B.C.D<br />XX\:XX\:XX\:XX\:XX\:XX\:XX\:XX | (sub-property of dhcp-relay)<br />The IP address of DHCP server.                                     |

### <font color="#1d50a2">Show dhcp relay</font>

**Tree Diagrams**

```plaintext
    +---x show-dhcp-relay
       +--ro output
          +--ro data?
```

**Table of Properties**

| **Name**        | **Required** | **Type/Range** | **Description**                                                       |
| --------------- | ------------ | -------------- | --------------------------------------------------------------------- |
| show-dhcp-relay | M            |                | Path-only node, has no configurable value.<br />Show DHCP relay info. |
| data            | RO           | \<anydata>     | (sub-property of output)                                              |

