centos安裝完預設是沒有網路連線的, 需要手動配置一下
1.進入network_scripts目錄
cd /etc/sysconfig/network_scripts/
2.修改ifcfg-ems33檔案
vi ifcfg-ems33
3.修改配置
hwaddr=00:0c:29:8d:24:73
type=ethernet
bootproto=static #啟用靜態ip位址
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=ae0965e7-22b9-45aa-8ec9-3f0a20a85d11
onboot=yes #開啟自動啟用網路連線
ipaddr0=192.168.21.128 #設定ip位址
prefixo0=24 #設定子網掩碼
gateway0=192.168.21.2 #設定閘道器
dns1=8.8.8.8 #設定主dns
dns2=8.8.4.4 #設定備dns
centos7配置IP位址
在配置網路之前我們先要知道centos的網絡卡名稱是什麼,centos7不再使用ifconfig命令,可通過命令 ip addr檢視,如圖,網絡卡名為ens32,是沒有ip位址的 1 動態獲取ip 前提是你的路由器已經開啟了dhcp 修改網絡卡配置檔案vi etc sysconfig network...
Centos7 配置ip位址
注 虛擬機器ping不通主機 可能是主機的防火牆忘關了,虛擬機器關閉自己的防火牆 systemctl stop firewalld 修改網絡卡命名規則 企業中為了方便管理,網絡卡必須按照特定的規則進行命名。eth 0 n 修改 etc default grub配置檔案中的內容 grub cmdlin...
centos7下修改網路配置IP位址閘道器DNS等
root gaojingbo ip a 改變eth0 方法一 root gaojingbo vim etc sysconfig network scripts ifcfg eth0 靜態 手工 name eth0 連線名 device eth0 裝置名 bootproto none 啟動協議 sta...