DHCP relay

Last updated Aug 24, 2026 DHCP Relay provides a way for DHCP clients to communicate with DHCP servers that are not available on the same local subnet/broadcast domain. When you enable DHCP Relay, Cloudflare One Appliance (formerly Magic WAN Connector) forwards DHCP discover messages to a predefined DHCP server, and routes the responses back to the original device that sent the discover message.

    flowchart LR
    accTitle: DHCP Relay diagram
    accDescr: The graph shows Cloudflare One Appliance sending DHCP discover messages to a DHCP server offsite.
            a(Cloudflare One Appliance) <--> b(Cloudflare/Cloudflare WAN) <--> c(DHCP server)

            subgraph Site A
            d[LAN 1] <--> a
            e[LAN 2] <--> a
            end

            subgraph Site B
            c
            end
            classDef orange fill:#f48120,color: black
            class a,b,c orange

The graph shows Cloudflare One Appliance sending DHCP discover messages to a DHCP server offsite.

Caution

DHCP relay will not work if your DHCP server is behind a Cloudflare Tunnel. To enable DHCP relay functionality, use either a Cloudflare WAN IPsec/GRE tunnel or a CNI connection.

To configure DHCP relay:

  1. Go to the Connectors page.

Go to Connectors ↗

  1. Go to the Appliances tab > Profiles.
  2. Select your Cloudflare One Appliance > Edit.
  3. Select Network Configuration.
  4. In LAN configuration, select the LAN where you need to configure DHCP relay.
  5. Select Edit.
  6. Select This is a DHCP Relay.
  7. In Upstream DHCP server addresses, enter the IP address of your DHCP server.
  8. (Optional) If you need to add more DHCP server addresses, select Add upstream DHCP server address as many times as needed, and enter the new values.

Note

You will need your account ID and API token to use the API.

Create a PUT request to update the LAN where you want to enable DHCP relay:

Example:

<details>

<summary>

Required API token permissions

</summary>

At least one of the following <a href="https://developers.cloudflare.com/fundamentals/api/reference/permissions/">token permissions</a> is required:

  • <code>Magic WAN Write</code>
  • <code>Magic Transit Write</code>

</details>

Update Site LANbash

curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/sites/$SITE_ID/lans/$LAN_ID" \
    --request PUT \
    --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    --json '{
        "lan": {
                "static_addressing": {
                        "dhcp_relay": {
                                "server_addresses": [
                                        "192.0.2.1"
                                ]
                        }
                }
        }
    }'

Was this helpful?

YesNo

On this page

DHCP relay - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/cloudflare-wan/configuration/appliance/network-options/dhcp/dhcp-relay/#page","headline":"DHCP relay","description":"Configure DHCP relay on the Appliance.","url":"https://developers.cloudflare.com/cloudflare-wan/configuration/appliance/network-options/dhcp/dhcp-relay/","inLanguage":"en","image":"https://developers.cloudflare.com/cloudflare-wan/configuration/appliance/network-options/dhcp/dhcp-relay/og.png?v=617d9a1dedd78b4a","dateModified":"2026-08-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Configure the Appliance DHCP server. title: DHCP server image: https://developers.cloudflare.com/cloudflare-wan/configuration/appliance/network-options/dhcp/dhcp-server/og.png?v=6a3bc96d55f0bfdf


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/cloudflare-wan/llms.txt
Use this file to discover all available pages before exploring further.