Let's now look at the concepts of binding and bonding.
The process of assigning a server more than one IP address on the same network card is known as binding. There may be cases where the same server is hosting services, which are defined on separate IP addresses. Let's see how we can bind multiple IP addresses to our Ubuntu Server.
Go to the /etc/network/interfaces
file and add the following lines:
auto eth0:0 iface eth0:0 inet static address 192.168.1.104 netmask 255.255.255.0 auto eth0:1 iface eth0:1 inet static address 192.168.1.240 netmask 255.255.255.0
The first line in the code snippet is for adding a device. We then specify the address to be static and also mention the IP address. Note you have to mention the netmask. It is mandatory. The file will look similar to the following screenshot:
Now, we need to enable these addresses using the ifup
command:
sudo ifup eth0:0 sudo ifuo eth0:1
To verify this, ping these IP addresses from external machines on the same...