CentOS 7 最小化安装后的注意事项(一)
2018-05-15 本文已影响135人
Mr_Barry

一、配置网络
在最小化安装后的CentOS7.* 中,网卡是默认关闭的,我们运维人员需要手动启用。
1.使用root用户,在shell中输入:
root@localhost:~# cd /etc/sysconfig/network-scripts
2.进入网卡配置文件目录,在shell中输入:
root@localhost:/etc/sysconfig/network-scripts# ls -l
3.显示目录下所有文件,找到网卡名对应的配置文件:

ifcfg-ens33 是我的网卡名
4.使用vi
编辑器打开网卡配置文件ifcfg-ens33
,在shell中输入:
root@localhost:/etc/sysconfig/network-scripts# ls -l

5.将网卡配置文件ifcfg-ens33中的ONBOOT=no
改为ONBOOT=yes
,然后保存当前修改,退出vi。
6.重启操作系统,在shell里面输入:
root@localhost:~# reboot
7.重启后验证网络是否开启,在shell中输入:
root@localhost:~# ip addr

8.安装ifconfig
命令,在shell输入:
root@localhost:~# yum install net-tools
9.安装完成后,使用ifconfig
命令查看网络状态:

10.使用ping
测试网络是否连通:

参考:Linux中国
博客:Barry’Blog