我有一台分区的联想 R500,装有 Windows XP(32 位)和 Linux Poseidon(64 位)。将 Linux 升级到较新的 Ubuntu 14.04 版本后,我无法上网,尽管它可以 ping 通(Windows 可以)。我重启了路由器,但没有任何反应。尝试了 wifi 和有线网络,但没有任何反应。我运行了以下代码:
lspci -nn -d 14e4: 04:00.0 Ethernet controller [0200]: Broadcom Corporation NetLink BCM5787M Gigabit Ethernet PCI Express [14e4:1693] (rev 02)
ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:22:68:0c:24:ec
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:17
eth1 Link encap:Ethernet HWaddr 00:11:6b:73:82:7b
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:5359 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:4399989 (4.3 MB) TX bytes:439491 (439.4 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:7659 errors:0 dropped:0 overruns:0 frame:0
TX packets:7659 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:602845 (602.8 KB) TX bytes:602845 (602.8 KB)
wlan0 Link encap:Ethernet HWaddr 00:22:fa:bd:96:76
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:518 errors:0 dropped:0 overruns:0 frame:0
TX packets:393 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74594 (74.5 KB) TX bytes:56006 (56.0 KB)
route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface
当我测试它是否能 ping 通时,似乎确实能:
ping -c3 91.189.94.12
PING 91.189.94.12 (91.189.94.12) 56(84) bytes of data.
64 bytes from 91.189.94.12: icmp_seq=1 ttl=52 time=50.0 ms
64 bytes from 91.189.94.12: icmp_seq=2 ttl=52 time=36.1 ms
64 bytes from 91.189.94.12: icmp_seq=3 ttl=52 time=54.7 ms
--- 91.189.94.12 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 36.147/46.977/54.733/7.892 ms
有什么方法可以解决这个问题吗?谢谢,XXXL
答案1
NetworkManager 是一个程序,它(通过 resolvconf 实用程序)将地址插入127.0.1.1
。resolv.conf
只有当 NM 配置为启动 dnsmasq 程序实例以充当本地转发名称服务器时,它才会插入该地址。该 dnsmasq 实例侦听地址 127.0.1.1 上的查询。
如果您不想使用本地转发名称服务器,则配置 NetworkManager 不启动 dnsmasq 实例,也不插入该地址。注释掉/etc/NetworkManager/NetworkManager.conf
以下行dns=dnsmasq
sudo nano /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq
并重新启动 NetworkManager 服务。
sudo restart network-manager
在这种模式下,NetworkManager 会进行更新/etc/resolv.conf
(仍通过 resolvconf)以包含 NetworkManager 用于活动连接的名称服务器地址。
如果您想禁用 resolvconf 机制来更新 resolv.conf 并仅使用静态 resolv.conf 文件,请执行以下操作。
sudo rm -f /etc/resolv.conf # Delete the symbolic link
sudo nano /etc/resolv.conf # Create static file
# Content of static resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8