Last updated on February 1st, 2025 at 09:33 am
To add an additional IP to a server, follow these steps:
- Login to your Server via SSH Terminal
- Make sure you are logged in as the root user
- Run the following command: cd/etc/sysconfig/network-scripts/
- View current Network Adapters by running ls ifcfg*
- Note that the servers’ primary IP displays as “ifcfg-eth0” and “ifcfg-lo”
- Additional IPs on the server displays as “ifcfg-eth0:0”, “ifcfg-eth0:1”,
- To add an additional IP please run the command cp ifcfg-eth0 ifcfg-eth0:0
- Edit the ifcfg-eth0:0 configuration file by running vi ifcfg-eth0:0
- On the configuration file edit to change the “IPADDR” value to the new IP address and the “DEVICE” value to eth0:0
- Save the changes and exit the editor
- For changes to take effect and the IP to be recognized within the network run the following command
- /etc/init.d/network restart
Adding a Second and a Subsquent Additional Ip
– Just repeat the Processs
- Run the command cp ifcfg-eth0 ifcfg-eth0:0
- To open and edit the configuration file
- Run the command vi ifcfg-eth0:0
- On the configuration file edit to change the “IPADDR” value to the new IP address and the “DEVICE” value to eth0:0
- Save the changes and exit the editor
- For changes to take effect and the IP to be recognized within the network run the following command
- /etc/init.d/network restart
Well done You Have now added additional IP to the Server