Alias/Secondary IP Address


What is Alias/Secondary IP Address?

IP aliasing is the process of assigning several IP addresses to a network interface. It allows a single node on a network to have many network connections, each having a different purpose.

Multiple network addresses can be provided on a single physical interface using IP aliasing. One rationale for doing so could be to make a single computer appear to be several computers.

How to configure?

In Linux, to use IP aliasing, the Kernel must be compiled with network aliasing and IP options. Then the aliases would attach to the virtual network device or interface with a specific virtual number in a format −

Device: VirtualNumber

For example, eth0:0, eth0:1, etc.

So, if you want to have more than one IP address, then you have to increment the IP addresses and virtual numbers such as −

  • 192.168.1.2     eth0:1

  • 192.168.1.3     eth0:2

  • 192.168.1.4     eth0:3

Where are Secondary IP addresses used?

  • It's possible that a network section won't have enough host addresses. For example, your subnetting supports up to 200 hosts per logical subnet, but you need 240 host addresses on a single physical subnet. You can have two logical subnets utilising one physical subnet by employing secondary IP addresses on routers or access servers.

  • Another network could otherwise separate two subnets of the same network. When subnets are in use, this condition is not authorised. The first network is extended or layered on top of the second network using secondary addresses in these cases.

  • Depending on how you separate DNS names/services between them, using a Secondary IP Address can be handy for efficiently regulating traffic.

  • Various services can be allocated to distinct IPs if you want to partition resources across your IPs to use separate firewalling for access control or implement a QoS rule.

Why should you IP aliasing and secondary IP addresses?

  • IP Aliasing eliminates the need for several NICs (Network Interface Cards) to configure multiple IP addresses, reducing configuration time and cost.

  • You can consolidate applications and web pages on a single server without having to change the application code.

  • It's also handy for setting up several virtual sites on Linux Web Servers like "Apache" using a single network interface with various IP addresses on a single subnet network, which is known as IP based virtual hosting.

IP Aliasing has no drawbacks, and its use is entirely dependent on your needs, as you can select an endless number of secondary numbers. However, if you wish to expand the number of hosts, it is recommended to use Secondary IP only in Corner Case Scenarios because it generates more broadcast traffic.

Updated on: 07-Sep-2021

839 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements