我最近在我的开发机器上安装了Debian squeeze,每一件事情都很顺利我昨天能够连接到互联网,我把硬盘移到另一台机器上,我无法连接到Debian的互联网,但是我可以连接到它使用Windows XP。
我尝试了以下命令,但没有使用不工作
/etc/init.d/networking restart /var/log/syslog doesn't show any error ping www.google.com results no host found
更多细节
使用ifconfig
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:39 errors:0 dropped:0 overruns:0 frame:0 TX packets:39 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:13737 (13.4 KiB) TX bytes:13737 (13.4 KiB)
netstat -rn
Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface
cat /etc/resolv.conf
domain Home search Home nameserver 192.168.1.1 nameserver 192.168.1.1
的/ etc /networking/接口
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface allow-hotplug eth0 iface eth0 inet dhcp
ifconfig -a
eth1 Link encap:Ethernet HWaddr 6c:f0:49:f6:45:ae BROADCAST MULTICAST MTU:1500 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:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:26 Base address:0x6000 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:70 errors:0 dropped:0 overruns:0 frame:0 TX packets:70 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:18029 (17.6 KiB) TX bytes:18029 (17.6 KiB)
你的/etc/network/interfacesconfiguration为eth0但是你没有eth0而是eth1 。
udev试图静态命名以太网卡,通过分配一个半永久的名字卡第一次看到他们。 你可以通过从/etc/udev/rules.d/70-persistent-net.rules删除以name=eth0结尾的行和以name=eth0结尾的行来从你以前的以太网卡中删除eth0的“保留” name=eth1 。 然后在下一次重新启动(或者当您运行udevadm trigger )时,您的以太网卡将被半永久分配eth0。
您也可以通过运行ip link set name eth0 dev eth1临时将eth1更改为eth0,然后在/etc/init.d/networking stop ; /etc/init.d/networking start /etc/init.d/networking stop ; /etc/init.d/networking start会让你回到networking上。
你的描述是不够的。 你需要提供更多的信息来帮助你更好的。
作为一个猜测,我可以说,移动高清驱动器到另一台机器后,您的主要networking接口已经改变。 所以,你需要使用ifconfig -a来检查接口名称。 然后,可以编辑networking接口configuration文件/etc/network/interfaces以匹配新名称。 完成后,可以执行/etc/init.d/networking restart 。