Breaking

How to Add Secondary IP Address To RHEL/CentOS Network Interface




This guide will explain how to add a secondary IP address to a network interface on RHEL / CentOS server.

Here I have an network interface called ifcfg-ens5.

Step1: You can use ip addr command to find your network interface. The default interface is ifcfg-eth0

# ip addr

Step2: Create a secondary network configuration file called ifcfg-ens5:1 under /etc/sysconfig/network-scripts/ directory. Add below entries

# vim /etc/sysconfig/network-scripts/ifcfg-ens5:1


DEVICE=ens5:1
BOOTPROTO=static
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.10.1

Step3: Bring up Network Interface using ifup command

# ifup ens5:1

No comments:

Powered by Blogger.