/
DHCP Fixed Address

DHCP Fixed Address

Use the nios_fixed_address module to configure, update, or remove a DHCP fixed IP address object from a NIOS Grid. A fixed address is a specific IP address that a DHCP server always assigns when a lease request comes from a particular MAC address of the client. The module supports configuring IPv4 and IPv6 addresses.

The following table describes the parameters you can define in the nios_fixed_address module:

Parameter

Required/Optional

Description

Parameter

Required/Optional

Description

name

Required

Specifies the host name with which the DHCP fixed IP address is stored for a particular MAC address.

ip_addr

Required

Specifies the IPv6 or IPv4 address of the fixed address.

mac

Required

Required for specifying an IPv4 address.
It specifies the MAC address of the IPv4 interface.

duid

Required

Required for specifying an IPv6 address.
It specifies the DUID address of the IPv6 interface.

network

Optional

Specifies the network range in which the specified IP address exists.

network_view

Optional

Specifies the name of the network view to associate with this object instance.
When a value is not specified, the default network view from NIOS is used.

options

Optional

Defines the set of DHCP options to be included as part of
the configured network instance.
This argument accepts a list of values (subparameters). When configuring the subparameters, you must define name, num, or both.

  • name: The name of the DHCP option to configure.

  • num: The number of the DHCP option to configure.

  • value (required): The value of the DHCP option specified by the name subparameter.

  • use_option: Only applies to a subset of options (see the NIOS API documentation). The default value is yes.

  • vendor_class: The name of the space with which this DHCP option is associated.

extattrs

Optional

Specifies extensible attributes for the DHCP fixed address object.

state

Optional

Specifies the state of the DHCP fixed address instance in NIOS.
Set one of the following values:

  • present (default): Configures the object.

  • absent: Removes the object.

comment

Optional

Describes the DHCP fixed IP address object.

provider

Required

Defines the details of the connection:

  • host: DNS host name or IP address to connect to the remote instance of NIOS.

  • username: User name to use for authenticating the connection to the remote instance.

  • password: Password to use for authenticating the connection to the remote instance.

For information on additional fields you can define, see the list of subparameters in the list of subparameters in the NIOS Modules for Ansible Collections.

connection

Required

The nios_fixed_address module must be run locally.

Examples

name: Configure an ipv4 dhcp fixed address
infoblox.nios_modules.nios_fixed_address:
  name: ipv4_fixed
  ipaddr: 192.168.10.1
  mac: 08:6d:41:e8:fd:e8
  network: 192.168.10.0/24
  network_view: default
  comment: this is a test comment
  state: present
  provider:
    host: <nios_hostname_or_hostip>
    username: <nios_username>
    password: <nios_password>
connection: local



name: Configure an ipv6 dhcp fixed address
infoblox.nios_modules.nios_fixed_address:
  name: ipv6_fixed
  ipaddr: fe80::1/10
  mac: 08:6d:41:e8:fd:e8
  network: fe80::/64
  network_view: default
  comment: this is a test comment
  state: absent
  provider:
    host: host: <nios_hostname_or_hostip>
    username: <nios_username>
    password: <nios_password>
connection: local



name: Set dhcp options for an ipv4 fixed address
infoblox.nios_modules.nios_fixed_address:
  name: ipv4_fixed
  ipaddr: 192.168.10.1
  mac: 08:6d:41:e8:fd:e8
  network: 192.168.10.0/24
  network_view: default
  comment: this is a test comment
  options:
   - name: domain-name
     value: ansible.com
  state: present
  provider:
    host: host: <nios_hostname_or_hostip>
    username: <nios_username>
    password: <nios_password>
connection: local

Related content