无法使用 Ubuntu 连接有线互联网

无法使用 Ubuntu 连接有线互联网

您好,我无法使用有线连接连接到互联网。我昨天可以使用有线网络。但我的 Flash Player 出现了问题,所以不得不重新安装 Ubuntu。我可以使用无线连接连接到互联网。但我需要连接到有线连接。我使用的是 Ubuntu 10。在我的 IPv4 设置中,它自动设置为 DHCP,我之前可以使用它进行连接。但现在似乎无法连接了。

$ ifconfig
eth0      Link encap:Ethernet  HWaddr 18:a9:05:22:cd:f9  
          UP 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:28 Base address:0x4000 

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:108 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8272 (8.2 KB)  TX bytes:8272 (8.2 KB)

wlan0     Link encap:Ethernet  HWaddr 00:26:82:3c:ac:27  
          inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::226:82ff:fe3c:ac27/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:204253 errors:0 dropped:0 overruns:0 frame:0
          TX packets:107610 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:299528765 (299.5 MB)  TX bytes:10274020 (10.2 MB)

syslog嘿,但是最近还有其他条目。

Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>  DHCP: device wlan0 state changed preinit -> bound
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) Stage 4 of 5 (IP4 Configure Get) scheduled...
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) Stage 4 of 5 (IP4 Configure Get) started...
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>    address 192.168.1.105
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>    prefix 24 (255.255.255.0)
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>    gateway 192.168.1.1
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>    nameserver '192.168.1.1'
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) Stage 5 of 5 (IP Configure Commit) scheduled...
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) Stage 4 of 5 (IP4 Configure Get) complete.
Aug 26 09:35:15 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) Stage 5 of 5 (IP Configure Commit) started...
Aug 26 09:35:15 saisriparasa-desktop avahi-daemon[902]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.105.
Aug 26 09:35:15 saisriparasa-desktop avahi-daemon[902]: New relevant interface wlan0.IPv4 for mDNS.
Aug 26 09:35:15 saisriparasa-desktop avahi-daemon[902]: Registering new address record for 192.168.1.105 on wlan0.IPv4.
Aug 26 09:35:16 saisriparasa-desktop NetworkManager: <info>  (wlan0): device state change: 7 -> 8 (reason 0)
Aug 26 09:35:16 saisriparasa-desktop NetworkManager: <info>  Policy set 'Auto OEGLLC' (wlan0) as default for routing and DNS.
Aug 26 09:35:16 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) successful, device activated.
Aug 26 09:35:16 saisriparasa-desktop NetworkManager: <info>  Activation (wlan0) Stage 5 of 5 (IP Configure Commit) complete.

输出dhclient

Listening on LPF/eth0/18:a9:05:22:cd:f9 
Sending on LPF/eth0/18:a9:05:22:cd:f9 
Listening on LPF/wlan0/00:26:82:3c:ac:27 
Sending on LPF/wlan0/00:26:82:3c:ac:27 
Sending on Socket/fallback 
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8 
DHCPOFFER of 192.168.1.105 from 192.168.1.1 
DHCPREQUEST of 192.168.1.105 on wlan0 to 255.255.255.255 port 67 
DHCPACK of 192.168.1.105 from 192.168.1.1 
bound to 192.168.1.105 -- renewal in 35073 seconds

答案1

连接电缆后立即检查“dmesg | tail”的输出。它应该显示有关 eth0 的消息。连接电缆后,还要使用“ps -ef | grep dhc”检查 dhcp 客户端是否正在运行。

如果您有 eth0 的 /etc/network/interfaces 定义,请在插入电缆的情况下尝试“ifdown eth0”命令,然后是“ifup eth0”。这应该会为您提供一个 IP 地址。您可以在 /etc/network/interfaces 中注释掉 eth0 的整个块,然后重新连接电缆以使用网络管理器配置。网络管理器会忽略由 /etc/network/interfaces 处理的端口。

答案2

这可能看起来很傻,但您应该检查的第一件事是电缆两端是否牢固插入。

相关内容