A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-secondary-ip-addresses.html below:

Secondary IP addresses for your EC2 instances

Secondary IP addresses for your EC2 instances

The first IPv4 address assigned to a network interface is known as the primary IP address. Secondary IP addresses are additional IPv4 address assigned to a network interface. For more information, see Multiple IP addresses.

You can also assign multiple IPv6 addresses to an instance. For more information, see Manage the IPv6 addresses for your EC2 instances.

Assign secondary IP addresses to an instance

You can assign secondary IP addresses to the network interface for an instance as you launch the instance, or after the instance is running.

Console
To assign a secondary IP address at launch
  1. Follow the procedure to launch an instance. When you configure Network Settings, expand Advanced network configuration.

  2. For Secondary IP, choose Automatically assign and enter the number of IP addresses for Amazon EC2 to assign. Alternatively, choose Manually assign and enter the IPv4 addresses.

  3. Complete the remaining steps to launch the instance.

To assign a secondary IP address after launch
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Instances.

  3. Select your instance, and choose Actions, Networking, Manage IP addresses.

  4. Expand the network interface.

  5. To add an IPv4 address, under IPv4 addresses, choose Assign new IP address. Enter an IPv4 address from the range of the subnet, or leave the field blank to let Amazon EC2 choose one for you.

  6. Choose Save.

AWS CLI
To assign a secondary IP address at launch

Use the run-instances command with the --secondary-private-ip-addresses option.

--secondary-private-ip-addresses 10.251.50.12

To let Amazon EC2 choose the IP address, use the --secondary-private-ip-address-count option instead. The following example assigns one secondary IP address.

--secondary-private-ip-address-count 1

Alternatively, you can create a network interface. For more information, see Create a network interface for your EC2 instance.

To assign a secondary IP address after launch

Use the assign-private-ip-addresses command with the --private-ip-addresses option.

aws ec2 assign-private-ip-addresses \
    --network-interface-ids eni-1234567890abcdef0 \
    --private-ip-addresses 10.251.50.12

To let Amazon EC2 choose the IPv4 address, use the --secondary-private-ip-address-count parameter instead. The following example assigns one IPv4 address.

aws ec2 assign-private-ip-addresses \
    --network-interface-ids eni-1234567890abcdef0 \
    --secondary-private-ip-address-count 1
PowerShell
To assign a secondary IP address at launch

You must create a network interface. For more information, see Create a network interface for your EC2 instance.

To assign a secondary IP address after launch

Use the Register-EC2PrivateIpAddress cmdlet with the -PrivateIpAddress parameter.

Register-EC2PrivateIpAddress `
    -NetworkInterfaceId eni-1234567890abcdef0 `
    -PrivateIpAddress 10.251.50.12

To let Amazon EC2 choose the IPv4 addresses, use the -SecondaryPrivateIpAddressCount parameter instead. The following example assigns one IPv4 address.

Register-EC2PrivateIpAddress `
    -NetworkInterfaceId eni-1234567890abcdef0 `
    -SecondaryPrivateIpAddressCount 1
Configure the operating system to use secondary IP addresses

After you assign a secondary IP address to your instance, you must configure the operating system on your instance to recognize the additional private IPv4 address.

Linux instances Windows instances

For more information, see Configure secondary private IPv4 addresses for Windows instances.

Unassign a secondary IP address from an instance

If you no longer require a secondary IP address, you can unassign it from the instance or the network interface. When a secondary private IPv4 address is unassigned from a network interface, the Elastic IP address (if it exists) is also disassociated.

Console
To unassign a secondary private IPv4 address from an instance
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Instances.

  3. Select an instance, choose Actions, Networking, Manage IP addresses.

  4. Expand the network interface. For IPv4 addresses, choose Unassign for the IPv4 address to unassign.

  5. Choose Save.

AWS CLI
To unassign a secondary private IP address

Use the unassign-private-ip-addresses command.

aws ec2 unassign-private-ip-addresses \
    --network-interface eni-1234567890abcdef0\
    --private-ip-addresses 10.251.50.12
PowerShell
To unassign a secondary private IP address

Use the Unregister-EC2PrivateIpAddress cmdlet.

Unregister-EC2PrivateIpAddress `
    -NetworkInterface eni-1234567890abcdef0 `
    -PrivateIpAddress 10.251.50.12

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4