跳转到主要内容

DHCP server

import { APIRequest, TabItem, Tabs } from "~/components";

When you use a static IP address, Cloudflare One Appliance (formerly Magic WAN Connector) can also act as a DHCP server in your network. To enable this feature:

  1. Log in to Cloudflare One, and go to Networks.
  2. Go to Connectors > Appliances > Profiles.
  3. Select the Cloudflare One Appliance you want to configure > Edit.
  4. Select Network Configuration > LAN configuration.
  5. In LAN configuration, select the LAN where you want to enable DHCP server.
  6. Select Edit.
  7. Under Static addressing, select This is a DHCP Server. You also have to specify:
    • The DNS server address. You can have more than one IP address. Select Add DNS Server for each server you want to add.
    • The DHCP pool start
    • The DHCP pool end

:::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 server:

Example:

<APIRequest path="/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id}" method="PUT" json={{ "lan": { "static_addressing": { "dhcp_server": { "dhcp_pool_end": "<IP_ADDRESS>", "dhcp_pool_start": "<IP_ADDRESS>", "dns_server": "<IP_ADDRESS>" } } } }} />