aboutsummaryrefslogtreecommitdiff
path: root/manifests/interface.pp
blob: 0b61950801463a975be7134c6d0a4fb8b6a346ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
define shorewall::interface(
    $zone,
    $broadcast = 'detect',
    $options = 'tcpflags,blacklist,routefilter,nosmurfs,logmartians',
    $add_options = '',
    $rfc1918 = false,
    $dhcp = false,
    $order = 100
){
    if $add_options == '' {
      $added_options = ''
    } else {
      $added_options = ",${add_options}"
    }

    if $rfc1918 {
        if $dhcp {
            $options_real = "${options},dhcp"
        } else {
            $options_real = "$options"
        }
    } else {
        if $dhcp {
            $options_real = "${options},norfc1918,dhcp"
        } else {
            $options_real = "${options},norfc1918"
        }
    }

    shorewall::entry { "interfaces.d/${order}-${title}":
        line => "${zone} ${name} ${broadcast} ${options_real}${added_options}",
    }
}