create_network
Set up a new network or VLAN segment on a UniFi gateway by specifying subnet, VLAN ID, and optional DHCP range. Requires confirmation to apply routing changes immediately.
Instructions
Create a new network/VLAN segment on the gateway (corporate by default).
Mutating operation: applied immediately and persisted on the UniFi console. Provide subnet in CIDR form and an optional VLAN id to tag the segment; enable DHCP by supplying both dhcp_start and dhcp_stop. Requires confirm=true because routing/VLAN/DHCP changes can disrupt connectivity. Inspect with get_networks; reverse with delete_network.
Args: name: Network name (e.g. "IoT"). subnet: Subnet in CIDR form (e.g. "192.168.50.1/24"); omit for unrouted. vlan: VLAN id (1-4094) for a tagged segment; omit for untagged. purpose: Segment type — "corporate", "guest", or "wan". Defaults to "corporate". domain_name: DNS domain name advertised to clients (e.g. "example.local"). dhcp_start: DHCP pool start IP; supply with dhcp_stop to enable DHCP. dhcp_stop: DHCP pool end IP; supply with dhcp_start to enable DHCP. dhcp_lease_time: DHCP lease duration in seconds (default 86400). site: Site to operate on. Defaults to "default". device: Optional console name to target a specific UniFi device; omit for default. confirm: Safety gate: must be True to create. Defaults to False.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Network name (e.g. "IoT"). | |
| site | No | Site to operate on. Defaults to "default". | default |
| vlan | No | VLAN id (1-4094) for a tagged segment; omit for untagged. | |
| device | No | Optional console name to target a specific UniFi device; omit for default. | |
| subnet | No | Subnet in CIDR form (e.g. "192.168.50.1/24"); omit for unrouted. | |
| confirm | No | Safety gate: must be True to create. Defaults to False. | |
| purpose | No | Segment type — "corporate", "guest", or "wan". Defaults to "corporate". | corporate |
| dhcp_stop | No | DHCP pool end IP; supply with dhcp_start to enable DHCP. | |
| dhcp_start | No | DHCP pool start IP; supply with dhcp_stop to enable DHCP. | |
| domain_name | No | DNS domain name advertised to clients (e.g. "example.local"). | |
| dhcp_lease_time | No | DHCP lease duration in seconds (default 86400). |