OpenWRT no more IP connection "netifd" removed

Hello,
I unfortunately remove package "netifd" when I forced it to reinstall... it seems it has remove the package but not reinstall it...
Anyway I have no more access to my Router from nowhere: LAN or WAN side.
I connect to it in serial mode using telnet, I confirm that the package is no more part of the installed package. But now using the terminal I do not know how I could reinstall this package:

  • I have no more internet access on the router (opkg install failed)
  • I have no more IP access to the router (I tried to force an ip and connect the cable to my LAN, but no real success).
  • I am not sure to be able to copy using serial COM port.

If you have any idea?
Is there a native .ipk file in /rom directory ?
I even tried to launch the netifd from /rom/sbin... in case of :sweat_smile:

I found some netifd files inside /rom/lib/

root@router:/rom/lib/netifd# ll
drwxr-xr-x    4 root     root           238 Aug 19 16:01 ./
drwxr-xr-x   11 root     root           541 Aug 19 16:01 ../
-rwxr-xr-x    1 root     root            47 Aug 19 16:01 dhcp-get-server.sh*
-rwxr-xr-x    1 root     root          3145 Aug 19 16:01 dhcp.script*
-rwxr-xr-x    1 root     root          7133 Aug 19 16:01 dhcpv6.script*
-rw-r--r--    1 root     root         50508 Aug 19 16:01 hostapd.sh
-rw-r--r--    1 root     root          9760 Aug 19 16:01 netifd-proto.sh
-rw-r--r--    1 root     root          8031 Aug 19 16:01 netifd-wireless.sh
-rwxr-xr-x    1 root     root           238 Aug 19 16:01 ppp-down*
-rwxr-xr-x    1 root     root           551 Aug 19 16:01 ppp-up*
-rwxr-xr-x    1 root     root           833 Aug 19 16:01 ppp6-up*
drwxr-xr-x    2 root     root            61 Aug 19 16:01 proto/
-rw-r--r--    1 root     root           761 Aug 19 16:01 utils.sh
drwxr-xr-x    2 root     root            34 Aug 19 16:01 wireless/

I don't know if I can use it ? Are there the source file ? It does not look.
Thx for support
Cédric

first:

tail -n +1 /etc/config/*

and copy output to a text file (for a possible restoration of the configuration if necessary)

and:

1 Like

Thx, Yes I know, but I wanted to avoid reinstalling all for a missing package. I have a backup of all the conf.

Just re-flash the same firmware with sysupgrade, it preserves the settings by default.

2 Likes

Yes but I have plenty of additionnal packages like asterisk, wireguard, ... last time I passed long time to reinstall all, not all was also part of /etc/config/. I have also a couple of certificate I had to recreate.
I just wanted to find a easy way to recover my package from /rom or other without having to reinstall all.

test:

ifconfig eth0 192.168.1.1 netmask 255.255.255.0

or:

ip addr add 192.168.1.1/24 dev eth0
1 Like

Yes it was the first things I tried without success. I connected to all the WAN / LAN ports, but no communication.
I am trying to use COPY command of windows to transfer an .ipk , transfert succeed but... the router reboot, certainly it does not copy in / directory...

try booting into failsafe mode... remember, resetting to defaults is another step, so failsafe mode in general isn't a problem or risk to your installation.

Once booted into failsafe mode, you can mount root and then try copying the ipk file(s) that you've manually downloaded onto your PC over to the router using scp (recommend that you install it to /root/). I'm not sure that opkg will work in failsafe mode, but the idea is to get a file transfer to happen. Now, you can reboot and the files should still be in /root/, at which point you can use the serial terminal to attempt the installation.

Keep in mind that any dependencies will need to be manually installed along the way.

1 Like

Not really better in safe mode, I mount root but same issue.
I tried to configure both LAN1 and ETH0 interface with IP on my subnet but I still have no internet access.
I tried to copy "base-file*.ipk" from windows using COPY command, it is written file copied but I do not have it on my root file directory...
...

what device are you using for your OpenWrt system? If your system is using squashfs, it will boot from ROM and therefore it will have the default configuration (the lan address of the router will be 192.168.1.1/24 with the DHCP server off; connect via ethernet to a computer with a static IP address in the same subnet -- for example, 192.168.1.10/24).

ubus call system board

But you seem at least have LAN access now?
Then SSH-connect to it via LAN-port, save your stuff, reset and reapply stuff. Takes less than 10 minutes:

  1. to save a full list of you custom installed package names:
install_time=$(opkg status kernel|awk '$1=="Installed-Time:" {print $2}');opkg status|awk '$1=="Package:" {package=$2} $1=="Status:" {user_inst=/ user/ && / installed/} $1=="Installed-Time:" && $2!='$install_time' && user_inst {print package}'|sort|sed ':a;N;$!ba;s/\n/ /g'
  1. you already seem to have a backup of your OpenWRT config

  2. check that your cert files (and what ever else you need) has been extracted as well

1 Like

Yes finally I access to the router throught LAN.
I performed a new backup using "sysupgrade" , listed all my packages using your command line and performed a firstboot && reboot.

At restart it was ok, my concern was when I installed the new packages (the one in my "installed package") , their installation came with the last version so I faced to the same issue I had with wireless package when I updated and faced to issue.
I decided to migrate to the last version RC4... I faced to new dependency issue... but anyway I fixed it after.
So thanks for support :slight_smile: !

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.