OpenWrt installation on Dell optiplex 3050 usff

How did you go with the installation i have one allso but seam i cant work out how to install it to the drive
any help would be appreciated ..got a ssd not a mvme

Thanks

install what on the drive ?

There are at least two ways to install OpenWrt on an x86 device with a SATA drive.

Method 1 (requires a USB-to-SATA cable). Take the SATA drive out of your device, download OpenWrt to your computer (your actual computer, not the machine you're converting into a router), connect the SATA drive to your computer's USB port (that's where the cable comes in), and write OpenWrt directly from the image onto the SATA drive using any image writing program (if you're on Windows, Rufus does this very well; if you're on Linux, you can use the good old dd on the command line; Etcher exists on both platforms; there are other options as well). Then, put the SSD back into your device, and it should start right away. Here's an example of how this is done (yes, I wrote this, so consider it shameless self-promotion):

If you decide to follow this example, change generic to 64 throughout the example.

Method 2 (requires a USB stick). Download OpenWrt to your computer and write it to the USB stick using one of the programs mentioned above (Rufus, dd, Etcher). Next, boot your device from the USB stick. When OpenWrt starts, download another copy of OpenWrt, unzip it, and write it to the SSD. Here's an example (yes, I wrote this one, too, so more shameless self-promotion):

Note that your device is different from the ones discussed in the examples, so be sure to do the investigative steps before applying the fixes. Also note that both of these examples use console; in your case, it's probably easier to connect a monitor and a keyboard to your router-to-be.

If you get stuck, post a note here on the forum. Give as much detail as you can about what you were doing, what you expected to happen, and what actually happened.

1 Like

Hi thanks for the reply i managed to install openwrt on a ssd i basically have this setup

Now my problem is this i have the onboard as wan ( that works np ) But a cant seam to get lan up and running on this

Now what am i doing rong i tried to have it running the other way around still nothing do i have to go into the open wrt and set it up in the gui if so whats the setup
Any help would be appreciated Thanks
i have no idea why

What does lspci say?

1 Like

@fubar do you have the package kmod-8169 installed ?
see here : Does OpenWrtx86 support Realtek 2.5Gbps Nics? (RTL8125B)

kmod-8169 should always be preinstalled, but the kernel- and OpenWrt version might not suffice, newer is better (so at least 22.03 with kernel 5.10, better snapshots with kernel 5.15; kernel 5.4 in 21.02 did not support it).

hi i just downloaded it ( Does OpenWrtx86 support Realtek 2.5Gbps Nics? (RTL8125B) - #2 by frollic ) from maurers link, now how do i go about installing it do i use putty or
do i just stick the ipk file on a usb and boot from that i am using ( openwrt-22.03.3-x86-64-generic-ext4-combined-efi.img) on a ssd
any guidance again is really appreciated guys
Thanks

Log into your router and do this:

cd /tmp 
wget https://downloads.openwrt.org/releases/22.03.2/targets/x86/64/kmods/5.10.146-1-5d4fa2bd675198961db287e63a2370e2/kmod-r8169_5.10.146-1_x86_64.ipk
opkg install kmod-r8169_5.10.146-1_x86_64.ipk

Come to think of it, you can probably get away with just this:

opkg install https://downloads.openwrt.org/releases/22.03.2/targets/x86/64/kmods/5.10.146-1-5d4fa2bd675198961db287e63a2370e2/kmod-r8169_5.10.146-1_x86_64.ipk

log in to the router via putty ..thats what you mean right and not through the gui

I will give this a go later today or tomorrow and i will let you know how it whent ... never know some one else might have the same situation and here is the solution
Thanks again for the Help

Ps this forum is awesome ( you guys dont make me feel stupid and i thank for that i am trying to learn about open wrt ...so i thank for that)

1 Like

OP is using 22.03.3 so needs

https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/kmods/5.10.161-1-9309db0b721b9fb3fe826181264a78c4/kmod-r8169_5.10.161-1_x86_64.ipk

However as @slh said, it comes with 22.03.3 already so no need to install?

@fubar before you do anything, can you SSH to your machine and provide the output of the following please? This will check if the driver is installed.

opkg list-installed | grep 8169
lspci

Btw., looking at the form factor of your device, I'd like to confirm - are we talking about a PCIe (kmod-8169) card or an external USB card (kmod-usb-net-rtl8152)? The former would be preinstalled, the later needs to be installed manually.

2 Likes

Good catch, thank you! I just used the package URL from the post the OP was referring to, and it didn't occur to me to check for version. My apologies to the OP.

1 Like

Refering to the ebay link, it's a M.2 card with both A and E notches.
So i assume it's most likely a PCIe device.

Yes. Although there's a way to do it via LuCI, too. It just takes longer to explain... :smile:

Please note that I inadvertently gave you the package URL for the wrong version, (see message by @d687r02j8g above). I copied it from the post you linked to and didn't check whether it was relevant to your version; my bad.

Also, if you're on Windows, these days, you can do SSH both from the Windows Command Prompt and from the PowerShell. Just open one or the other and type:

ssh root@192.168.1.1

This, of course, is the default IP address. If you changed it on your router, use your IP address instead.

You can also do this with a monitor and a keyboard attached to your router. The disadvantage is that you can't cut and paste stuff; you have to retype everything. But it tends to work even when all else fails... :smile:

how can i shh if i have no lan and only wan ... i cant even download

https://downloads.openwrt.org/releases/22.03.3/targets/x86/64/kmods/5.10.161-1-9309db0b721b9fb3fe826181264a78c4/kmod-r8169_5.10.161-1_x86_64.ipk

yet i can ping google etcc np ...so what is it im doing wrong
A ip of 192.168.1.1 pops up when i put
Uci show network ... yet no lan ... the lights on the Nic come on jsut no one is home ( link is up then down)

Thanks guys i am trying to figure this out with the help of you guys patience and help
Thanks you

Do you have a monitor and keyboard plugged into a machine?

You can run the same commands and show us the output.

2 Likes

If OpenWrt only detects one Ethernet port at first boot, it will configure that port as lan. It's IP address will be 192.168.1.1 and a DHCP server will be active.

Note that if you've installed additional hardware or drivers after the first boot so now more ports are available, the new ports aren't automatically configured to do anything. Use ip link show to see how many ports are actually registered in the kernel.

If only one port is presently usable and you need access to the Internet, the router can be configured as a LAN device. This is the same setup as a dumb AP except there is no wireless involved.

lspci (once installed) would show you the vendor:product ID of the M.2 card, if the card is detected. This can be checked against vendor:product IDs that are registered in the r8169 driver. The vendor:product of every PCI device also appears in the boot log, but it is kind of hard to parse out.

3 Likes

I am assuming that you have a monitor and a keyboard connected to your router, so you're able to control your router that way. If so, start by figuring out what you have available right now.

First, as @mk24 advises, take a look at the output of ip link. It will show you what interfaces are available. My guess is, you will see two, lo and eth0. lo (the loopback) is always there no matter what (to oversimplify, the router uses it to talk to itself when it has to); eth0 is the important one for us right now.

Next, take a look at the output of ip a. It will show you, in addition to the previously available information, IP addresses (if any) associated with your interfaces. I am guessing that eth0 will be associated with IP address 192.168.1.1.

This is the default OpenWrt behavior; if only one interface is detected on first boot, that interface is designated as LAN. Otherwise, there's a possibility of a lockout (situation when no management interface is available and thus no administration is possible).

Next, take a look at your network configuration:

cat /etc/config/network

First two sections, config interface 'loopback' and config globals 'globals', are not important right now (they rarely are), so leave them be. See what comes next. If my guess is correct, there would be a section config interface 'lan', but no section config interface 'wan'.

If you see something different, stop and let us know what you're seeing.

If what you're seeing looks like what I described above, you need to redesignate your only operational interface as WAN. This will allow your router to go on the Internet and download things (and you will need a few).

To do that, open the network config for editing:

vi /etc/config/network

If you're new to vi, here's a one-paragraph crash course. When you first start it, vi works read-only. To switch to the editing (or insert) mode, press i on the keyboard (i for insert). When you're done editing, press Esc ; this will return you to the read-only mode. To exit, you need to be in the read-only mode. Press :x to save and exit or :q to exit without saving. This is the minimum vi skillset you will need.

Now that you know how to edit with vi, edit your network config. First two sections, config interface 'loopback' and config globals 'globals', are okay, so leave them be. Remove the rest of the file and replace it with the following:

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

This is almost self-explaining; you are telling OpenWrt that interface eth0 should be designated as WAN, and that your router should use DHCP in communicating with the upstream device (i.e., ask for an IP address). This is the most common setup by far.

When you're done editing, exit vi with saving (Esc, then, :x). You might want to verify that your settings have changed. Just output the settings file on screen:

cat /etc/config/network

Next, restart the networking to switch to the new configuration you just created:

/etc/init.d/network reload

Now connect the only working port you have to the upstream router. Give your router a few moments to negotiate a connection, then test the connection. For example, run:

ping -c 3 google.com

If your connection works, you can start actually fixing things. :smile:

First, you need some more diagnostics. But you don't have the software for it yet. So let's get it:

opkg update && opkg install pciutils

opkg is OpenWrt's package manager. Here, we're asking it to do two things; first, go online and download an inventory of available packages, then, download and install a package called pciutils (PCI utilities). One of those utilities is lspci, which we are about to use.

When installation is finished, run:

lspci -nn

This will tell you which PCI devices your system has available. You should see both of your network cards (the one that's working and the one that's not) on that list. If you don't see the non-working card on the list, we have a problem; the card may be physically installed incorrectly (for example, it sits in a slot that is designated for SSDs only), or it is faulty, or it is not receiving power, or it is not a PCI card (there are cards that operate over USB).

If you do see the card on the list, you can go ahead and install drivers and/or firmware for it as previously described, and it should come up right away. Since you already have a WAN interface defined, OpenWrt will assume the new card is LAN. If the card has more than one port, the ports will be bridged into a single LAN. You will be able to see what OpenWrt has done (and change it if necessary) by using the ip command and viewing/editing the /etc/config/network file as you have already done by now.

Hope this helps.

Imagebuilder, including the online image builder, might be the easiest approach - but yes, just putting the files on a USB stick may work just as well.