aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems/firewall/wifi.pp
blob: d59ce500624fe31eec0ce719f889084cac1797fa (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class firewall::wifi {
  $rfc1918 = $shorewall_local_net ? {
    true    => true,
    false   => false,
    default => false,
  }

  # Default device depends if madwifi or
  # built-in kernel driver is being used
  $wifi_default_device = $lsbdistcodename ? {
    'lenny' => 'ath0',
    default => 'wlan0',
  }

  $wifi_dev = $wifi_device ? {
    ''      => $wifi_default_device,
    default => $wifi_device,
  }

  #
  # Interfaces
  #
  shorewall::interface { "$wifi_dev":
   zone    => '-',
   rfc1918 => $rfc1918,
  }

  #
  # Hosts
  #
  shorewall::host { "$wifi_dev-subnet":
    name    => "$wifi_dev:192.168.0.0/24",
    zone    => 'vm',
    options => '',
    order   => '1',
  }

  shorewall::host { "$wifi_dev":
    name    => "$wifi_dev:0.0.0.0/0",
    zone    => 'net',
    options => '',
    order   => '2',
  }

  shorewall::masq { "$wifi_dev":
    interface => "$wifi_dev:!192.168.0.0/24",
    source    => '192.168.0.0/24',
    order     => '1',
  }
}