有线网络已连接并获取 IP 地址,但互联网无法正常工作

有线网络已连接并获取 IP 地址,但互联网无法正常工作

有一天,我的网络在没有任何警告的情况下完全瘫痪了。我以为可能是调制解调器或路由器的问题(调制解调器有点不可靠,无法处理太多连接);但问题并不出在这两个方面。

由于图形驱动程序混乱,我不得不重新安装 Linux 系统(这是我的错,我做错了一些事情,无法让它再次工作)。但我的有线连接无法连接到互联网。我确实有一个 IP 地址、子掩码、IPV6 地址,背面以太网端口上的灯正在用绿色和橙色 LED 传输数据,而且我的 WiFi 连接仍然正常工作。

我已经发布了我的 inxi 输出、syslog 和 ifconfig。如果有人能就此给我一些建议,那就太好了。

INXI-Fxn 输出如下:

System: Host: hydr4 Kernel: 3.8.0-35-generic i686 (32 bit, gcc: 4.7.3) 
       Desktop: Xfce 4.10.2 (Gtk 2.24.16) Distro: Linux Mint 15 Olivia
Machine:   System: Compaq-Presario product: RR501AA-ABU SR2129UK
       Mobo: ASUSTek model: LEONITE version: 5.00 Bios: Phoenix version: 5.10 date: 01/30/2007
CPU: Dual core Intel Core2 CPU 6300 (-MCP-) cache: 2048 KB flags: (lm nx sse sse2 sse3 ssse3 vmx) bmips: 7469.08 
       Clock Speeds: 1: 1600.00 MHz 2: 1867.00 MHz
Graphics:  Card: NVIDIA GF119 [GeForce GT 610] bus-ID: 01:00.0 
       X.Org: 1.13.3 drivers: nvidia (unloaded: fbdev,vesa,nouveau) Resolution: [email protected], [email protected] 
       GLX Renderer: GeForce GT 610/PCIe/SSE2 GLX Version: 4.3.0 NVIDIA 310.44 Direct Rendering: Yes
Audio: Card-1: Intel NM10/ICH7 Family High Definition Audio Controller driver: snd_hda_intel bus-ID: 00:1b.0
       Card-2: NVIDIA GF119 HDMI Audio Controller driver: snd_hda_intel bus-ID: 01:00.1
       Sound: Advanced Linux Sound Architecture ver: k3.8.0-35-generic
Network: Card-1: Intel NM10/ICH7 Family LAN Controller driver: e100 ver: 3.5.24-k2-NAPI port: ef00 bus-ID: 02:08.0
       IF: eth0 state: up speed: 100 Mbps duplex: full mac: 00:1a:92:69:c7:f1
       Card-2: Realtek RTL8187 Wireless Adapter driver: rtl8187 usb-ID: 0bda:8187
       IF: wlan0 state: down mac: 00:c0:ca:75:44:a7

IFCONFIG 输出:

eth0  Link encap:Ethernet  HWaddr 00:1a:92:69:c7:f1  
      inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::21a:92ff:fe69:c7f1/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:419 errors:0 dropped:0 overruns:0 frame:0
      TX packets:386 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:33431 (33.4 KB)  TX bytes:44861 (44.8 KB)

系统日志:

Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) starting connection 'Wired connection 1'
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> (eth0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) scheduled...
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) started...
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) scheduled...
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 1 of 5 (Device Prepare) complete.
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) starting...
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> (eth0): device state change: prepare -> config (reason 'none') [40 50 0]
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) successful.
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) scheduled.
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 2 of 5 (Device Configure) complete.
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) started...
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> (eth0): device state change: config -> ip-config (reason 'none') [50 70 0]
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Beginning DHCPv4 transaction (timeout in 45 seconds)
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> dhclient started with pid 4698
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Beginning IP6 addrconf.
Feb  8 12:14:19 hydr4 avahi-daemon[1221]: Withdrawing address record for fe80::21a:92ff:fe69:c7f1 on eth0.
Feb  8 12:14:19 hydr4 avahi-daemon[1221]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::21a:92ff:fe69:c7f1.
Feb  8 12:14:19 hydr4 avahi-daemon[1221]: Interface eth0.IPv6 no longer relevant for mDNS.
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Feb  8 12:14:19 hydr4 dhclient: Internet Systems Consortium DHCP Client 4.2.4
Feb  8 12:14:19 hydr4 dhclient: Copyright 2004-2012 Internet Systems Consortium.
Feb  8 12:14:19 hydr4 dhclient: All rights reserved.
Feb  8 12:14:19 hydr4 dhclient: For info, please visit https://www.isc.org/software/dhcp/
Feb  8 12:14:19 hydr4 dhclient: 
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> (eth0): DHCPv4 state changed nbi -> preinit
Feb  8 12:14:19 hydr4 dhclient: Listening on LPF/eth0/00:1a:92:69:c7:f1
Feb  8 12:14:19 hydr4 dhclient: Sending on   LPF/eth0/00:1a:92:69:c7:f1
Feb  8 12:14:19 hydr4 dhclient: Sending on   Socket/fallback
Feb  8 12:14:19 hydr4 dhclient: DHCPREQUEST of 192.168.1.100 on eth0 to 255.255.255.255 port 67 (xid=0x760a69a9)
Feb  8 12:14:19 hydr4 dhclient: DHCPACK of 192.168.1.100 from 192.168.1.1
Feb  8 12:14:19 hydr4 dhclient: bound to 192.168.1.100 -- renewal in 3099 seconds.
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> (eth0): DHCPv4 state changed preinit -> reboot
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info>   address 192.168.1.100
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info>   prefix 24 (255.255.255.0)
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info>   gateway 192.168.1.1
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info>   nameserver '192.168.1.1'
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Configure Commit) scheduled...
Feb  8 12:14:19 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) started...
Feb  8 12:14:19 hydr4 avahi-daemon[1221]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.100.
Feb  8 12:14:19 hydr4 avahi-daemon[1221]: New relevant interface eth0.IPv4 for mDNS.
Feb  8 12:14:19 hydr4 avahi-daemon[1221]: Registering new address record for 192.168.1.100 on eth0.IPv4.
Feb  8 12:14:19 hydr4 kernel: [  970.652409] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:a0:f3:c1:5b:80:c4:08:00 SRC=192.168.1.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Feb  8 12:14:20 hydr4 NetworkManager[1233]: <info> (eth0): device state change: ip-config -> secondaries (reason 'none') [70 90 0]
Feb  8 12:14:20 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 5 of 5 (IPv4 Commit) complete.
Feb  8 12:14:20 hydr4 NetworkManager[1233]: <info> (eth0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Feb  8 12:14:20 hydr4 NetworkManager[1233]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
Feb  8 12:14:20 hydr4 NetworkManager[1233]: <info> Writing DNS information to /sbin/resolvconf
Feb  8 12:14:20 hydr4 dnsmasq[1472]: setting upstream servers from DBus
Feb  8 12:14:20 hydr4 dnsmasq[1472]: using nameserver 192.168.1.1#53
Feb  8 12:14:20 hydr4 avahi-daemon[1221]: Joining mDNS multicast group on interface eth0.IPv6 with address fe80::21a:92ff:fe69:c7f1.
Feb  8 12:14:20 hydr4 avahi-daemon[1221]: New relevant interface eth0.IPv6 for mDNS.
Feb  8 12:14:20 hydr4 avahi-daemon[1221]: Registering new address record for fe80::21a:92ff:fe69:c7f1 on eth0.*.
Feb  8 12:14:25 hydr4 kernel: [  977.312309] [UFW BLOCK] IN=eth0 OUT= MAC=01:00:5e:00:00:01:a0:f3:c1:5b:80:c4:08:00 SRC=192.168.1.1 DST=224.0.0.1 LEN=32 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Feb  8 12:14:34 hydr4 NetworkManager[1233]: <info> Activation (eth0) successful, device activated.
Feb  8 12:14:34 hydr4 dbus[1143]: [system] Activating service name='org.freedesktop.nm_dispatcher' (using servicehelper)
Feb  8 12:14:34 hydr4 dbus[1143]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Feb  8 12:14:37 hydr4 nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/01ifupdown' took too long; killing it.
Feb  8 12:14:37 hydr4 NetworkManager[1233]: <warn> Dispatcher script timed out: Script '/etc/NetworkManager/dispatcher.d/01ifupdown' timed out.
Feb  8 12:14:39 hydr4 NetworkManager[1233]: <info> (eth0): IP6 addrconf timed out or failed.
Feb  8 12:14:39 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) scheduled...
Feb  8 12:14:39 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) started...
Feb  8 12:14:39 hydr4 NetworkManager[1233]: <info> Activation (eth0) Stage 4 of 5 (IPv6 Configure Timeout) complete.

IFCONFIG WLAN0 已连接:

eth0      Link encap:Ethernet  HWaddr 00:1a:92:69:c7:f1  
          inet6 addr: fe80::21a:92ff:fe69:c7f1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:165 errors:0 dropped:1 overruns:0 frame:0
          TX packets:272 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:26568 (26.5 KB)  TX bytes:40779 (40.7 KB)

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

wlan0     Link encap:Ethernet  HWaddr 00:c0:ca:75:44:a7  
          inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::2c0:caff:fe75:44a7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1806 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1959 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1369477 (1.3 MB)  TX bytes:376277 (376.2 KB)

IFCONFIG ETH0 已连接:

eth0      Link encap:Ethernet  HWaddr 00:1a:92:69:c7:f1  
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21a:92ff:fe69:c7f1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:171 errors:0 dropped:1 overruns:0 frame:0
          TX packets:326 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:27505 (27.5 KB)  TX bytes:49977 (49.9 KB)

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

wlan0     Link encap:Ethernet  HWaddr 00:c0:ca:75:44:a7  
          inet6 addr: fe80::2c0:caff:fe75:44a7/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:1908 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2066 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1392844 (1.3 MB)  TX bytes:463109 (463.1 KB)

答案1

你可以静态地通过执行以下操作设置您的 IP 地址 -

  • 转至文件夹/etc/网络/

  • 您可以看到一个名为接口

  • 只需将其备份到安全的地方并在 gedit 中打开即可

  • 最初该文件可能包含以下内容

    auto lo
    iface lo inet loopback
    
  • 现在将以下内容添加到文件中

    auto lo
        iface lo inet loopback
    auto eth0
        iface eth0 inet static
        address 192.168.1.108
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        dns-nameservers 8.8.8.8 208.67.222.222
    
  • 输入所有必需的详细信息并保存文件(以上所有详细信息均为示例)

  • 现在通过在终端中输入以下命令来重新启动网络服务

    sudo service networking restart
    
  • 笔记:对于 wifi 你只需更换eth0经过wlan0

相关内容