You can now add a secondary (or more) virtual NICs to your instance with the "
manage-instance" tool. The "
add-nic" command adds a network interface card (NIC) with a specified IP address to the instance.
--forceoptional parameter to use a reserved IP address.
remove-niccommand removes a NIC with specified IP address from instance. Please make sure the NIC is not in use before removing it from instance. Details are below.
manage-instance add-nic --instance-id NYM1:417 --ip 18.104.22.168 --username <USERNAME> manage-instance remove-nic --instance-id NYM1:417 --ip 22.214.171.124 --username <USERNAME>
You can change the IP address of an interface with the "
manage-instance modify-nic" command. There is no need to have two network interfaces on an instance to run this command.
--force" optional parameter to assign a previously reserved IP address (via "
manage-vlan reserve" command). In common case you can use any available for your VLAN IP ( issuie "
manage-vlan list" command to list all your IPs).
manage-instance modify-nic --instance-id NYM1:417 --from-ip 126.96.36.199 --to-ip 188.8.131.52 --username <USERNAME>
After adding a new virtual network interface card (NIC) to an instance with the "
manage-instance add-nic" command, you must ask your instance's operating system to recognize it. This "activation process" fetches the settings for a new NIC from the DHCP server. We strongly recommend not doing this manually, but instead creating a NIC configuration file. The configuration file will allow DHCP harvesting for a new NIC automatically after an instance restart.
First SSH to the instance where you wish to activate a network interface, then follow the relevant instructions below.
If you have launched the instance from our standard CentOS5-based image or from your custom image based on a CentOS-like system, then create a file
...ethN with N > 1 if you create many interfaces on the same instance) with the following contents:
DEVICE=eth1 BOOTPROTO=dhcp DHCPCLASS= ONBOOT=yes
Instruct every interface to use its own subnet in Address Resolution Protocol (ARP) requests by opening the /etc/sysctl.conf file and adding the following:
and then issue the "
ifup eth1" command.
The only difference for Debian Linux is in adding networking interfaces. Open file
/etc/network/interfaces and add the following lines for every additional interface you are setting up (eth1, eth2, ethN, ...):
auto eth1 iface eth1 inet dhcp
If you have launched an instance from your custom non-CentOS-like image, then perform the necessary steps to instruct the operating system to fetch DHCP settings for the newly appeared interface
eth1, and bring this interface up.
Unfortunately adding/deleting virtual network interfaces are supported on Linux instances only for now. Our API team is working on adding this feature to the Windows CLI.
Deleting a NIC ("
manage-instance remove-nic") is allowed for a running instance, although we recommend taking the instance offline first for simplicity. This is because the instance will define one of the interfaces as the default interface, used to transfer outgoing traffic from the instance. Each activation will transfer the "default route" setting to the latest activated interface. However, the DHCP interface configuration facility causes a re-configuration of interfaces periodically independent of instance restart, so the default interface is not always predictable.
If you remove the default interface from a running instance, any other interfaces become unavailable. For this reason, we recommend taking your instance offline before removal.
To delete a NIC from a running instance, you can avoid losing connectivity after deleting one of the NICs by making sure that the default connectivity route is assigned to the NIC that will remain on the instance after another NIC(s) deletion.
To do this, please:
dhclient ethN" command, using any interface that will remain on the instance after removing others.
After removing a NIC, we advise not deleting its config file until after the next instance restart, because after a restart all VNICs will become renumbered so that they will form uninterrupted sequence starting with 0.
For example, if you have created 5 NICs on an instance, and then removed NICs #0, #1 and #3, you will get VNICs #2 and #4 remaining. After an instance restart, these NICs will be numbered as #0 and #1. If you've deleted the configfiles for interfaces #0, #1 and #3 after NIC deletion, your instance will not be available, because renumbered interfaces #0 and #1 could not find their configfiles.
To avoid this: