How to add additional IP address
Centos 7 - How to add additional IP address
For adding additional IP address to your server running CentOS, you need to do the following.
1. Connect via ssh to our server. Create file /etc/sysconfig/network-scripts/ifcfg-eth0:0 with the following content:
DEVICE=eth0:0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.11
NETMASK=255.255.255.255
(IPADDR and NETMASK data use those that you received when ordering an IP address)
2. It can be done using next commands. Go to the network-scripts directory: cd /etc/sysconfig/network-scripts/. Then create a new file:
# nano ifcfg-eth0:0
3. After that, restart the network service:
service network restart
We execute ifconfig, we see that eth0:0 has appeared.
eth0:0 Link encap:Ethernet HWaddr 00:11:22:33:44:55
inet addr:192.168.0.11 Bcast:192.168.0.11 Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:185 Base address:0xa000
Adding an additional IP address is completed.