Introduction to OpenWrt x86
OpenWrt is an open source, Linux-based operating system for embedded devices such as wireless routers. It provides a fully writable filesystem with package management, allowing users to customize the device through the use of packages to suit any application. OpenWrt x86 refers to running OpenWrt on standard x86 hardware like PCs and servers, rather than the more typical router hardware.
The key advantages of using OpenWrt x86 include:
- Flexibility to run on a wide range of x86 hardware
- Ability to leverage the performance of x86 CPUs and plentiful RAM/storage
- Access to the large ecosystem of x86 Linux software packages
- Option to virtualize OpenWrt x86 as a VM on other systems
Some potential use cases and projects for OpenWrt x86:
- Wireless router or access point
- VPN server
- Network firewall
- Network monitoring and analysis
- Network attached storage (NAS)
- IoT gateway
- Telephony server (e.g. Asterisk PBX)
- Proxy server
- Web server
Preparing to Install OpenWrt x86
Hardware Requirements
To run OpenWrt x86, you’ll need a 64-bit (x86-64) PC/server with:
- CPU: Any modern Intel/AMD 64-bit processor
- RAM: 512 MB minimum, 1 GB+ recommended
- Storage: 2 GB minimum, SSD preferred for performance/reliability
- Network: One or more gigabit Ethernet interfaces
Note that OpenWrt can run from a USB flash drive, but performance will be significantly degraded versus a SSD or hard disk drive. WiFi hardware support is more limited than Ethernet; consult the OpenWrt wiki for compatibility of specific WiFi adapters.
Downloading OpenWrt x86
OpenWrt x86 images can be downloaded from the official OpenWrt downloads page:
https://downloads.openwrt.org/
Under the Table of Hardware, select the x86 link to view x86 builds. For a first installation, use the latest stable release (avoid snapshots/RC unless you have a specific need).
The download page has two different images for 64-bit x86:
Image | Description |
---|---|
generic-ext4-combined.img.gz | Combined ext4 partition image |
generic-squashfs-combined.img.gz | Combined SquashFS partition image |
For simplicity, the ext4 image is recommended. The SquashFS image has a read-only root filesystem for immutability/security but requires a bit more setup.
Preparing Installation Media
The downloaded OpenWrt image must be written to bootable media to install the system. The two common methods are:
- USB flash drive
- PXE netboot
A USB flash drive is the simplest option. The image can be written to a USB drive using a tool like Etcher (https://www.balena.io/etcher/):
- Download and install Etcher
- Connect a USB drive (8 GB or larger recommended)
- Select the OpenWrt x86 image file in Etcher
- Select the target USB drive
- Click “Flash!” to write the image
- Boot the target PC from the USB drive
Some PCs, especially servers, may lack USB ports or have USB disabled. In this case, PXE netboot can be used to load the OpenWrt x86 installer over the network.
Setting up a PXE server is beyond the scope of this guide, but in summary:
- Set up a TFTP server hosting the OpenWrt image and a basic “pxelinux” bootloader
- Configure the DHCP server to advertise the TFTP server to clients
- Boot the target PC and select PXE boot from the boot menu
Installing OpenWrt x86
The basic OpenWrt x86 installation process is:
- Boot the target PC from the USB drive or PXE
- Select OpenWrt from the bootloader menu
- Log in to OpenWrt (root/password by default)
- Run
openwrt-install
to start the installer - Select target disk and confirm installation
- Wait for installation to complete and reboot
- Remove USB drive (if used) and boot into new OpenWrt install
By default, OpenWrt has no password for the root account. After installation, you should immediately set a strong password:
passwd
The OpenWrt x86 installer will overwrite the entire disk selected. If you want to preserve an existing operating system in a dual-boot configuration, you can manually partition the disk before running the installer.
First Steps with OpenWrt x86
After installation and first boot, there are a few key steps to perform initial setup of OpenWrt x86:
Set a Password
As mentioned, the default OpenWrt configuration has no root password – set one immediately with passwd
.
Network Configuration
By default, OpenWrt will attempt to get an address via DHCP on the first network interface. You can view the interface configuration in /etc/config/network
:
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'dhcp'
option ip6assign '60'
To set a static IP, change option proto
to static
and add option ipaddr
, option gateway
, and list dns
entries:
config interface 'lan'
option type 'bridge'
option ifname 'eth0'
option proto 'static'
option ipaddr '192.168.1.1'
option gateway '192.168.1.254'
list dns '8.8.8.8'
option ip6assign '60'
After changing the network config, restart the network service:
service network restart
Firmware Updates
OpenWrt periodically releases updates with new features, bug fixes, and security patches. To check for updates:
opkg update
opkg list-upgradable
If an update to the base system (kernel, libc, etc.) is available, you can upgrade with:
opkg upgrade
reboot
Updates to the Linux kernel require a reboot to take effect. Updates to individual packages can be installed with opkg install <package>
as described in the next section.
Installing Packages
OpenWrt’s functionality can be extended via optional software packages. The opkg
tool is used to manage packages.
Some useful packages to install might include:
Package | Description |
---|---|
bash | Full-featured shell |
htop | Improved system monitoring tool |
nano | Simple command-line text editor |
curl | Transfer data to/from a server |
To install a package:
opkg update
opkg install <package>
You can search for packages with:
opkg search <keyword>
And list all installed packages with:
opkg list-installed
Be aware that the built-in storage on routers can be limited – installing many packages can consume all the available space. OpenWrt x86 is less constrained since it runs on PC hardware.
Configuring OpenWrt
Most of OpenWrt’s configuration files are in the /etc/config
directory. Some key files include:
File | Description |
---|---|
dhcp | DHCP and DNS settings |
dropbear | SSH server configuration |
firewall | Firewall rules |
network | Network interface settings |
system | System settings like hostname, timezone |
wireless | WiFi settings |
OpenWrt configuration files have a simple syntax of config
blocks containing option
and list
entries. For example, /etc/config/system
might contain:
config system
option hostname 'OpenWrt'
option timezone 'UTC'
After changing settings in a configuration file, you’ll typically need to restart the associated service. For example, after changing WiFi settings:
service wireless restart
The OpenWrt LuCI web interface provides a friendlier way to update configuration compared to editing files on the command line.
LuCI Web Interface
OpenWrt includes the LuCI web interface for system configuration and monitoring. If not already installed, LuCI can be installed with:
opkg update
opkg install luci
Once installed, LuCI will be accessible via web browser at the router’s IP address, e.g.:
http://192.168.1.1/
The default LuCI login is username root
with the password you set for the root account.
LuCI provides an interface to view system status and update all the configuration options available in the /etc/config
files. For example, the Network configuration options correspond to the settings in /etc/config/network
.
Some common LuCI tasks include:
- View system load, memory usage, etc. on the Status page
- Update the administrator password (System → Administration)
- Configure network interfaces and routes (Network → Interfaces, Network → Routes)
- Change the LAN subnet and DHCP settings (Network → DHCP and DNS)
- Manage the system firewall (Network → Firewall)
- Update WiFi SSID and password (Network → Wireless)
- Upgrade firmware and packages (System → Software)
Expanding Storage
The internal storage on most routers is limited – typically 4-16 MB of flash memory. This can severely limit the packages you’re able to install. OpenWrt x86 is less constrained by storage since it runs on PCs/servers with USB ports and drive bays.
Some options for adding storage include:
- Use a USB flash drive or hard drive
- Install a SATA SSD or hard drive
- Boot from disk, using internal storage for configuration
USB Storage
OpenWrt supports USB storage devices out of the box. After plugging in a USB drive:
- Determine the device name with
dmesg | tail
- Create a mount point:
mkdir /mnt/usb
- Mount the device:
mount /dev/sda1 /mnt/usb
Replace /dev/sda1
with the actual device name and partition number.
To auto-mount USB storage at boot, install the block-mount
package:
opkg update
opkg install block-mount
Then add an entry to /etc/config/fstab
:
config 'mount'
option 'device' '/dev/sda1'
option 'target' '/mnt/usb'
option 'fstype' 'ext4'
option 'enabled' '1'
Update device
and fstype
with the correct values for your drive.
SATA Storage
Most x86 systems have onboard SATA ports for adding SSDs or hard drives. Adding a SATA drive follows the same basic process as USB:
- Physically install drive and connect SATA/power
- Partition and format drive if needed:
fdisk
,mkfs.ext4
- Create mount point:
mkdir /mnt/sata
- Add entry to
/etc/config/fstab
referencing SATA device
SATA drives will typically be assigned device names like /dev/sda
, /dev/sdb
, etc. Use dmesg
or fdisk -l
to list attached storage devices.
Booting from Disk
For maximum storage, you can boot OpenWrt from a USB or SATA disk, reserving the internal flash storage for configuration data.
- Install OpenWrt to disk following normal procedure
- Copy all files from
/overlay
to disk:cp -r /overlay /mnt/sda1/
- Edit
/etc/config/fstab
to mount the disk’s overlay directory
config 'mount'
option 'device' '/dev/sda1'
option 'target' '/overlay'
option 'fstype' 'ext4' - Reboot the system to start running from disk with config in flash.
This configuration provides the benefits of persistent storage for the operating system while still allowing you to make configuration changes and have them persist through reboots.
Backup and Recovery
Regularly backing up your OpenWrt configuration is important to avoid losing settings in the event of hardware failure or misconfiguration.
To create a backup of your configuration files:
tar cvzf config_backup.tar.gz /etc/config
This creates a gzipped tar archive containing all the files from /etc/config
. Store the backup archive on a remote system or in /mnt/usb if you have external storage.
In the event that you need to recover settings, copy the backup archive to the OpenWrt device and extract it:
tar xvzf config_backup.tar.gz -C /
If you’re unable to boot the router normally to restore a config backup, you can often copy the archive to a USB drive, boot OpenWrt failsafe mode, and extract the archive from the USB drive:
- Copy config backup archive to a USB drive
- Connect USB drive to router
- Boot into failsafe mode (typically by holding the reset button)
- Mount USB drive
- Extract config archive from USB to /etc/config
- Reboot router
Example Projects
Some interesting projects to try with OpenWrt x86 include:
Wireless Access Point
Use OpenWrt as a wireless access point to extend your network coverage or replace the antennas on a PC.
- Install and configure a WiFi adapter (e.g. mini PCIe card)
- Configure the WiFi network in
/etc/config/wireless
- Attach the OpenWrt device to your LAN
- Enjoy extended wireless coverage
VPN Server
Turn your OpenWrt x86 device into a VPN server to secure traffic when using public networks.
- Install the OpenVPN package:
opkg install openvpn
- Generate the OpenVPN configuration and certificates
- Configure the VPN connection in
/etc/config/openvpn
- Connect your devices to the VPN when on untrusted networks
Network Firewall
Use OpenWrt’s firewall features to secure your network against attacks and unwanted traffic.
- Review default firewall settings in
/etc/config/firewall
- Restrict access to ssh, web, etc. to your LAN subnet
- Block common attack ports (e.g. telnet, smb)
- Enable SPI firewall to block invalid packets
- Install and configure additional packages like
fail2ban
Central Syslog Server
OpenWrt can serve as a central syslog server to collect logs from all your devices.
- Install syslog daemon:
opkg install syslog-ng
- Create a config file for syslog-ng
- Configure network devices to send logs to OpenWrt
- Review logs with
logread
or web interface (e.g. Luci)
Troubleshooting
Some common issues and troubleshooting steps for OpenWrt:
Issue | Solution |
---|---|
Can’t connect to web interface | Verify IP address is correct, try accessing via ssh instead |
Internet connection not working | Check WAN interface, firewall rules, DNS settings |
Software packages won’t install | opkg update , free up storage space |
USB storage not recognized | dmesg to check for errors, verify filesystem, check power |
For further help, consult the OpenWrt wiki, forum, or IRC channel.
FAQ
What are the minimum hardware requirements for OpenWrt x86?
OpenWrt x86 requires a 64-bit x86 CPU, 512 MB of RAM, 2 GB storage (SSD recommended), and at least one Ethernet port.
Can I run OpenWrt x86 as a VM?
Yes, OpenWrt works well virtualized under hypervisors like VirtualBox, VMware, Proxmox, etc. Use a lightweight distro like Alpine Linux as the host for maximum performance.
How do I update OpenWrt?
Update the package list and install updates via the command line:
opkg update
opkg list-upgradable
opkg upgrade
Or use the LuCI web interface:
- LuCI → System → Software
- Actions → Update lists
- Review updates, click “Upgrade”
What’s the difference between OpenWrt and DD-WRT or Tomato?
OpenWrt, DD-WRT, and Tomato are all open source Router Firmware projects, but OpenWrt offers:
- Broader hardware support, including x86
- Larger package ecosystem, regular updates
- More customization via config files
DD-WRT and Tomato offer a simpler web interface but less flexibility overall.
Where can I find more information?
The [OpenWrt Wiki](https://op