Centos 7 configure multiple IP addresses [whether the independent server supports switching the main ip, you must communicate with the service provider, and you can select the server that supports switching the main ip]

Reference: https://www.cnblogs.com/gyfluck/p/9952112.html


#Open the network configuration file 
cd /etc/sysconfig/network-scripts/ vim ifcfg-eno167 [The file name may be different for different systems, please check the file with ip]

 

Default IPADDR is the primary IP

 

IPADDR="192.168.8.4"
PREFIX="24"
IPADDR1="192.168.8.5"
PREFIX1="24"
IPADDR2="192.168.8.6"
PREFIX2="24"
GATEWAY="192.168.8.1"
After the configuration is completed, the network must be restarted to take effect
​​​​​​​service network restart

 

Guess you like

Origin blog.csdn.net/weixin_43343144/article/details/109214357