Centos configure multiple virtual IP

Centos configure multiple virtual IP

Temporary settings###

ifconfig enp2s0:3192.168.3.152 netmask 255.255.255.0 up 

Permanently effective###

TYPE=Ethernet 
BOOTPROTO=none 
NAME=enp2s0 
DEVICE=enp2s0 
HWADDR=40:8d:5c:bc:f4:d8 
ONBOOT=yes 
IPADDR0=192.168.3.200 
PREFIX0=24 
GATEWAY0=192.168.3.254 
IPADDR1=192.168.3.164 
PREFIX1=24 
IPADDR2=192.168.3.250 
PREFIX2=24 
IPADDR3=192.168.3.152 
PREFIX3=24

note:

(1) Only when multiple IPs are configured, IPADDR can be followed by a number

(2) Permanent effect can also be added by means of network card IP alias, that is, copy the network card configuration as an alias, rename the configuration of the network card alias, modify the configuration, and then restart the network.

The disadvantage is that there are more network card configuration files than the above method, and the configuration is relatively cumbersome.

(3) Restart the network card command: service network restart

Recommended Posts

Centos configure multiple virtual IP
Centos configure multiple virtual IP
Centos7 configure IP address
Configure static IP under CentOS 7
Install CentOS7 virtual machine, configure docker suite
Centos7 configure JDK
Configure Ocserv on CentOS 6
ubuntu 14.04 configure 3-wire 3IP
Ubuntu18.04, Centos7 static IP
Configure lamp under centos6.8
Configure CentOS7 GPU environment
Tencent cloud centos 8.0 single network card configuration multiple IP
Centos: add an IP address
Linux CentOS 7 virtual machine clone
Centos6.5 install and configure mongodb
Configure swap space on CentOS7
VMwareWorkstation10.0 install CentOS7.0 virtual machine
CentOS 6.8 virtual machine installation details
Centos7 deploys python3 virtual environment
Ubuntu 18.04 uses elastic network card to configure multiple external network IP
Set static IP under Centos
CentOS 7 configure Java language development environment
Install and configure keepalived under CentOS 5.9
Configure rsyslog log client on CentOS
CentOS 6/7 configure sendEmail to send mail
CentOS 7 configure Ruby language development environment
CentOS 7 configure php language development environment
ubuntu modify and configure ip address
CentOS7.2 and Nginx configuration virtual host
CentOS 8 - install and configure NFS service
Configure python3 environment on centos7 and
CentOS Minimal install and configure TIPS
Install and configure FreeIPA in Centos7
CentOS 7 configure Python language development environment