-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Examples in xIPAddress to make show setting IPv4 prefix in CI…
…DR notation
- Loading branch information
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Modules/xNetworking/Examples/Resources/xIPAddress/3-AddingStaticIPWithPrefix.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<# | ||
.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' | ||
} | ||
} | ||
} |