dhcp
Manage DHCP option sets and associate them with VPCs.
Commands
| Command | Description |
|---|---|
| list | List all DHCP option sets |
| get | Get details of a DHCP option set |
| create | Create a new DHCP option set |
| list-vpcs | List VPCs associated with a DHCP option set |
| associate-vpc | Associate or detach a VPC from a DHCP option set |
| delete | Delete a DHCP option set |
list
List all DHCP option sets in your project.
Synopsis
Options
--page (integer)
: Page number, 1-based. Default: 1.
--page-size (integer)
: Number of items per page. Default: 50.
--name (string)
: Filter by DHCP option set name (substring match).
Examples
get
Get details of a DHCP option set.
Synopsis
Options
--dhcp-option-id (required)
: DHCP option set ID.
Examples
create
Create a new DHCP option set. Two default DNS servers (10.166.12.196, 10.166.12.197) are always included. Use --dns-server to add up to 2 additional DNS servers.
Synopsis
Options
--name (required)
: DHCP option set name.
--dns-server (string, repeatable)
: Additional DNS server IP address. Can be specified up to 2 times.
Examples
# Default DNS only
grn vserver dhcp create --name my-dhcp
# Custom additional DNS servers
grn vserver dhcp create \
--name custom-dns \
--dns-server 8.8.8.8 \
--dns-server 8.8.4.4
list-vpcs
List all VPCs associated with a DHCP option set.
Synopsis
Options
--dhcp-option-id (required)
: DHCP option set ID.
--page (integer)
: Page number, 1-based. Default: 1.
--page-size (integer)
: Number of items per page. Default: 50.
Examples
associate-vpc
Associate a VPC with a DHCP option set, or detach it using --detach.
Synopsis
Options
--vpc-id (required)
: VPC ID.
--dhcp-option-id (string)
: DHCP option set ID to associate the VPC with. Not required when using --detach.
--detach (boolean)
: Detach the VPC from its current DHCP option set.
Examples
# Associate a VPC
grn vserver dhcp associate-vpc \
--vpc-id vpc-abc12345-0000-0000-0000-000000000001 \
--dhcp-option-id dhcp-abc12345-0000-0000-0000-000000000001
# Detach a VPC from its DHCP option set
grn vserver dhcp associate-vpc \
--vpc-id vpc-abc12345-0000-0000-0000-000000000001 \
--detach
delete
Delete a DHCP option set. Shows a confirmation prompt unless --force is used.
Synopsis
Options
--dhcp-option-id (required)
: DHCP option set ID.
--force (boolean)
: Skip the confirmation prompt.
--dry-run (boolean)
: Preview the deletion without executing it.