en-US/about_xIPAddress.help.txt

.NAME
    xIPAddress
 
# Description
     
    This resource is used to control a node's IP address. This can be used in
    conjunction with disabling DHCP to set static IP addresses.
     
.PARAMETER IPAddress
    Write - string
    The desired IP address, optionally including prefix length using CIDR notation.
 
.PARAMETER InterfaceAlias
    Key - string
    Alias of the network interface for which the IP address should be set.
 
.PARAMETER AddressFamily
    Key - string
    Allowed values: IPv4, IPv6
    IP address family.
 
 
    .EXAMPLE
    Disabling DHCP and adding a static IP Address for IPv6 and IPv4
    using default prefix lengths for the matching address classes
 
Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )
 
    Import-DscResource -Module xNetworking
 
    Node $NodeName
    {
        xDhcpClient DisabledDhcpClient
        {
            State = 'Disabled'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPv6'
        }
 
        # If no prefix is supplied IPv6 will default to /64.
        xIPAddress NewIPv6Address
        {
            IPAddress = '2001:4898:200:7:6c71:a102:ebd8:f482'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPV6'
        }
 
        # If no prefix is supplied then IPv4 will default to class based:
        # Class A - /8
        # Class B - /16
        # Class C - /24
        xIPAddress NewIPv4Address
        {
            IPAddress = '192.168.10.5'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPV4'
        }
    }
}
 
 
    .EXAMPLE
    Disabling DHCP and adding multiple static IP Addresses for IPv4 and IPv6
 
Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )
 
    Import-DscResource -Module xNetworking
 
    Node $NodeName
    {
        xDhcpClient DisabledDhcpClient
        {
            State = 'Disabled'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPv6'
        }
 
        xIPAddress NewIPv6Address
        {
            IPAddress = '2001:4898:200:7:6c71:a102:ebd8:f482/64','2001:4598:210:7:6d71:a102:ebe8:f483/64'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPV6'
        }
 
        xIPAddress NewIPv4Address
        {
            IPAddress = '192.168.10.5/24','192.168.10.6/24'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPV4'
        }
    }
}
 
 
    .EXAMPLE
    Disabling DHCP and adding a static IP Address for IPv6 and IPv4
    using specified prefixes in CIDR notation.
 
Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )
 
    Import-DscResource -Module xNetworking
 
    Node $NodeName
    {
        xDhcpClient DisabledDhcpClient
        {
            State = 'Disabled'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPv6'
        }
 
        xIPAddress NewIPv6Address
        {
            IPAddress = '2001:4898:200:7:6c71:a102:ebd8:f482/64'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPV6'
        }
 
        xIPAddress NewIPv4Address
        {
            IPAddress = '192.168.10.5/24'
            InterfaceAlias = 'Ethernet'
            AddressFamily = 'IPV4'
        }
    }
}