我在为我的机器分配静态 IP 时遇到问题。我是这个论坛的新手,也是 Linux 世界的新手,刚刚在虚拟机上安装了 Ubuntu Desktop LTS 14.04。当我检查ifconfig
终端时,它输出:
eth0 Link encap:Ethernet HWaddr 00:0c:29:70:91:81
inet addr:192.168.163.129 Bcast:192.168.163.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe70:9181/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:115 errors:0 dropped:0 overruns:0 frame:0
TX packets:163 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:30180 (30.1 KB) TX bytes:19458 (19.4 KB)
Interrupt:19 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:167 errors:0 dropped:0 overruns:0 frame:0
TX packets:167 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:13170 (13.1 KB) TX bytes:13170 (13.1 KB)
当我检查/etc/network/interfaces
文件时它包含:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
我猜这个文件中缺少 eth0,所以我应该怎么做?请指导我,任何帮助都将不胜感激。谢谢。