How to configure an OpenWrt's network without a luci?

I'm composing a minimal OpenWrt image using ImageBuilder.
I use the next packages: base-files, busybox, netifd, fstools, mtd_20, mtd-utils-flash-erase, mtd-utils-nandwrite, mtd-utils-mtdinfo.
I'm able to boot with this image and perform some work, but I'm not able to wget anything (I'm getting an error: Network is unreachable).

Output of ifconfig -a:

root@(none):/# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 3C:98:72:F9:C6:75  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:486 errors:0 dropped:3 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:114064 (111.3 KiB)  TX bytes:2139 (2.0 KiB)
          Interrupt:3 

lo        Link encap:Local Loopback  
          LOOPBACK  MTU:65536  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:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

There's no IP address assigned for the eth0 interface. Why? How the IP gets assigned? (I though that some dhcp located in my network provides this IP and it does it, for other devices and for this device with a 'full' OpenWrt image.)

Within OpenWrt documentation, about network, I've found a lot of references to a luci paclage, so the question is - how this package relates to the network configuration and is it possible (relative simple) to avoid using of this luci package?

Most of your package selections seem unusual to me. Would you post the command line/file you used to configure the build?

Network configuration is primarily done in /etc/config/network LuCI is not needed if you understand the format and can work with vi or otherwise edit the files.

If those are the only packages you have installed, you may not have a DHCP client, which is required to use DHCP.

1 Like

Most of your package selections seem unusual to me. - the purpose of this image is to download several images and flash them to the flash memory, thus perform some custom upgrade.

Would you post the command line/file you used to configure the build? - there are nothing unique - after all packages got built and a rootfs image got composed I, using logic from ImageBuilder with some no-important changes, compose the image based on that set of packages and flash it to a device.

Generally, the problem, I'm trying to solve, is OTA upgrading from one firmware (with one set of partitions) to an another firmware (with another set of partitions) on some devices powered by OpenWrt. Using the old firmware, I download the image I composed (from this specif set of packages :slight_smile: ), flash it, change a boot order and reboot a device. After the reboot that image performs all steps to finish the upgrading (download some images and flash them to appropriate places).

If those are the only packages you have installed, you may not have a DHCP client, which is required to use DHCP. - thanks a lot :slight_smile: - this what I needed (udhcpc, in my case, is a DHCP client built as a part of busybox, it just wasn't started....)

Please use the Quote tool when quoting someone, and keep the Pre-formatted text tool when including code and the likes. (Pre-formatted text tool can also be used within the Quote tool if you are quoting the code within someone's post.

2 Likes

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