DHCP server
When you use a static IP address, Magic WAN Connector can also act as a DHCP server in your network. To enable this feature:
Log in to the Cloudflare dashboard and select your account.
Go to Magic WAN > Sites.
Select your site > Edit.
Select Network.
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
- The DHCP pool start
- The DHCP pool end
For example:
Create a PUT
request to update the LAN where you want to enable DHCP server:
Example:
curl --request PUT \
--url https://api.cloudflare.com/client/v4/accounts/{account_id}/magic/sites/{site_id}/lans/{lan_id} \
--header 'Content-Type: application/json' \
--header 'X-Auth-Email: <EMAIL>' \
--header 'X-Auth-Key: <API_KEY>' \
--data '{ "lan": { "static_addressing": { "dhcp_server": { "dhcp_pool_end": "<IP_ADDRESS>", "dhcp_pool_start": "<IP_ADDRESS>", "dns_server": "<IP_ADDRESS>" } } }}'