Bouts with Routers

Jun 17, 24

I spent last night rebuilding my router, for no reason whatsover it turns out. I had this dual-port Intel gigabit adapter I wanted to add to the pc, but I forgot about how hardware changes and OpenWRT don’t really mix, especially if you’re talking about wireless adapters, so I ened up taking it back to stock, three times I think, because the machine did not like that adapter. I pulled it from a working system, but as soon as I plugged in a cable to it it caused the system to go into a reboot loop. I have no idea what’s going on there. So, I ended up right back where I started. The system is really old at this point. I bought it back in 2008 I think. Only one dimm works and all but two of the sata ports pulled off, but it keeps hobbling along somehow.

Point being I had forgotten that I can’t really make hardware changes post-install with OpenWRT. The system is built for stability, and istalling it is just a matter of copying the system to a disk and booting from that disk. I don’t think I’ve ever had one fail to boot, but all I’ve used is the bios version to this point so I’m not sure how much more complicated it is with an efi boot system. Once installed and booted, The first thing to do is get to it and change the root password, and the best way to do that is directly by plugging in a monitor and a keyboard, or with an ethernet connection using a laptop. With the laptop method, I had also forgotten that OpenWRT delegates a port for WAN and a port for LAN, and all the other ports are ignored and won’t work. I had to plug into them until one of them worked. From there the router was reachable with the browser at 192.168.1.1. I prompted me to change the root password. From there, I can access the machine with SSH.

The next set-up task would seem to be expanding the file system to use the full capacity of the disk, and for that I needed an Internet connection, so actually the next task needs to be assigning the network ports to the correct group, in this case, one is reserved for WAN, and the others are grouped into a bridge. Once I’ve mapped what port is what, I can plug in my Internet connection, and in this case it just works. It’s set to DHCP-client mode, my ISP gives it an IP address and we’re off to the races.

Update the software either in LUCI or using SSH, then install parted.

 opkg update
 opkg install parted
 # Identify disk name and partition number
 parted -l -s
 # Expand root partition
 parted -f -s /dev/sda resizepart 2 100%
 # Apply changes
 reboot
 # Install packages and expand file system
 opkg install losetup resize2fs
 losetup /dev/loop0 /dev/sda2 2> /dev/null
 resize2fs -f /dev/loop0
 reboot

Next, install the wireless drivers if you need them. I have an atheros 9k adapter in it, so I’m going to use that to broadcast a 2.4 ghz wireless signal. This is tricky. You have to know which driver goes with which chip to make it work, but generally speaking the Qualcomm Atheros chips always seem to have the best support, then probably Intel chips. Once the correct driver is installed, along with the wpad-openssl package to provide security, wireless just works, so at that point just configure the nextwork.

Now I just want to fine-tune things like configure my port forwards and things like that. For sure, I would say I learned not to just go through and install packages like crazy because I always end up breaking the system, usually by causing some software conflict, so all I install is just what I need and otherwise leave it alone to be as minimal as possible.