OpenWRT:软件更新 wget 返回“网络不可达”

OpenWRT:软件更新 wget 返回“网络不可达”

我在 TP-Link Wifi 扩展器(TL-WA850RE v1)上安装了 OpenWRT [Barrier Breaker 14.07 / LuCI Trunk (0.12+svn-r10530)],虽然它充当简单的接入点,但 DHCP 和 DNS 由 LAN 以太网端口提供。

当我尝试更新列表从系统 > 软件,OpenWRT 返回:

wget: can't connect to remote host (78.24.191.177): Network is unreachable
wget: can't connect to remote host (78.24.191.177): Network is unreachable
wget: can't connect to remote host (78.24.191.177): Network is unreachable
wget: can't connect to remote host (78.24.191.177): Network is unreachable
wget: can't connect to remote host (78.24.191.177): Network is unreachable
wget: can't connect to remote host (78.24.191.177): Network is unreachable
wget: can't connect to remote host (78.24.191.177): Network is unreachable
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/base/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/luci/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/packages/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/routing/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/telephony/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/management/Packages.gz, wget returned 1.
 * opkg_download: Failed to download http://downloads.openwrt.org/barrier_breaker/14.07/ar71xx/generic/packages/oldpackages/Packages.gz, wget returned 1.

我已经寻找某种解决方案但我可能完全找不到答案。

您对于该做什么有什么建议吗?

谢谢

root@OpenWrtTPLinkExtender:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr C0:4A:00:XX:XX:XX  
          inet addr:192.168.1.39  Bcast:192.168.1.254  Mask:255.255.255.0
          inet6 addr: fdab:194c:3d6f::1/60 Scope:Global
          inet6 addr: fe80::c24a:ff:feca:fc8e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:299698 errors:0 dropped:161107 overruns:0 frame:0
          TX packets:15676 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:27303300 (26.0 MiB)  TX bytes:2435288 (2.3 MiB)

eth0      Link encap:Ethernet  HWaddr C0:4A:00:XX:XX:XX  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6595727 errors:0 dropped:2 overruns:0 frame:0
          TX packets:6632247 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1859579896 (1.7 GiB)  TX bytes:2735120766 (2.5 GiB)
          Interrupt:4 

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:196 errors:0 dropped:0 overruns:0 frame:0
          TX packets:196 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:16714 (16.3 KiB)  TX bytes:16714 (16.3 KiB)

wlan0     Link encap:Ethernet  HWaddr C0:4A:00:XX:XX:XX  
          inet6 addr: fe80::c24a:ff:feca:fc8e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6648389 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6648114 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2739930267 (2.5 GiB)  TX bytes:1991025874 (1.8 GiB)

root@OpenWrtTPLinkExtender:~# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 br-lan
root@OpenWrtTPLinkExtender:~# 

答案1

您的接入点似乎无法连接到互联网,因为没有配置默认网关。
目前,您可以运行此命令,以便临时连接:

route add default gw 192.168.1.1 eth0

稍后,192.168.1.1在网络配置中将其设置为默认网关。

我假设 192.168.1.1 是您的路由器 IP,如果不是,请相应地进行更改。

答案2

正如 @davidbaumann 所报告的,您的问题是缺少“默认网关”:没有 DEF-GW,您就无法访问本地子网以外的任何内容。

更详细地说,即使您的设备作为“无线扩展器”销售,OpenWrt 也能够完全识别 LAN 接口(eth0)和 WLAN 接口(wlan0)(...因此,它可以是 WLAN 和 LAN 之间的无线“路由器”路由)。

回到你的问题:OpenWrt 创建了一个虚拟接口 (br-lan),看起来像一个连接 eth0 和 wlan0 的双端口以太网交换机。由于 br-lan,来自 eth0 的所有流量都将转发到 wlan0,反之亦然(来自 wlan0 的所有流量都将转发到 eth0)

不幸的是,不清楚谁为 br-lan 分配了 IP 配置:它可能是由 DHCP 分配的,也可能是由您在 openwrt 配置中静态定义的。

如果您手动配置了 IP 参数,那么您可能错过了默认网关:您可以在“网络”=>“接口”=>br-lan=>“IPv4 网关”中检查它

如果您的 LAN 上有一个 DHCP 服务器,并且您的 TP-Link 从中获取了一个 IP...那么您的 DHCP 服务器和/或两个主机之间的 DHCP 协商可能有问题。

文件 /etc/config/wireless 和 /etc/config/network 可以帮助您更好地理解配置的细节(有时,从标准 Web 界面无法立即获得这些信息)。

相关内容