CentOS how to add multiple IP addresses to the existing network interface, this is also known as “adding a network alias”. Please note – this is not a tutorial for adding an second interface, it adds an additional IP address to the existing network card.
This article is useful for the following:
- CentOS add IP address
- Adding a second IP address in CentOS
- CentOS add multiple IP addresses
- Add IP address to interface
CentOS Add Second IP Address
1
|
|
Copy the existing network script:
1
|
|
After you have copied the file open it and edit it to look like:
1 2 3 4 |
|
Obviously enter your IP address information, I don’t think type=ethernet is actually required.
Confirm the IP address information is correct and restart the network service:
1
|
|
When the service restarts you should be able to access your server via the new IP address.
Note, you can add multiple IP addresses to the same interface in CentOS by creating fcfg-eth0:1, fcfg-eth0:2, fcfg-eth0:3 and so on…