Archive for the 'OpenWRT' Category



During this week, I have been playing extensively with the OpenWRT whiterussian Linux distribution for embedded devices, like the Linksys WRT54G wireless routers.
My initial plan was to build a custom firmware for the Linksys WRT54G wireless router in order to enable some functionality that is disabled by default — like busybox su applet or shadow [...]

The Cisco Linksys WRT54G/GS/GL is made up of a six-port configurable switch, a standard Ethernet controller (usually a Broadcom controller named eth0) and a Wireless controller (usually a Broadcom controller named eth1).
The following diagram tries to illustrate the different components that made up the Cisco Linksys and how are they interconnected:

[...]

dnsmasq offers a lightweight, functional and integrated DHCP and DNS service. Using it on OpenWRT brings up and embedded, flexible DNS service, with a very small footprint, for small or home offices.
dnsmasq acts as a caching DNS server and DHCP server. It reserves a DNS domain, called the local DNS domain and usually being .lan, [...]

OpenWRT and Time zone

By default, an OpenWRT router operates in the UTC (Universal Time Coordinate) time zone.
OpenWRT stores the time zone inside a file named /etc/TZ. If this file is missing or empty, OpenWRT assumes the local time equals UTC time. The format is pretty strange, and has the following syntax:
syntax ::= GMT< 'offset>
offset ::= (+|-)
hour ::= [ [...]

QoS with OpenWRT

I use the following script for my Linksys WRT54GS Wireless router running OpenWRT White Russian -RC4 to setup a QoS firewall that uses Hierarchical Token Bucket (HTB) and Stochastic Fair Queueing (SFQ) to classify the traffic in three cathegories:

Interactive, high priority traffic:
This class is used for DNS traffic and SSH traffic.
Interactive, normal priority traffic:
This class [...]

The Cisco/Linksys WRT54G/GS router has two leds just beneath the Cisco Systems logo. One is a white led, while the other is an amber led. It is possible to turn them on or off using the GPIO pins on the mainboard.

GPIO #3 controls the amber led beneath the Cisco Systems logo:
Disabling GPIO #3 turns on [...]

Enabling remote syslog logging with Linksys WRT54G and OpenWRT White Russian RC3 is as simple as storing the IP of the remote syslog server into the log_ipaddr NVRAM variable:

nvram set log_ipaddr=A.B.C.D
nvram commit
reboot

log_ipaddr is used by /etc/init.d/rcS startup script to launch a local syslog daemon with option “-R “:

#!/bin/sh
syslog_ip=$(nvram get log_ipaddr)
ipcalc -s “$syslog_ip” || syslog_ip=”"
syslogd -C [...]

Static routes are stored in a NVRAM variable called static_route. This NVRAM variable is a blank-delimited list of static route entries. Each entry has the following format:
SUBNET_ADDRESS:SUBNET_MASK:GATEWAY:METRIC:INTERFACE

SUBNET_ADDRESS is the IP subnet address, calculated by applying the netmask to the gateway address, for example.
SUBNET_MASK is the subnet mask used to disguise which part, of a given [...]

Linksys WRT54G (cont.)

I have been playing around with the WRT54G a little bit more.
Instead of acting as a Wireless AP and forwarding traffic to the Internet via the WAN port, I have configured it to forward packets coming from the LAN (via any of the 4-LAN ports) to the Internet via the Wireless interface. The WRT54G will [...]

Linksys WRT54G

Today, I bought a Linksys WRT54G V3.1 Wireless Router from my usual local store. Although it uses a heavily customized Linux version internally, it is quited limited. For instance, it does not allow remote administration via SSH, only through a nice Web interface. So, after playing a little bit with it, I decided to install [...]