Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / manifests / rules / out / mdns.pp @ master

Historique | Voir | Annoter | Télécharger (758 octets)

1
#
2
# @summary allow outgoing multicast DNS
3
#
4
# @param ipv4 Allow mdns over IPv4
5
# @param ipv6 Allow mdns over IPv6
6
# @param oifname optional name for outgoing interfaces
7
#
8
class nftables::rules::out::mdns (
9
  Boolean $ipv4 = true,
10
  Boolean $ipv6 = true,
11
  Array[String[1]] $oifname = [],
12
) {
13
  if empty($oifname) {
14
    $_oifname = ''
15
  } else {
16
    $oifdata = $oifname.map |String[1] $interface| { "\"${interface}\"" }.join(', ')
17
    $_oifname = "oifname { ${oifdata} } "
18
  }
19
  if $ipv4 {
20
    nftables::rule { 'default_out-mdns_v4':
21
      content => "${_oifname}ip daddr 224.0.0.251 udp dport 5353 accept",
22
    }
23
  }
24
  if $ipv6 {
25
    nftables::rule { 'default_out-mdns_v6':
26
      content => "${_oifname}ip6 daddr ff02::fb udp dport 5353 accept",
27
    }
28
  }
29
}