Converting a surplus x86 into an OpenWrt router

One would usually use the USB ethernet card for the WAN side, as the WAN connection is usually slower than LAN - so you wouldn't notice the USB inherent slowdown that much. In your case this obviously doesn't apply, I'd probably still use the USB for WAN anyways.

Another option would be to put the USB and the built-in into a bonded interface, connect up to a managed switch with link aggregation, and run VLANs on the bonded interface one for WAN and one for LAN :wink: that'd sort of split the difference across both LAN and WAN. The advantage of that is that if the USB gets disconnected or whatever, you'll fall back to just a slower connection. That's a nontrivial set-up however, so for starting purposes I'd recommend just WAN on USB and LAN on built-in.

Okay, thanks. You guys are great. Best forum I've been on in a long time. Thanks for the patients.

Ok folks.... Having trouble installing. I'm using Ubuntu live usb. From the terminal I CD to the directory of second usb with combined image (/media/Ubuntu/KINGSTON). Then I ran:
sudo zcat lede-17.01.4-x86-64-combined-ext4.img.gz > /dev/sda
I get bash /dev/sda: permission denied. I'm doing something wrong I suppose....duh

sda is a 252.9 GB SSD and sdb is a 111.8 GB mSata. I know it's overkill but that's what I installed when I put it together from barebones for win 10.

I get bitten by that all the time

sudo sh -c "zcat lede-17.01.4-x86-64-combined-ext4.img.gz > /dev/sda"

The first form doesn't do the redirect under sudo, just the zcat

So sudo sh -c first

And put the command into a string

      -c string If the -c option is present, then commands are read from string.  If there are arguments after the string,  they
                are assigned to the positional parameters, starting with $0.

The "natural" way to write it ends up with the shell executing sudo zcat lede-17.01.4-x86-64-combined-ext4.img.gz and the shell redirecting that command's output to /dev/sda, which as the user running the shell, you have no write access to.

I tried "sudo sh -c "zcat lede-17.01.4-x86-64-combined-ext4.img.gz"
Bash still denied. I don't understand.

More quotes there than I can figure out!

What's happening in sudo zcat lede-17.01.4-x86-64-combined-ext4.img.gz > /dev/sda is that the shell gets 5 tokens

  • sudo
  • zcat
  • lede-17.01.4-x86-64-combined-ext4.img.gz
  • >
  • /dev/sda

The > is "special" so the shell, running as "you", determines the command to execute is sudo and its two parameters are zcat and lede-17.01.4-x86-64-combined-ext4.img.gz. The > and /dev/sda tell the shell to open /dev/sda and replace the file descriptor for stdout with that for /dev/sda, then "call" sudo with the arguments of zcat and lede-17.01.4-x86-64-combined-ext4.img.gz. sudo never "sees" the tokens that set up the redirect.

In the second form, the shell sees:

  • sudo
  • sh
  • -c
  • zcat lede-17.01.4-x86-64-combined-ext4.img.gz > /dev/sda

(where that last one is not split up, as it is a single string)

So you end up having sudo running sh, which then splits up zcat lede-17.01.4-x86-64-combined-ext4.img.gz > /dev/sda and "does what you intended", inside of the sudo execution.

Ok.... Well what I want to do is put openwrt on /dev/sda. I have Ubuntu live usb running and the lede combined gunzip image on the second usb drive. Some of the tutorials I've been reading the last two days are a little vague. What command string would I run to install this to the drive?

Also, the one tutorial I was going by didn't say anything about formatting the drive. I think maybe that might be the problem?

You're overwriting the entire drive with a drive image I believe. The command, given what you wrote, is as I gave it above.

@goblinX As jeff said, copy and paste that command above, it will overwrite the contents of /dev/sda with a disk image to create a new bootable drive.

Note exactly where the quote ends

Make sure you're using double quotes (or single quotes) and that your system isn't "helping" by replacing them with "smart quotes"

Okay... Thank you. On the way to work now. Will do it tomorrow.

It took a few tries but it is trying to boot. Like I said above, there is a SSD drive and a mSata drive. The box had windows 10 on it so I deleted all partitions on it then the sh -c zcat command did it's thing. Removed Ubuntu usb but it kept booting to Windows 10. So windows was using the mSata drive for at least the boot, because it still showed my login and all. Went into gparted again and deleted all partitions on sdb, which is the mSata. Then was able to get to lede for boot. Seems to be stuck going through usb device numbers, rounding interval microframes. Missing drivers???
Once it gets so far, I get a black screen that I can't wake up out of by moving mouse, spacebar, etc.

With the blank screen are you able to ssh into the box or connect to Luci from another machine? Remember Lede/Openwrt is a router OS I don't think it is supposed to support any display or keyboard.

I see from here:
https://we.riseup.net/lackof/openwrt
That I'm supposed to telnet in to login, ssh and install Luci. So I'm wondering how to do that. Do I have to connect the Brix to my existing router to do ssh into it, to get it ready to replace my existing router. At the moment it isn't connected to internet. I installed Owrt with USB drives away from my network. Sorry, I'm a little confused. I am researching though..

telnet is neither installed nor supported with LEDE or later OpenWRT releases. ssh is the only way to access a shell prompt in project-built firmware (other than serial). The link you supplied refers to "Chaos Calmer", a pre-LEDE version.

Releases come with LuCI pre-installed. Snapshots (nightlies) require it to be "manually" installed.