橋接模式:
1.確認本地連線有橋接虛擬機器網路卡:
2.使用 ipconfig -all 檢視電腦網路配置:
3.修改VMware 虛擬網路配置裡面選擇橋接模式:
橋接網路卡選擇本地連線裡面匹配的網路卡
修改centos7 網路配置: CentOS7.2 設定靜態ip
先找到配置檔案:
[root@localhost bin]# cd /etc/sysconfig/network-scripts
[root@localhost network-scripts]# ls
ifcfg-eno16777736 ifdown-ppp ifup-ib ifup-Team
ifcfg-lo ifdown-routes ifup-ippp ifup-TeamPort
ifdown ifdown-sit ifup-ipv6 ifup-tunnel
ifdown-bnep ifdown-Team ifup-isdn ifup-wireless
ifdown-eth ifdown-TeamPort ifup-plip init.ipv6-global
ifdown-ib ifdown-tunnel ifup-plusb network-functions
ifdown-ippp ifup ifup-post network-functions-ipv6
ifdown-ipv6 ifup-aliases ifup-ppp
ifdown-isdn ifup-bnep ifup-routes
ifdown-post ifup-eth ifup-sit
[root@localhost network-scripts]# gedit ifcfg-eno16777736
複製程式碼
開始配置是:
TYPE="Ethernet"
BOOTPROTO="dhcp"
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="157c8fb5-23b3-414c-8519-25bef9b20a54"
DEVICE="eno16777736"
ONBOOT="yes"
複製程式碼
修改成:
TYPE="Ethernet"
#BOOTPROTO="dhcp"
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="157c8fb5-23b3-414c-8519-25bef9b20a54"
DEVICE="eno16777736"
#ONBOOT="yes"
#static assignment
NM_CONTROLLED=no #表示該介面將通過該配置檔案進行設定,而不是通過網路管理器進行管理
ONBOOT=yes #開機啟動
BOOTPROTO=static #靜態IP
IPADDR=192.168.1.122 #本機地址
NETMASK=255.255.255.0 #子網掩碼
GATEWAY=192.168.1.1 #預設閘道器
複製程式碼
修改/etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
GATEWAY=192.168.1.1
DNS1=119.29.29.29
DNS2=182.254.116.116
複製程式碼
然後重啟服務即可
service network restart
複製程式碼