- Assign Multiple IP Address to Single LAN Card is called IP Aliasing
- IP Aliasing is useful for create virtual websites on Apache or Nginx.
- The main advantage of IP Alias is, you don’t have to purchase new LAN Card for each ip address.
Setup Network Alias
- Let’s assume that we want to attach two ip address (192.168.0.10 & 192.168.0.11) to the eth0 NIC card.
/-----------------------------------------\
| Adaptor IP Address Type |
|------------------------------------------
| eth0 192.168.0.9 Primary |
| eth0:0 192.168.0.10 Alias 1 |
| eth0:1 192.168.0.11 Alias 2 |
\-----------------------------------------/
Temporary Setup
NOTE!: Above chnages lost when you restart system or reload/restart network service.
Permantly Setup
RedHat/CentOS
- Let’s copy the Primary NIC configuration file.
- Open
ifcfg-eth0
and view the contents.
- We have to modify DEVICE and IPADDR parameter for our virtual network interface (eth0:0 & eth0:1)
Debian/Ubuntu
- Open
/etc/network/interfaces
file and view the contents.
- We have to add following line to setup virtual network interface (eth0:0 & eth0:1)
NOTE!: Once, you’ve made all changes, save all your changes and restart the network service for the changes to reflect.
Verify Network Alias
Post Navigation
Disable IPv6 How to Fix Webroot Permissions