This article will guide you on how to assign multiple IP addresses to a single NIC in Ubuntu OS. Now you can allocate multiple IP addresses to a single NIC.
To change your IP address on #Linux, use the "ifconfig" command followed by the name of your network interface and the new IP #address to be changed on your computer.
To assign the subnet mask, you can either add a "netmask" clause followed by the subnet mask or use the CIDR notation directly.
The ifconfig command can be used from the #command line either to assign an address to a #network interface or to configure or display the current network interface configuration information.
The ifconfig command must be used at system startup to define the network address of each interface present on a machine.
To determine my IP address in Linux :
ifconfig -a.
ip addr (ip a).
hostname -I | awk '{print $1}'.
ip route get 1.2.
nmcli -p device show.
To add secondary IP address permanently on Ubuntu system, just edit /etc/network/interfaces file and add the requires IP details.
Verify the newly added IP address. # ifconfig eth0
https://linuxapt.com/blog/96-how-to-assign-multiple-ip-addresses-to-single-nic-in-ubuntu-20-04-lts