一、正常情况

输入命令:ifconfig

敲击enter键后,显示如下结果:

Linux ifconfig 地址127.0.0.1的解决

eth0中,int addr后面的就是Linux服务器的IP地址。


二、只显示eth0,IP显示为127.0.0.1,解决办法如下

linux系统中输入命令:vi  /etc/sysconfig/network-scripts/ifcfg-eth0 ,然后显示如下结果

注意:需要先切换到根路径

Linux ifconfig 地址127.0.0.1的解决

将其中的ONBOOT=no改为yes,然后ESC,输入 :wq 敲击enter保存并退出

最后输入命令: service network restart(重启服务命令)

重启服务器,会出现正在配置IP的提示,待自动配置成功后,输入命令ifconfig即可.


ip地址显示下图

Linux ifconfig 地址127.0.0.1的解决

需更改虚拟机设置为

Linux ifconfig 地址127.0.0.1的解决

最后输入命令: service network restart


原文地址:https://blog.csdn.net/draven1122/article/details/75063739


相关文章:

  • 2021-11-24
  • 2021-12-04
  • 2021-05-16
  • 2022-12-23
  • 2021-12-04
  • 2021-07-07
  • 2021-09-16
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2021-12-16
  • 2021-05-20
  • 2021-09-11
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案