Opkg update not possible due to missing connection

I installed openWRT as explained here.

After installation, I have connected the router LAN 1 (not WAN) via cable to my fritzbox. I then tried to update or to install luci, but failed:

root@OpenWrt:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/package                                                             s/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/pac                                kages/Packages.gz

Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base                                /Packages.gz

Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci                                /Packages.gz

Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/pack                                ages/Packages.gz

Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/routing/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/rout                                ing/Packages.gz

Downloading http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony/Packages.gz
Failed to establish connection
*** Failed to download the package list from http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/base/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/luci/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/packages/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/routing/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

 * opkg_download: Failed to download http://downloads.openwrt.org/snapshots/packages/mipsel_24kc/telephony/Packages.gz, wget returned 4.
 * opkg_download: Check your network settings and connectivity.

I reached the router via the IPv6 adress that the fritzbox gave me. So the router surely is connected to the fritzbox. There are also no restrictions. Still it seems it does not get any internet connection. What am I doing wrongly?

Since you've connected via your OpenWrt router's LAN port, did you:

  1. Set a static IP address that is in the same subnet as your main network (but not conflicting with any other devices and outside the DHCP range)
  2. Set the gateway and DNS on the OpenWrt LAN interface?
  3. turn off DHCP on your OpenWrt router?

Please copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

cat /etc/config/network
cat /etc/config/dhcp

Many thanks.

Set a static IP address that is in the same subnet as your main network (but not conflicting with any other devices and outside the DHCP range)
Set the gateway and DNS on the OpenWrt LAN interface?
turn off DHCP on your OpenWrt router?

No, I did neither of these. I am very new to openWRT.
Can I just edit the text files? What services do I have to restart after that? Or do I just reboot?
I am even new to vi, but I guess I will get along with this guide.


~# cat /etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd12:0e2f:0661::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'lan1 lan2'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'wan'
        option ifname 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'wan'
        option proto 'dhcpv6'
# cat /etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'
        option loglevel '4'

root@OpenWrt:~#

What is the subnet of the upstream network? (i.e. what IP address do you get on a computer that is connected to your main router?)

I get 192.168.103.44. The gateway (fritzbox) is at http://192.168.103.1/.

So how do I have to adapt the config?

Before we discuss how to adapt your config (which is fairly simple), let's first make sure the intent/purpose is known. What will your OpenWrt router be doing on your network? Will it be simply providing better wifi coverage (i.e. a dumb AP) or do you have some other goals for it?

1 Like

The /etc/config/network file you have posted is in the old configuration syntax which suggests version 19 or older. You should be running the latest version which is 22.03.0 at this time. If you've upgraded from an old version, reset the configuration to defaults to get all the files up to the new standards.

I followed the instructions on github and there was the old version of openwrt (. I think the easiest to upgrade is with internet connection.

@psherman: Very good point. I want to use it as a simple AP in a mesh network. Fritzbox is the gateway and its wifi is off. I think I simply use the script from onemarcfifty to realize that. I just hope it works with the old notation that mk24 mentioned.

not necessarily. In fact, the best way is to simply download 22.03 to your computer, then run the upgrade from there. It makes sense to do this before you make any configuration changes and when you run the update, do not keep settings. Then you can configure your device.

I think you're looking for the dumb AP configuration -- just follow the wiki for the process (if you notice that the syntax is significantly different on your device after you upgrade, stop and post your configs here so we can help you through it).

FWIW, a mesh network is one that has wireless backhaul -- yours is not a mesh if you are using a wired connection between the dumb AP and the main router.