
我沒有 eth0 介面(或 eth1)。
ifconfig -a
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:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
tunl0 Link encap:UNSPEC HWaddr 00-00-00-00-31-00-00-00-00-00-00-00-00-00-00-00
NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
我的/etc/network/interfaces
:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# Wireless interfaces
iface wlan0 inet dhcp
wireless_mode managed
wireless_essid any
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
iface atml0 inet dhcp
# Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcp
# Ethernet/RNDIS gadget (g_ether)
#... or on host side, usbnet and random hwaddr
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
Bluetooth networking
iface bnep0 inet dhcp
當我嘗試時ifup eth0
(eth1 同上):
ifconfig: SIOCGIFFLAGS: no shuch device
我擁有的唯一 udev 規則是 in /etc/udev/rules.d/local.rules
,我對 eth* 一無所知。由於我不知道MAC位址,所以無法新增它。
答案1
問題很可能是(在虛擬機的情況下)您沒有指定網路接口,或者(更有可能 - 在實體機的情況下)Linux 不知道您的網卡,即它沒有,或者驅動程式未載入。
調試問題的適當信息是“dmesg”和“lspci -v”的輸出,它將告訴機器所看到的內容 - 但最重要的是你需要確保你的卡有一個 Linux 驅動程式並且正在加載 -這將(取決於您的發行版)導致「eth0」介面在dmesg 和ifconfig 等中可見。
由於您似乎沒有相關設備,lspci -v 可能有助於追蹤設備的實際情況。