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:
- Log in to Cloudflare One, and go to Networks.
- Go to Connectors > Appliances > Profiles.
- Select the Cloudflare One Appliance you want to configure > Edit.
- Select Network Configuration > LAN configuration.
- In LAN configuration, select the LAN where you want to enable DHCP server.
- Select Edit.
- 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
Create a PUT request to update the LAN where you want to enable DHCP server:
Example:
Required API token permissions
At least one of the following token permissions is required:Magic WAN WriteMagic Transit Write
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_server": {
"dhcp_pool_end": "<IP_ADDRESS>",
"dhcp_pool_start": "<IP_ADDRESS>",
"dns_server": "<IP_ADDRESS>"
}
}
}
}'