Creating a DHCP Options Set

You can create a custom DHCP options set to associate with a Net. You can specify one or more NTP servers and domain name servers to use, with a corresponding domain name.

3DS OUTSCALE automatically provides a default DHCP options set. However, you can create as many custom sets as you want.

You can associate a DHCP options set with a Net to customize the DHCP configuration used for virtual machines (VMs) created in this Net. For more information, see Modifying the DHCP Options Set Associated with a Net.

Creating a DHCP Options Set Using Cockpit v2

  1. In the DHCP Options dashboard, click IconAddFull Create DHCP Options.
    The CREATE DHCP OPTIONS dialog box appears.

  2. (optional) In the Domain Name field, type the domain name for the DHCP options set.

    To use the OUTSCALE domain name, leave the field empty. For more information, see About DHCP Options > Default DHCP Options Set.

    Click Next.

  3. From the Domain Name Servers list, select:

    1. Proceed with default DNS to use the OUTSCALE domain name server.

    2. Select one or multiple DNS to use a custom domain name server.

  4. Specify the following values:

    • (optional) In the NTP Servers field, type the IPs of one or more NTP servers.

      Specifying the same values as those of an existing DHCP options set creates another, separate set with a different ID.

    • (optional) In the Log Servers field, type the IPs of one or more log servers.

      Specifying the same values as those of an existing DHCP options set creates another, separate set with a different ID.

  5. Click Next, then review the settings you have specified for the DHCP options set.

  6. Click Create.
    The DHCP options set is created.

Creating a DHCP Options Set Using OSC CLI

The CreateDhcpOptions command creates a set of DHCP options, that you can then associate with a Net using the UpdateNet method.

For more information, see About DHCP Options.

Request sample
$ osc-cli api CreateDhcpOptions --profile "default" \
    --DomainName "example.com" \
    --DomainNameServers '["192.0.2.0", "198.51.100.0"]' \
    --NtpServers '["203.0.113.0", "203.0.113.1"]'

This command contains the following attributes that you need to specify:

  • DomainName: (optional) Specify a domain name (for example, MyCompany.com). You can specify only one domain name. You must specify at least one of the following parameters: DomainName, DomainNameServers, LogServers, or NtpServers.

  • DomainNameServers: (optional) The IPs of domain name servers. If no IPs are specified, the OutscaleProvidedDNS value is set by default. You must specify at least one of the following parameters: DomainName, DomainNameServers, LogServers, or NtpServers.

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • LogServers: (optional) The IPs of the log servers. You must specify at least one of the following parameters: DomainName, DomainNameServers, LogServers, or NtpServers.

  • NtpServers: (optional) The IPs of the Network Time Protocol (NTP) servers. You must specify at least one of the following parameters: DomainName, DomainNameServers, LogServers, or NtpServers.

The CreateDhcpOptions command returns the following elements:

  • DhcpOptionsSet: Information about the DHCP options set.

  • ResponseContext: Information about the context of the response.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "DhcpOptionsSet": {
    "Tags": [],
    "NtpServers": [
      "203.0.113.0",
      "203.0.113.1"
    ],
    "Default": false,
    "DhcpOptionsSetId": "dopt-12345678",
    "DomainName": "example.com",
    "DomainNameServers": [
      "192.0.2.0",
      "198.51.100.0"
    ]
  }
}

Creating a DHCP Options Set Using AWS CLI

To create a custom DHCP options set, use the create-dhcp-options command following this syntax:

Request sample
$ aws ec2 create-dhcp-options \
    --profile YOUR_PROFILE \
    --dhcp-configurations Key=domain-name-servers,Values=192.0.0.0,192.0.0.1 Key=domain-name,Values=mycompany.com Key=ntp-servers,Values=192.0.0.2 Key=log-servers,Values=192.0.0.3 \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • dhcp-configurations: One or more DHCP options. This attribute contains the following elements that you need to specify:

    • (optional) Key: The type of DHCP option (domain-name-servers | domain-name | ntp-servers | log-servers). For more information, see About DHCP Options.

    • (optional) Values: The value for the DHCP option (one or more IPs for the domain-name-servers, ntp-servers and log-servers attribute, or a domain name for the domain-name attribute).

      You can specify up to four IPs for the domain-name-servers, ntp-servers and log-servers attributes.

      To use the OUTSCALE domain name server in a custom DHCP options set, you need to specify the following values:
      - domain-name-servers: OutscaleProvidedDNS
      - domain-name: <region_name>.compute.internal

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The create-dhcp-options command returns the following elements:

  • DhcpOptions: Information about the newly created DHCP options set. This element contains the following information:

    • DhcpConfigurations: Information about the DHCP options contained in the DHCP options set. This element contains the following information:

      • Value: One or more values for the DHCP option.

      • Key: The type of DHCP option.

    • DhcpOptionsId: The ID of the DHCP options set.

    • Tags: One of more tags associated with the DHCP options set. This element contains the following information:

      • TagKey: The key of the tag associated with the resource.

      • TagValue: The value of the tag associated with the resource.

Result sample
 {
    "DhcpOptions": {
        "DhcpConfigurations": [
            {
                "Values": [
                    {
                        "Value": "mycompany.com"
                    }
                ],
                "Key": "domain-name"
            },
            {
                "Values": [
                    {
                        "Value": "10.2.5.2"
                    },
                    {
                        "Value": "10.2.5.1"
                    }
                ]
                "Key": "domain-name-servers"
            },
            {
                "Values": [
                    {
                        "Value:": "10.2.5.2"
                    }
                ]
                "Key": "ntp-servers"
            },
            {
                "Key": "log-servers",
                "Values": [
                    {
                        "Value": ""
                    }
                ]
            }
        ],
        "DhcpOptionsId": "dopt-1234abcd",
        "Tags": []
    }
}

The DHCP options set is created.

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.