Modifying the DHCP Options Set Associated with a VPC
You can associate a default or custom DHCP options set with a Virtual Private Cloud (VPC) to apply the options it contains to instances launched in this VPC.
This action replaces the DHCP options set with another one, as you can associate a VPC with one DHCP options set only at a time.
When you modify the DHCP options set associated with a VPC, the options it contains are automatically applied to both existing instances and instances that you launch afterward. Existing instances apply these options within a few hours after you modify the DHCP options set, depending on their DHCP lease renewal frequency. You do not need to restart the instances. You can however force the renewal of your DHCP lease using the
dhclient command for Linux instances, or the
ipconfig/renew command for Windows instances.
Click VPC > DHCP Options.
Click the DHCP options set you want to associate with a VPC.
The DHCP options set is selected.
Click Associate VPC .
The ASSOCIATE VPC dialog box appears.
From the VPC list, select the VPC you want to associate the DHCP options set with.
Click Associate to validate.
The DHCP options set is associated with the specified VPC and replaces the previous set.
You can also associate a DHCP options set with a VPC in the VPCs user interface.
Click VPC > VPCs, then select a VPC and click Associate DHCP Options .
Click inside the Nets dashboard to make checkboxes appear.
Check the box of the Net you want to associate with the DHCP options set.
The Net is selected and an action menu appears.
The UPDATE NET dialog box appears.
In the list, select the DHCP Options set you want to associate with your Net.
Click Update Net to validate.
The DHCP options set is associated with the Net and replaces the previous set.
To modify the DHCP options set associated with a VPC, use the associate-dhcp-options command following this syntax:
$ aws ec2 associate-dhcp-options \ --profile YOUR_PROFILE \ --dhcp-options-id dopt-1234abcd \ --vpc-id vpc-12345678 \ --endpoint https://fcu.eu-west-2.outscale.com
This command contains the following attributes that you need to specify:
profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.
dhcp-options-id: The ID of the DHCP options set you want to associate with the VPC, or
defaultif you want to associate the default one.
A VPC cannot have no DHCP options set associated with it.
vpc-id: The ID of the VPC you want to associate the DHCP options set with.
endpoint: The endpoint corresponding to the Region you want to send the request to.
The DHCP options set is associated with the specified VPC.
Corresponding API Method
AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.