github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/ipnet/cidrnetmask.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: cidrnetmask - Functions - Configuration Language
     4  sidebar_title: cidrnetmask
     5  description: |-
     6    The cidrnetmask function converts an IPv4 address prefix given in CIDR
     7    notation into a subnet mask address.
     8  ---
     9  
    10  # `cidrnetmask` Function
    11  
    12  `cidrnetmask` converts an IPv4 address prefix given in CIDR notation into
    13  a subnet mask address.
    14  
    15  ```hcl
    16  cidrnetmask(prefix)
    17  ```
    18  
    19  `prefix` must be given in IPv4 CIDR notation, as defined in
    20  [RFC 4632 section 3.1](https://tools.ietf.org/html/rfc4632#section-3.1).
    21  
    22  The result is a subnet address formatted in the conventional dotted-decimal
    23  IPv4 address syntax, as expected by some software.
    24  
    25  CIDR notation is the only valid notation for IPv6 addresses, so `cidrnetmask`
    26  produces an error if given an IPv6 address.
    27  
    28  ## Examples
    29  
    30  ```shell-session
    31  > cidrnetmask("172.16.0.0/12")
    32  255.240.0.0
    33  ```