View Source VintageNet.IP.IPv4Config (vintage_net v0.13.5)

This is a helper module for VintageNet.Technology implementations that use IPv4.

IPv4 configuration is specified under the :ipv4 key in the configuration map. Fields include:

  • :method - :dhcp, :static, or :disabled

The :dhcp method currently has no additional fields.

The :static method uses the following fields:

  • :address - the IP address
  • :prefix_length - the number of bits in the IP address to use for the subnet (e.g., 24)
  • :netmask - either this or prefix_length is used to determine the subnet. If you have a choice, use prefix_length
  • :gateway - the default gateway for this interface (optional)
  • :name_servers - a list of DNS servers (optional)
  • :domain - DNS search domain (optional)

Configuration normalization converts :netmask to :prefix_length.

Summary

Functions

Add IPv4 configuration commands for supporting static and dynamic IP addressing

Normalize the IPv4 parameters in a configuration.

Functions

Link to this function

add_config(raw_config, config, opts)

View Source

Add IPv4 configuration commands for supporting static and dynamic IP addressing

@spec normalize(map()) :: %{ipv4: map()}

Normalize the IPv4 parameters in a configuration.