CentOS 6.5 x64 新装系统minimal 的网络IP配置

虚拟机:Oracle VM VirtualBox 5.1.14
系统:CentOS 6.5 x64 minimal

1.ifconfig -a << 查看所有网卡的状态,确实没有配置IP等信息

CentOS 6.5 x64 新装系统minimal 的网络IP配置_第1张图片
Paste_Image.png

2. /etc/sysconfig/network-scripts/ifcfg-eth0 << 网卡配置文件路径

cd /etc/sysconfig/network-scripts/ <<跳到该目录
cp ./ifcfg-eth0 ./ifcfg-eth0.bak<<先做个备份
vi ./ifcfg-eth0 << 编辑网卡配置文件

CentOS 6.5 x64 新装系统minimal 的网络IP配置_第2张图片
Paste_Image.png

修改的部分:

ONBOOT=no 修改为 ONBOOT=yes <<是否随系统启动
BOOTPROTO=dhcp 修改为 BOOTPROTO=static <

增加的部分:
 IPADDR=192.168.10.111 << IP
 NETMASK=255.255.255.0 << 子网掩码
 GATEWAY=192.168.10.1 << 网关
 DNS1= 
 DNS2= 
 DNS配置根据当地网络供应商进行添加
实例:
CentOS 6.5 x64 新装系统minimal 的网络IP配置_第3张图片
Paste_Image.png

esc:wq <<保存退出

service network restart<<重启网络服务
ifconfig <<再次查看

CentOS 6.5 x64 新装系统minimal 的网络IP配置_第4张图片
Paste_Image.png
配置完毕!

DNS还可以在其他的文件进行配置
vi /etc/resolv.conf
加入
nameserver 202.96.128.166
nameserver 202.96.134.133
退出保存,重启网络服务。实际 /etc/resolv.conf 是自动调用之前网卡配置文件DNS配置信息。

你可能感兴趣的:(CentOS 6.5 x64 新装系统minimal 的网络IP配置)