Skip to content

tvass/puppet-iproute2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

puppet-iproute2

Work in progress.

Table of Contents

  1. Overview
  2. Usage
  3. Operating Systems Support
  4. Development

verview

This module configures iproute2.

Usage

You have different possibile approaches in the usage of this module.

  • Use iproute2::rt_tables defines directly:

      iproute2::rt_tables {
        '223' => 'isp1',
        '224' => 'isp2',
      }
    
  • Use the main iproute2 class and the iproute2_hash to configure all :

      class { 'iproute2':
        rt_tables_hash => {
        '223' => 'isp1',
        '224' => 'isp2',
          }
      }
    
  • In Hiera, use it like this :

      iproute2::rt_tables" : {
        "223" : "isp1",
        "224" : "isp2"
      }
    

Route and Rule Configuration

For routes and rules there are two methods of invocation of the module due to differences in how RedHat and Debian store the configurations on disk. RedHat uses a per device configuration while Debian has a unified configuration.

Debian

  • Add routes :

       routes_hash => [
        {'network' => '1.2.3.0/24', 'gateway' => '10.0.0.1', 'table' => 'isp1'},
        {'network' => '1.2.4.0/24', 'gateway' => '10.0.0.2', 'table' => 'isp2'}
       ]
    
  • Add rules :

      rules_hash => [{'from' => '1.2.3.4', 'to' => '0.0.0.0/0', 'table' => 'isp1', 'priority' => '1000' }],
    

RedHat

You need to specify the interface/dev as a top level key in the hash

  • add routes :

       routes_hash => [
        'eth0' => [ {'network' => '1.2.3.0/24', 'gateway' => '10.0.0.1', 'table' => 'isp1'},
                    {'network' => '1.2.4.0/24', 'gateway' => '10.0.0.2', 'table' => 'isp2'}
                  ],
        'eth1' => [ {'network' => '1.2.3.0/24', 'gateway' => '10.0.0.1', 'table' => 'isp1'},
                    {'network' => '1.2.4.0/24', 'gateway' => '10.0.0.2', 'table' => 'isp2'}
                  ]
        ]
    
  • Add rules :

      rules_hash => [
        'eth0' => [{'from' => '1.2.3.4', 'to' => '0.0.0.0/0', 'table' => 'isp1', 'priority' => '1000' } ]
      ]
    

Operating Systems Support

This is tested on these OS:

  • Debian 7/8, Red Hat, Scientific Linux

Development

Pull requests (PR) and bug reports via GitHub are welcomed.

About

Puppet module to manage iproute2 configurations files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published