Forge Home

network

Puppet module for network management in Linux

5,911 downloads

4,865 latest version

4.6 quality score

Version information

  • 1.1.3 (latest)
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.1.1
  • 0.1.0
released Aug 17th 2017
This version is compatible with:
  • CentOS
    ,
    RedHat

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'bibigon812-network', '1.1.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add bibigon812-network
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install bibigon812-network --version 1.1.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

bibigon812/network — version 1.1.3 Aug 17th 2017

network

Build Status

Description

This module manages network interfaces without restarting the network subsystem. It contains of two parts. One uses iproute2 tools and system files placed in /sys/class/net. The other manages files needed to restore the state after OS boots.

Naming convention

  • Bonding: bond0, bond1, etc.
  • Vlan: vlan10, vlan20, vlan4000, etc.
  • Loopback: lo.
  • Ethernet: eth0, ens3f0, enp0s1, etc.

Setup

What network affects

  • Removes unspecified IP addresses of the network interface.
  • Overwrites configuration files of the network interface.
  • Can make your server unreachable.

Beginning with network

Include this module and write hiera.

include ::network
---
network::network_manager::enable: false
network::network_manager::ensure: stopped
---
network::interfaces:
  eth0:
    mtu: 9000
  eth1:
    mtu: 9000
  bond0:
    bond_slaves:
      - eth0
      - eth1
    mtu: 9000
  valn100:
    ipaddress:
      - 10.0.0.1/24
      - 172.16.0.1/24
    mtu: 1500
    parent: bond0
  vlan110:
    ipaddress:
      - 192.168.255.1/24
    mtu: 9000
    parent: bond0
---
network::routes:
  192.168.0.0/24:
    device: vlan100
    nexthop: 172.16.0.100
  192.168.0.0/24 100:
    device: vlan110
    nexthop: 192.168.255.100

Usage

network_interface { ['eth0', 'eth1']:
  mtu => 9000,
}
---
network::interfaces:
  eth0:
    mtu: 9000
  eth1:
    mtu: 9000

Create the bond interface

network_interface { 'bond0':
  ensure         => present,
  bond_lacp_rate => 'fast',
  bond_slaves    => [
    'eth0',
    'eth1',
  ],
  mtu            => 9000,
}
---
network::interfaces:
  bond0:
    ensure: present
    bond_lacp_rate: fast
    bond_slaves:
      - eth0
      - eth1
    mtu: 9000

Create the vlan interface

network_interface { 'bond0.100':
  ensure    => present,
  ipaddress => [
    '10.0.0.1/24',
    '172.16.0.1/24',
  ],
}
---
network::interfaces:
  bond0.100:
    ipaddress:
      - 10.0.0.1/24
      - 172.16.0.1/24
network_interface { 'vlan100':
  ensure    => present,
  ipaddress => [
    '10.0.0.1/24',
    '172.16.0.1/24',
  ],
  parent    => 'bond0',
}
---
network::interfaces:
  vlan100:
    ipaddress:
      - 10.0.0.1/24
      - 172.16.0.1/24
    parent: bond0

Create routes

network_route { '192.168.0.0/24':
  ensure  => present,
  device  => 'vlan100',
  nexthop => '10.0.0.100',
}
network::routes:
  192.168.0.0/24:
    ensure: present
    device: vlan100
    nexthop: 10.0.0.100
network_route { '10.0.0.0/24 250':
  ensure => present,
  device => 'vlan200',
}
network::route:
  10.0.0.0/24 250:
    ensure: present
    device: vlan200

Create the default route

network_route { '0.0.0.0/0':
  ensure  => present,
  device  => 'eth0',
  nexthop => '192.168.1.1',
}

## Reference

### network_interface

- `name`. Interface name.
- `type`. Interface type. Can be `hw`, `bond` and `vlan`.
- `bond_lacp_rate`. Option specifying the rate in which we'll ask our link
partner to transmit LACPDU packets in 802.3ad mode. Defaults to `slow`.
- `bond_miimon`. Specifies the MII link monitoring frequency in milliseconds.
Defaults to `100`.
- `bond_mode`. Specifies one of the bonding policies. Defaults to `802.3ad`.
- `bond_slaves`. Specifies a list of the bonding slaves. Defaults to `[]`.
- `bond_xmit_hash_policy`. This policy uses upper layer protocol information,
when available, to generate the hash. Defaults to `layer3+4`.
- `ipaddress`. Specifies a list of IP addresses. Defaults to `[]`.
- `mac`. Specifies a MAC address.
- `mtu`. Specifies the maximum transmission unit.
- `parent`. Specifies a parent interface.
- `state`. State of this interface. Can be `up` and `down`. Defaults to `up`.
- `vlanid`. Vlan ID.

### network_route

- `name`. Contains the IP prefix and the metric (optional).
- `prefix`. Specifies the IP prefix. The default value obtains from the name.
- `metric`. Specifies the metric. The default value obtains rom the name.
- `device`. Specifies the device.
- `nexthop`. Specifies the next hop.