Alias/Secondary IP Address

In the context of IP Addressing, Aliasing refers to the process of creating and configuring multiple IP addresses on a single Network Interface. By having aliased IP addresses, you can create multiple connections to a network for an individual node on a network where each connection can serve for a different purpose.

Features of Secondary IP Address :
IP Aliasing gives way to a new concept of Secondary IP addresses, which means that you can configure multiple Secondary IP Addresses on same interface which has primary IP address. This allows you to specify an unlimited number of secondary addresses to any network interface which if required can be detached from a Virtual Machine Instance.

Example –
In GCP we can configure a primary and at the same time,a secondary CIDR Range as a part pf a subnet:

  • Configure 10.1.0.0/16 as a primary CIDR Range
  • Configure 10.2.0.0/20 as a secondary CIDR Range

Here, primary IP Address of Virtual Machine is allocated from primary CIDR range, whereas an alias IP range, 10.2.1.0/24, is allocated in VM from secondary CIDR range.

Note –
The addresses in alias IP range are used as IP addresses of containers hosted in VM.



Applications :
Some most common applications of Secondary IP Address include:

  • Secondary IP address is a good option to be used in case of hosting sites on a dedicated IP with SSL certificate because if you are using HTTPS, you need an IP per website.
  • If you wish to split resources across your IP’s so that you can apply different firewalling for access control or put in some QoS rule, then various services can be assigned to different IP’s.
  • Using a Secondary IP Address can be useful for controlling traffic easily depending on how you segregate DNS names/services between them.

For Instance, you can configure a secondary IP to your Device Interface or a Linux Environment if you have 2 IP subnets within same VLAN and wish to expand it when one subnet is exhausted or to migrate the default gateway of a host from one address to another.

Advantages :

  • The use of IP Aliasing reduces need of multiple NIC’s (Network Interface Cards) to configure multiple IP’s which in turn reduces configuration time as well as cost.
  • It is also very useful in setting up multiple virtual sites on Linux Web Servers such as “Apache” using one single network interface with different IP addresses on a single subnet network, what we basically call as IP based virtual hosting.
  • You have freedom to consolidate applications and web pages on a single server without changing application code.

Disadvantages :
As such there are no disadvantages of IP Aliasing and it’s used completely depends upon your requirement because you can specify an unlimited number of secondary addresses. But on other hand, it is suggested to use Secondary IP only in Corner Case Scenarios as it generates more broadcast traffic if you want to increase number of hosts.

Also, secondary addresses do not support DHCP. The router will insert it’s primary interface IP address into DHCP request and remote server will never see a request for secondary subnet.

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.