VMware下centos橋接模式靜態ip配置

2022-07-08 20:36:12 字數 1486 閱讀 5307

宣告:本文**自非原創。

一、配置虛擬機器centos網路

備份網路檔案

[root@localhost network-scripts]# cd /etc/sysconfig/network-scripts/[root@localhost network-scripts]# cp ifcfg-eno16777736 ifcfg-eno16777736.bak
備份後的目錄:

編輯ifcfg-eno16777736

type=ethernet  

bootproto=static

defroute=yes

peerdns=yes

peerroutes=yes

ipv4_failure_fatal=no

ipv6init=yes

ipv6_autoconf=yes

ipv6_defroute=yes

ipv6_peerdns=yes

ipv6_peerroutes=yes

ipv6_failure_fatal=no

name=eno16777736

uuid=f530db51-ff34-4244-b52a-020cf77d1680

device=eno16777736

onboot=yes

ipaddr0=192.168.100.100prefix0=24gateway0=192.168.100.1dns1=8.8.8.8dns2=8.8.4.4

下圖中紅色會修改的部分,藍色為新增的部分:

特別注意:gateway的拼寫!!!不要拼寫成gatway!!!

[root@localhost network-scripts]# service network restart  //

重啟服務

二、配置本機網路

配置完畢,ping一下測試:

總結:該種方式實現了本機與虛擬機器centos系統網路互通,若想讓虛擬機器上網,則將「編輯 ifcfg-eno16777736」地方中藍色框部分配置為你本地網路即可。

VMware橋接模式下centos修改靜態ip

修改檔案ifcfg eth33 vim etc sysconfig network scripts ifcfg eth33 device eth33 onboot yes bootproto static ipaddr 192.168.81.129 ip位址同主機位址在同一網段 netmask 25...

vmware下的橋接設定

在主機上搭建了linux虛擬機器,開始使用的是nat模式,這是後虛擬機器 ip 192.168.226.188 和宿主主機 192.168.1.109 不在同乙個網段,但是虛擬機器是通過宿主主機和外界通訊的 要是把宿主的網路關閉,虛擬機器和外界也不能通訊。儘管宿主主機和虛擬機器能相互通訊,同乙個區域...

centos下docker網路橋接

停止服務 停止docker0網絡卡 ip link set dev docker0 down 刪除docker0 brctl delbr docker0 進入到網絡卡的配置檔案建立橋接網路br0 brctl addbr br0 設定為啟動狀態 ip link set dev br0 up 給br0配...