AWS AWSEC2 documentation change
Summary
Added PowerShell examples for managing IPv4 and IPv6 prefixes in network interfaces, including creation, assignment, and removal operations. Also made minor clarifications in CLI command descriptions.
Security assessment
The changes primarily add PowerShell examples and clarify CLI command usage for managing IP prefixes. There is no evidence of security vulnerabilities being addressed or new security features being documented.
Diff
diff --git a/AWSEC2/latest/UserGuide/work-with-prefixes.md index da94b357c..be704b2ce 100644 --- a/AWSEC2/latest/UserGuide/work-with-prefixes.md +++ b/AWSEC2/latest/UserGuide/work-with-prefixes.md @@ -69 +69 @@ AWS CLI -Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv4-prefix-count` to the number of prefixes that you want AWS to assign. In the following example, AWS assigns one prefix. +Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv4-prefix-count` to the number of IPv4 prefixes for AWS to assign. In the following example, AWS assigns one IPv4 prefix. @@ -79 +79 @@ Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation -Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv4-prefixes` to the prefixes. AWS selects IP addresses from this range. In the following example, the prefix CIDR is `10.0.0.208/28`. +Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv4-prefixes` to the prefixes. AWS selects IPv4 addresses from this range. In the following example, the prefix CIDR is 10.0.0.208/28. @@ -89 +89 @@ Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation -Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv6-prefix-count` to the number of prefixes that you want AWS to assign. In the following example, AWS assigns one prefix. +Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv6-prefix-count` to the number of IPv6 prefixes for AWS to assign. In the following example, AWS assigns one IPv6 prefix. @@ -99 +99 @@ Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation -Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv6-prefixes` to the prefixes. AWS selects IP addresses from this range. In the following example, the prefix CIDR is `2600:1f13:fc2:a700:1768::/80`. +Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command and set `--ipv6-prefixes` to the prefixes. AWS selects IPv6 addresses from this range. In the following example, the prefix CIDR is 2600:1f13:fc2:a700:1768::/80. @@ -106,0 +107,49 @@ Use the [create-network-interface](https://awscli.amazonaws.com/v2/documentation +PowerShell + + +###### To assign automatic IPv4 prefixes during network interface creation + +Use the [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet and set `Ipv4PrefixCount` to the number of IPv4 prefixes for AWS to assign. In the following example, AWS assigns one IPv4 prefix. + + + New-EC2NetworkInterface ` + -SubnetId 'subnet-047cfed18eEXAMPLE' ` + -Description 'IPv4 automatic example' ` + -Ipv4PrefixCount 1 + +###### To assign specific IPv4 prefixes during network interface creation + +Use the [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet and set `Ipv4Prefix` to the prefixes. AWS selects IPv4 addresses from this range. In the following example, the prefix CIDR is 10.0.0.208/28. + + + Import-Module AWS.Tools.EC2 + New-EC2NetworkInterface ` + -SubnetId 'subnet-047cfed18eEXAMPLE' ` + -Description 'IPv4 manual example' ` + -Ipv4Prefix (New-Object ` + -TypeName Amazon.EC2.Model.Ipv4PrefixSpecificationRequest ` + -Property @{Ipv4Prefix = '10.0.0.208/28'}) + +###### To assign automatic IPv6 prefixes during network interface creation + +Use the [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet and set `Ipv6PrefixCount` to the number of IPv6 prefixes for AWS to assign. In the following example, AWS assigns one IPv6 prefix. + + + New-EC2NetworkInterface ` + -SubnetId 'subnet-047cfed18eEXAMPLE' ` + -Description 'IPv6 automatic example' ` + -Ipv6PrefixCount 1 + +###### To assign specific IPv6 prefixes during network interface creation + +Use the [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet and set `Ipv6Prefixes` to the prefixes. AWS selects IPv6 addresses from this range. In the following example, the prefix CIDR is 2600:1f13:fc2:a700:1768::/80. + + + Import-Module AWS.Tools.EC2 + New-EC2NetworkInterface ` + -SubnetId 'subnet-047cfed18eEXAMPLE' ` + -Description 'IPv6 manual example' ` + -Ipv6Prefix (New-Object ` + -TypeName Amazon.EC2.Model.Ipv6PrefixSpecificationRequest ` + -Property @{Ipv6Prefix = '2600:1f13:fc2:a700:1768::/80'}) + @@ -146 +195 @@ AWS CLI -You can use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-ipv6-addresses.html) command to assign IPv6 prefixes and the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-private-ip-addresses.html) command to assign IPv4 prefixes to existing network interfaces. +Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-ipv6-addresses.html) command to assign IPv6 prefixes and the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-private-ip-addresses.html) command to assign IPv4 prefixes to existing network interfaces. @@ -150 +199 @@ You can use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/document -Use the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-private-ip-addresses.html) command and set `--ipv4-prefix-count` to the number of prefixes that you want AWS to assign. In the following example, AWS assigns one IPv4 prefix. +Use the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-private-ip-addresses.html) command and set `--ipv4-prefix-count` to the number of IPv4 prefixes for AWS to assign. In the following example, AWS assigns one IPv4 prefix. @@ -159 +208 @@ Use the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentat -Use the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-private-ip-addresses.html) command and set `--ipv4-prefixes` to the prefix. AWS selects IPv4 addresses from this range. In the following example, the prefix CIDR is `10.0.0.208/28`. +Use the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-private-ip-addresses.html) command and set `--ipv4-prefixes` to the prefix. AWS selects IPv4 addresses from this range. In the following example, the prefix CIDR is 10.0.0.208/28. @@ -168 +217 @@ Use the [assign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentat -Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-ipv6-addresses.html) command and set `--ipv6-prefix-count` to the number of prefixes that you want AWS to assign. In the following example, AWS assigns one IPv6 prefix. +Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-ipv6-addresses.html) command and set `--ipv6-prefix-count` to the number of IPv6 prefixes for AWS to assign. In the following example, AWS assigns one IPv6 prefix. @@ -177 +226 @@ Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/ap -Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-ipv6-addresses.html) command and set `--ipv6-prefixes` to the prefix. AWS selects IPv6 addresses from this range. In the following example, the prefix CIDR is `2600:1f13:fc2:a700:18bb::/80`. +Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/assign-ipv6-addresses.html) command and set `--ipv6-prefixes` to the prefix. AWS selects IPv6 addresses from this range. In the following example, the prefix CIDR is 2600:1f13:fc2:a700:18bb::/80. @@ -183,0 +233,39 @@ Use the [assign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/ap +PowerShell + + +###### To assign automatic IPv4 prefixes to an existing network interface + +Use the [Register-EC2PrivateIpAddress](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2PrivateIpAddress.html) cmdlet and set `Ipv4PrefixCount` to the number of IPv4 prefixes for AWS to assign. In the following example, AWS assigns one IPv4 prefix. + + + Register-EC2PrivateIpAddress ` + -NetworkInterfaceId 'eni-00d577338cEXAMPLE' ` + -Ipv4PrefixCount 1 + +###### To assign specific IPv4 prefixes to an existing network interface + +Use the [Register-EC2PrivateIpAddress](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2PrivateIpAddress.html) cmdlet and set `Ipv4Prefix` to the prefix. AWS selects IPv4 addresses from this range. In the following example, the prefix CIDR is 10.0.0.208/28. + + + Register-EC2PrivateIpAddress ` + -NetworkInterfaceId 'eni-00d577338cEXAMPLE' ` + -Ipv4Prefix '10.0.0.208/28' + +###### To assign automatic IPv6 prefixes to an existing network interface + +Use the [Register-EC2Ipv6AddressList](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2Ipv6AddressList.html) cmdlet and set `Ipv6PrefixCount` to the number of IPv4 prefixes for AWS to assign. In the following example, AWS assigns one IPv6 prefix. + + + Register-EC2Ipv6AddressList ` + -NetworkInterfaceId 'eni-00d577338cEXAMPLE' ` + -Ipv6PrefixCount 1 + +###### To assign specific IPv6 prefixes to an existing network interface + +Use the [Register-EC2Ipv6AddressList](https://docs.aws.amazon.com/powershell/latest/reference/items/Register-EC2Ipv6AddressList.html) cmdlet and set `Ipv6Prefix` to the prefix. AWS selects IPv6 addresses from this range. In the following example, the prefix CIDR is 2600:1f13:fc2:a700:18bb::/80. + + + Register-EC2Ipv6AddressList ` + -NetworkInterfaceId 'eni-00d577338cEXAMPLE' ` + -Ipv6Prefix '2600:1f13:fc2:a700:18bb::/80' + @@ -221 +309 @@ You can use the [unassign-ipv6-addresses](https://awscli.amazonaws.com/v2/docume -Use the [unassign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/unassign-private-ip-addresses.html) command and set `--ipv4-prefix` to the address that you want to remove. +Use the [unassign-private-ip-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/unassign-private-ip-addresses.html) command and set `--ipv4-prefix` to the prefix CIDR to remove. @@ -230 +318 @@ Use the [unassign-private-ip-addresses](https://awscli.amazonaws.com/v2/document -Use the [unassign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/unassign-ipv6-addresses.html) command and set `--ipv6-prefix` to the address to remove. +Use the [unassign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/unassign-ipv6-addresses.html) command and set `--ipv6-prefix` to the prefix CIDR to remove. @@ -236,0 +325,21 @@ Use the [unassign-ipv6-addresses](https://awscli.amazonaws.com/v2/documentation/ +PowerShell + + +###### To remove IPv4 prefixes from a network interface + +Use the [Unregister-EC2PrivateIpAddress](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2PrivateIpAddress.html) cmdlet and set `Ipv4Prefix` to the prefix CIDR to remove. + + + Unregister-EC2PrivateIpAddress ` + -NetworkInterfaceId 'eni-00d577338cEXAMPLE' ` + -Ipv4Prefix '10.0.0.208/28' + +###### To remove IPv6 prefixes from a network interface + +Use the [Unregister-EC2Ipv6AddressList](https://docs.aws.amazon.com/powershell/latest/reference/items/Unregister-EC2Ipv6AddressList.html) cmdlet and set `Ipv6Prefix` to the prefix CIDR to remove. + + + Unregister-EC2Ipv6AddressList ` + -NetworkInterfaceId 'eni-00d577338cEXAMPLE' ` + -Ipv6Prefix '2600:1f13:fc2:a700:18bb::/80' +