用ifconfig命令,只有lo,没有eth0的解决方案(用ipconfig命令找不到xshell中可以登录的IP地址的解决方案)

资料:

1.CentorOS6.5镜像:https://pan.baidu.com/s/1K_9GtdD62meK6_p9izrrgw 密码:u14w

2.VMware10 安装Centos6.5(64位) 详细步骤:https://blog.csdn.net/sgl520lxl/article/details/77725473

问题使用场景:

在VMware中安装完CentorOS6.5(64位)之后,输入ifconfig之后无法获取在xshell中登录的IP地址,如下图:

解决办法快速浏览:

1.进入/etc/sysconfig/network-scripts 目录

2.输入ifconfig -a命令,可显示eth0和lo。

3.输入ifconfig eth0 up,启用网卡。

4. 修改/etc/sysconfig/network-scripts/ifcfg-eth0 文件, 把ONBOOT=no 改为 ONBOOT=yes。

5. service network restart,重启。

6.ifconfig确认即可。

具体如下:

1. 进入/etc/sysconfig/network-scripts 目录,发现有ifcfg-eth0,即网卡(驱动)存在但未启用。

2. 输入ifconfig -a命令,可显示eth0和lo。

3. 输入ifconfig eth0 up,启用网卡。此时用ifconfig,只能看到inet6(ipv6?)的地址,没有inet的地址(即Xshell连接输入的ip)。

4. 修改/etc/sysconfig/network-scripts/ifcfg-eth0 文件, 把ONBOOT=no 改为 ONBOOT=yes,即表示在系统时自动启动

5. service network restart,重启。出现shutdown eth0 OK,bring up eth0 OK,determine ip for eth0 OK。

6. 输入ifconfig,出现eth0的inet地址。即可用Xshell连接。

7.之后就用Xshell工具连接就可以啦,亲测没有问题。

参考地址:https://www.cnblogs.com/w10234/p/5632170.html

猜你喜欢

转载自blog.csdn.net/zxljsbk/article/details/82222717