Wednesday, April 19, 2023

How to add an additional IP address in Centos 7

Method -1:

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

service network restart

Method-2:

Run the following command
ipadd your_ip

Example: ipadd 192.168.0.1

No comments:

Post a Comment

How to inatall docker on Ubuntu using apt repository

 # Add Docker's official GPG key: sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyring...