方法一
1、打开 vi /etc/sysconfig/network-scripts/ifcfg-eth0
(每个机子都可能不一样,但格式会是“ifcfg-eth数字”),把ONBOOT=no
,改为ONBOOT=yes
2、重启网络:service network restart
方法二
1、打开 vi /etc/resolv.conf
,增加nameserver 8.8.8.8
2、重启网络: service network restart
注意:
若提示
you need to be root to perform this command
表示没有root权限,需要在命令前加sudo
即可。
步骤二、
输入ifconfig
,提示命令不存在,
yum -y install net-tools
安装即可。
网友评论