centos 7 如何配置虛擬IP

2021-07-22 13:25:34 字數 699 閱讀 3431

在有些時候我們可能需要使用到虛擬ip(vip)

首先我們可以使用命令:

ip addr
檢視目前使用的網絡卡名字,以及現在的ip。

如上圖所示,eno16777736便是目前的網絡卡名字。

接下來修改配置檔案

vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

或vi /etc/sysconfig/network-scripts/ifcfg-配置_1

哪個檔案裡面有內容就是哪個

找到 

在後面即可新增虛擬ip,如:

ipaddr1=192.168.1.214
然後退出,儲存。

重啟網絡卡。

systemctl restart network
接下來在使用命令:

ip addr
就會發現多了乙個虛擬ip了

CentOS7如何配置靜態IP

進入 etc sysconfig network scripts ifcfg ifcfg 是你的無限網絡卡的名字 sudo vim ifcfg 新增如下配置 ip位址和閘道器要根據所連wifi或以太配置.type ethernet proxy method none browser only no ...

centos7新增虛擬IP

1.在網路配置檔案中新增虛擬ip,vi etc sysconfig network scripts ifcfg eno16777736 type ethernet bootproto static defroute yes peerdns yes peerroutes yes ipv4 failur...

虛擬機器centos7配置靜態IP

虛擬機器系統設定如下 網路設定如下 橋接模式 使用root登入或者使用su root 切換到root使用者下 1.輸入命令 vim etc sysconfig network scripts ifcfg ens33 2.修改內容如下 bootproto static onboot yes gatew...