Dlink DIR-867 LuCi flashing problem and cant connect to internet

Hi, Im new to both this forum and the OpenWRT community. I successfully flashed the factory firmware of OpenWRT to my D-link DIR-867 and can connect to my router via SSH. The next step I was going to do is install LuCi. The problem is that I cant connect to the internet so I cant use the opkg update command. I resorted to using WinSCP to copy the sysupgrade firmware and use opkg install luci command. It rebooted and I cant access LuCi. I can still access via SSH but how can I install LuCi so that it would be easier for me to configure everything? :grin:

Why can't you access internet from the router? Can that be fixed?

Did you try to copy LuCI packages and install them? Did you see any error?

Not sure. The WAN settings are untouched and are in DHCP mode.

I copied my router's corresponding sysupgrade firmware to the /tmp folder and
then using the opkg install luci command. I was not able to copy any of the messages before it restarted.

http://downloads.openwrt.org/snapshots/targets/ramips/mt7621/openwrt-ramips-mt7621-dlink_dir-867-a1-squashfs-sysupgrade.bin

How is your device connected to the internet? How did you connect before, or how do other devices connect?

To install LuCI without an internet connection, you must download the packages to your computer, copy them to the router, and then install them locally:

https://wiki.openwrt.org/doc/howto/luci.essentials#minimalistic.offline.installation

Tried reflashing the sysupgrade firmware, I copied the sysupgrade firmware on the /tmp folder via WinSCP again, and using SSH I typed opkg install luci but it resulted to opkg_install_cmd: Cannot install package luci.

What could be causing this?

you need to run opkg update first, but if you don't have a working internet connection it'll fail.

You cannot install individual packages from a sysupgrade file, you can only use it do a full system installation. And even if you could, that file contains the packages that are currently installed in your system, you cannot extract additional packages from it.

You need to download the specific packages for LuCI and install them, as explained in the links I provided.

Did I download everything correctly? I am a bit confused with which of the lua packages I should download.


image
image

If I were in your shoes, I'd use the snapshot Image Builder and bake luci into the image.

That's one of my problems, pinging public IPs and websites results to a 'bad address'

How can I do that? I'm a newbie I don't have an idea what that is.

The "opkg install ..." command will complain if there is any required package missing.

I got the results below using opkg install /tmp/luci-offline-packages/*.ipk;, I manually downloaded each file basing on the script

url="https://downloads.openwrt.org/snapshots/trunk/**${architecture}**/generic/packages/"

so I got this link

https://archive.openwrt.org/snapshots/trunk/ramips/generic/packages/

root@OpenWrt:~# opkg install /tmp/luci-offline-packages/*.ipk; done
-ash: syntax error: unexpected "done"
root@OpenWrt:~# opkg install /tmp/luci-offline-packages/*.ipk;
Unknown package 'liblua'.
Unknown package 'libubus-lua'.
Package libubus20191227 is already installed on root.
Unknown package 'libuci-lua'.
Unknown package 'lua-examples'.
Unknown package 'lua'.
Unknown package 'luac'.
Unknown package 'luci-base'.
Unknown package 'luci-lib-ip'.
Unknown package 'luci-lib-jsonc'.
Unknown package 'luci-lib-nixio'.
Unknown package 'luci-mod-admin-full'.
Installing luci-theme-bootstrap (git-17.341.69632-b7906fc-1) to root...
Unknown package 'rpcd-mod-file'.
Unknown package 'rpcd-mod-iwinfo'.
Unknown package 'rpcd-mod-rpcsys'.
Unknown package 'rpcd'.
Unknown package 'uhttpd-mod-lua'.
Unknown package 'uhttpd-mod-tls'.
Unknown package 'uhttpd-mod-ubus'.
Unknown package 'uhttpd'.
Configuring luci-theme-bootstrap.
uci: Entry not found
uci: Entry not found

uci: Entry not found


Collected errors:
 * pkg_hash_fetch_best_installation_candidate: Packages for liblua found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package liblua.
 * pkg_hash_fetch_best_installation_candidate: Packages for libubus-lua found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package libubus-lua.
 * pkg_hash_fetch_best_installation_candidate: Packages for libuci-lua found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package libuci-lua.
 * pkg_hash_fetch_best_installation_candidate: Packages for lua-examples found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package lua-examples.
 * pkg_hash_fetch_best_installation_candidate: Packages for lua found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package lua.
 * pkg_hash_fetch_best_installation_candidate: Packages for luac found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package luac.
 * pkg_hash_fetch_best_installation_candidate: Packages for luci-base found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package luci-base.
 * pkg_hash_fetch_best_installation_candidate: Packages for luci-lib-ip found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package luci-lib-ip.
 * pkg_hash_fetch_best_installation_candidate: Packages for luci-lib-jsonc found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package luci-lib-jsonc.
 * pkg_hash_fetch_best_installation_candidate: Packages for luci-lib-nixio found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package luci-lib-nixio.
 * pkg_hash_fetch_best_installation_candidate: Packages for luci-mod-admin-full found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package luci-mod-admin-full.
 * pkg_hash_fetch_best_installation_candidate: Packages for rpcd-mod-file found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package rpcd-mod-file.
 * pkg_hash_fetch_best_installation_candidate: Packages for rpcd-mod-iwinfo found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package rpcd-mod-iwinfo.
 * pkg_hash_fetch_best_installation_candidate: Packages for rpcd-mod-rpcsys found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package rpcd-mod-rpcsys.
 * pkg_hash_fetch_best_installation_candidate: Packages for rpcd found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package rpcd.
 * pkg_hash_fetch_best_installation_candidate: Packages for uhttpd-mod-lua found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package uhttpd-mod-lua.
 * pkg_hash_fetch_best_installation_candidate: Packages for uhttpd-mod-tls found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package uhttpd-mod-tls.
 * pkg_hash_fetch_best_installation_candidate: Packages for uhttpd-mod-ubus found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package uhttpd-mod-ubus.
 * pkg_hash_fetch_best_installation_candidate: Packages for uhttpd found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package uhttpd.

and if you ping, instead of using DNS lookups ?

ping 8.8.8.8 for instance ...

root@OpenWrt:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: sendto: Network unreachable

Ok,

and how are things connected ?

Your 867 to ..... ?

My 867's WAN port is connected to my router from my ISP via DHCP.

What's the subnet your ISPs router's providing ? usually 192.168.x

And what IP are you getting on the WAN port of the 867 ?
you can probably run ifconfig in ssh to get that.

I suspect you're getting this error:

Are you sure you downloaded the right packages?

I already did that on my 867 since my ISP's router is set at 192.168.1.1. I tried it again but I still cant ping anything outside LAN(like 8.8.8.8). Though my laptop says it has internet connection which is confusing.

root@OpenWrt:~# uci show network
network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.packet_steering='1'
network.lan=interface
network.lan.type='bridge'
network.lan.ifname='lan1 lan2 lan3 lan4'
network.lan.proto='static'
network.lan.netmask='255.255.255.0'
network.lan.ipaddr='192.168.2.1'
network.lan.ipv6='off'
network.wan=interface
network.wan.ifname='wan'
network.wan.proto='dhcp'
network.wan.ipv6='off'
network.wan6=interface