我想知道我的linux(虚拟机)的IP地址 但是当我输入 ifconfig 时它不会返回 IP 地址。
通常它应该在“link encap”和“up Broadcast”之间,但事实并非如此。 去哪里看?
最佳答案
您的虚拟机有互联网连接吗?在我看来,它没有配置接口(interface)。
快速尝试一下,在 shell 中编写“dhclient eth0”。
如果仍然没有 IP,请发布 ifconfig 的输出。
关于linux ifconfig 不返回 IP 地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19661208/