Version information
This version is compatible with:
Start using this module
Add this module to your Puppetfile:
mod 'icann-quagga', '0.5.0'
Learn more about managing modules with a PuppetfileDocumentation
Quagga
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with quagga
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
Manage the installation and configuration of Quagga (Routing Daemons) .
Module Description
This modules allows for the manging of the quagga BGP daemon. Other routing modules are currently unsupported however you should be able to configure them manuly
Setup
What quagga affects
- Manages the quagga configueration file
- Manages the quagga bgpd configueration file
- can export nagios_service to test neighbours are Established and routes are being advertised
Setup Requirements
- depends on stdlib 4.11.0 (may work with earlier versions)
Beginning with quagga
Install the package an make sure it is enabled and running with default options, this will just configure zebra to run with no bgp config:
class { '::quagga': }
With some bgp peers
class { '::quagga': }
class { '::quagga::bgpd':
my_asn => 64496,
router_id => '192.0.2.1',
networks4 => [ '192.0.2.0/24'],
peers => {
'64497' => {
'addr4' => ['192.0.2.2'],
'desc' => 'TEST Network'
}
}
}
and in hiera
my_asn: 64496,
router_id: 192.0.2.1
networks4:
- '192.0.2.0/24'
peers:
64497:
addr4:
- '192.0.2.2'
desc: TEST Network
Usage
Add config but disable advertisments and add nagios checks
class { '::quagga::bgpd':
my_asn => 64496,
router_id => '192.0.2.1',
networks4 => [ '192.0.2.0/24'],
enable_advertisements => false,
peers => {
'64497' => {
'addr4' => ['192.0.2.2'],
'desc' => 'TEST Network'
}
}
}
Full config
class { '::quagga::bgpd':
my_asn => 64496,
router_id => '192.0.2.1',
networks4 => [ '192.0.2.0/24', '10.0.0.0/24'],
failsafe_networks4 => ['10.0.0.0/23'],
networks6 => ['2001:DB8::/48'],
failsafe_networks6 => ['2001:DB8::/32'],
enable_advertisements => false,
enable_advertisements_v4 => false,
enable_advertisements_v6 => false,
manage_nagios => true,
peers => {
'64497' => {
'addr4' => ['192.0.2.2'],
'addr6' => ['2001:DB8::2'],
'desc' => 'TEST Network',
'inbound_routes' => 'all',
'communities' => ['no-export', '64497:100' ],
'multihop' => 5,
'password' => 'password',
'prepend' => 3,
}
}
}
Reference
Classes
Public Classes
Class: quagga
Guides the basic setup and installation of Quagga on your system
Parameters (all optional)
owner
(String, Default: quagga): User to use for permissionsgroup
(String, Default: quagga): Group to use for permissionsmode
(String /^\d+$/, Default: 0664): Mode to use for permissionsquagga_content
(String, Default: 'hostname ${::fqdn}'): content of the quagga configenable_zebra
(Bool, Default: true): determin if we should enable zebrapackage
(String, Default: quagga): package to install
Class: quagga::bgpd
configure BGP settings
Parameters (all optional)
my_asn
(Int, Default: undef): The local ASN to userouter_id
(IP Address, Default: undef): IP address for the router IDnetworks4
(Array, Default: []): Array ip IPv4 networks in CIDR format to configurefailsafe_networks4
(Array, Default: []): Array ip IPv4 failsafe networks in CIDR format to configure. Failsafe networks consist of covering prefixes for the IPv4 networks. if the policy decided to disable advertising due to detected errors it will leave the failsafe network inplace. This is a specific use case for anycast networks which effectivly disables an anycast node as all others will still be advertising a more specific network; however if something goes wrong and all nodes have the most specific route removed then we would still have this failsafe network in place.networks6
(Array, Default: []): Array ip IPv6 networks in CIDR format to configurefailsafe_networks4
(Array, Default: []): Array ip IPv6 failsafe networks in CIDR format to configure. See failsafe_networks4 for a descriptionfailsafe_server
(Bool, Default: false): If this is set to true then we will only ever advertise the failsafe networks. i.e. the node will be effectivly ofline unless all other nodes are either out of commision or remove ther most specific networks (networks4
andnetworks6
)enable_advertisements
(Bool, Default: true): If this is set to false then no networks, including the failsafe networks, will be advertised.enable_advertisements_v4
(Bool, Default: true): If this is set to false then no IPv4 networks, including the failsafe IPv4 networks, will be advertised.enable_advertisements_v6
(Bool, Default: true): If this is set to false then no IPv6 networks, including the failsafe IPv6 networks, will be advertised.manage_nagios
(Bool, Default: false): If this is set to true the policy will create vertual resources to check each peer neighbor'conf_file
(Absolute file path, Default: '/etc/quagga/bgpd.conf'): The fully qualified path to the managed config file
Valid Debug Options as4, events, filters, fsm, keepalives, updates, zebra
debug_bgp
(Array of Valid OptionsEvents, Default: []): Enable BGP debugging foreach option in te array
Valid Logging levels: emergencies, alerts, critical, errors, warnings, notifications, informational, debugging
log_stdout
(Bool, Default: false): if set to true enable logging to stdoutlog_stdout_level
(Valid Logging level, Default: debugging): The logging level for stdout logginglog_file
(Bool, Default: false): if set to true enable logging to filelog_file_path
(Valid path, Default: /var/log/quagga/bgpd.log): The path for file logginglog_file_level
(Valid Logging level, Default: debugging): The logging level for file logginglogrotate_enable
: (Bool, Default: false): enable logrotate rules. Only valid of log_file is also truelogrotate_rotate
(Integer, Default: 5): The number of rotated log files to keep on disk.logrotate_size
(String, Default: 100M): The String size a log file has to reach before it will be rotated. The default units are bytes, append k, M or G for kilobytes, megabytes or gigabytes respectively.log_syslog
(Bool, Default: false): if set to true enable logging to sysloglog_syslog_facility
(String, Default: 'daemon') The syslog facilty to uselog_syslog_level
(Valid Logging level, Default: debugging): The logging level for syslog logginglog_monitor
(Bool, Default: false): if set to true enable logging to monitorlog_monitor_level
(Valid Logging level, Default: debugging): The logging level for monitor logginglog_record_priority
(Bool, Default: false): If true log the severity in all messages logged to a file, to stdout, or to a terminal monitor (i.e. anything except syslog)log_timestamp_precision
(Integer <=6, Default: 1): This sets the precision of log message timestamps to the given number of digits after the decimal point.peers
(Hash, Default: {}): A hash of peers to be used with create_resources(quagga::bgpd::peer, $peers)
Private Classes
Class quagga::params
Set os specific parameters
Private Defined Types
Defined quagga::bgpd::peer
Creat config for individual peers
Parameters
namevar
(Int): ASN of the peeraddr4
(Array, Default: []): Array of IPv4 neighbor addressesaddr6
(Array, Default: []): Array of IPv6 neighbor addressesdesc
(String, Default: undef): Description of the peerinbound_routes
(String /^(all|none|default|v4|default|v6default)$/, Default: 'none'): what ACL to apply for inbound routes.- all: accept all but the default route
- none: accept no routes
- default: only accept default routes
- v4default: only accept default routes over ipv4
- v6default: accept a default v6 route
communities
(Array, Default: []): Array of comminuties to set on advertised routes.multihop
(Int, Default: undef): Multihop setting to set on peers neighbor addressespassword
(String, Default: undef): Password setting to set on peers neighbor addressesprepend
(Int, Default: undef): Number of times to prepend your own ASN on advertised routes
Defined quagga::bgpd::peer::nagios
configure exported nagios servies for specific neighbor addresses
Parameters
namevar
(String): The IPv4 or IPv6 neighbor addressroutes
(Array, Default: []): Array of routes we should be advertising to the neighbor
Limitations
This module has been tested on:
- Ubuntu 12.04, 14.04
Development
Pull requests welcome but please also update documentation and tests.
2018-04-03 0.5.0
- run validate command as root user
2018-04-03 0.4.11
- Add abbility to specify listen address for bgp
2018-03-29 0.4.10
- Add dependecy for package on all ini settings
2018-02-13 0.4.9
- Add bogon filters
2018-02-12 0.4.8
- FIX: correct validate_cmd string
2018-02-12 0.4.7
- add validate_cmd to concat file
2018-02-08 0.4.6
- FIX: error with reject prefix ACL and add spec tests
2018-02-08 0.4.5
- FIX: prefix lists have to have a le value greater then the prefix size
2018-02-08 0.4.4
- update dependencies
2018-02-07 0.4.3
- update dependencies
2018-02-07 0.4.2
- update dependencies
2018-02-07 0.4.1
- update dependencies
2018-02-07 0.4.0
- add support to reject recived prefixes
2016-08-09 0.3.1
- add support to control logging
2016-08-02 0.3.0
- add support to control logging
2016-05-20 0.2.4
- Fix bug which prevented failover networks from been advertised
- add beaker tests for disable_advertisment, failover networks and failsafe_server
2016-05-20 0.2.3
- Fix bug preventing multible peers
- add beaker and rspec tests for multible peers
2016-05-19 0.2.2
- Fix the change log
2016-05-19 0.2.1
- minor fixs to docs
2016-05-19 0.2.0
- Refactor module to add spec and beaker tests
2015-05-11 v0.1.3
- add BGP MD5 passport support
2015-03-27 v0.1.2
- Initial Release
Dependencies
- puppetlabs-stdlib (>= 4.25.0 <5.0.0)
- puppetlabs-inifile (>= 1.5.0 <3.0.0)
- puppetlabs-concat (>= 4.1.1 <5.0.0)
- icann-tea (>= 0.2.8 <1.0.0)
- puppet-logrotate (>= 3.2.0 <4.0.0)
Copyright (C) 2012-2013 Matthias Saou Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.