Centos 6 / 7
CentOS works with an interface file per physical connection. You can find the interface files in: /etc/sysconfig/network-scripts/ifcfg-xx. Where xx is the name of the interface. If your interface is called eth0, we will create a file for eth0:1. We recommend to use ‘nano’ to edit the file:
Copy all the text below and add this to the opened file, adjust the highlighted so it fits your situation:
Note: the device is called eth0:1, while the file is also called eth0:1. This is intentional. When you exit the text editor you can apply the changes by using the following command:
Should you want to add more static addresses you can follow the logic and add the next static IP on eth0:2.
If you are unsure if your configuration is correct feel free to contact us here.