Version information
released Aug 17th 2017
This version is compatible with:
- ,
Start using this module
Add this module to your Puppetfile:
mod 'bibigon812-network', '1.1.3'
Learn more about managing modules with a PuppetfileDocumentation
bibigon812/network — version 1.1.3 Aug 17th 2017
network
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.
Types in this module release
[1.1.3] - 2017-08-17
Fixed
- 0.0.0.0/0 is the
default
Updated
- the changelog
[1.1.2] - 2017-08-16
Fixed
- the instantiation of the network_interface resource
[1.1.1] - 2017-08-16
Fixed
- changing the parent of a network interface
Updated
- the changelog
[1.1.0] - 2017-08-16
Changed
- all IP address are stored in a file, ex.
ifcfg-eth0
Removed
- the template for interface aliases
[1.0.2] - 2017-08-09
Fixed
- creating routes
[1.0.1] - 2017-08-09
Fixed
- the README.md
- dates in the CHANGELOG.md
[1.0.0] - 2017-08-09
Added
- the
network_route
resource type
Changed
- the
network::interface_config_dir
parameter tonetwork::config_dir
Fixed
- removing the vlan interface
[0.1.1] - 2017-08-03
Updated
- the alias file management
[0.1.0] - 2017-08-02
Added
- the resource type
network_interface
- the provider
iproute2
for the resource typenetwork_interface
- the class
network::network_manager
- the define
network::interface
- the define
network::interface::config
Dependencies
- puppetlabs-stdlib (>= 4.10.0 < 5.0.0)