How to allocate an ip address

We currently use very different mechanisms to allocate IPv6 addresses compared to IPv4 addresses.

NOTE: The historical ip-temp process on is no longer in use!

Steps for allocating an IPv4 address

Now, we allocate an IP and create the iterface in the same step.

Find an available IP


freepuppet-helper ai | sort

To get a list of currently allocated IPs

Then, pick the next one in the range you want and edit the .pp file for the server in question and add the following

Sample for physical host

  class { "mayfirst::m_interface": }
  mayfirst::m_interface::set { "":
    dev => "br0",
    gateway => "",
    hwaddress => "00:26:b9:35:c1:eb",
    bridge_ports => "eth0"

Sample for canonical IP address on guest

  class { "mayfirst::m_interface": }
  mayfirst::m_interface::set { "": gateway => "" }

Sample for additional IP on guest

  mayfirst::m_interface::set { "": label => "smtp" }

Steps for allocating an IPv6 address

The IPv6 process is much more manual, and not directly managed by puppet.

find a free IPv6 address

first, list all claimed IPv6 addresses by searching in :

0 mfpl-puppet$ git grep 'gateway.*->.*:'
manifests/nodes/production/che.pp:# mayfirst::m_interface::set { "2001:470:1:116::7/64": gateway => "2001:470:1:116::1" }
0 mfpl-puppet$ 

Note that the lines are commented out (with a #). this is as intended, they're still allocations, because puppet isn't dealing with IPv6 at all yet.

Then choose a free one.

assign it to the host manually

place the appropriate stanza in a new file in /etc/network/interfaces.d/ on hosts that use ifupdown, or in a /etc/systemd/network/*.network file on hosts that use systemd-networkd

claim it in puppet

remember to add a commented line in the appropriate puppet production file corresponding to the host!

Last modified 2 years ago Last modified on Nov 30, 2018, 2:59:28 PM