edgerouter lite (erl)

I recently picked up an EdgeRouter Lite to replace an aging Linksys router. It’s a neat router running Vyatta, and because it’s based on Debian, we can use its packages too.

The following are some of my notes on configuring and using the router.

wan + 2 lan setup

The router has three ports. eth0 has been configured for WAN and eth1 and eth2 are configured to a switch and wireless access point. Each LAN port has its own subnet and DHCP server and the two subnets are not bridged. Another WRT54GL running Tomato is connected to the switch acting as an access point.

Configuration is not duplicated here, but can be found around the web.

darkstat

The ERL has a pretty good web interface which shows the active but not historical network bandwidth. darkstat is a lightweight tool that calculates network bandwidth. (We could also use SNMP or NetFlow. TODO for later.)

darkstat does not work if you have IP offloading enabled, though:

show ubnt offload

Disable IP offloading:

configure
set system disable-ip offload
commit
save

Enable IP offloading:

configure
delete system disable-ip offload
commit
save

Configure ERL to use a Debian repository:

configure
set system package repository squeeze components 'main contrib non-free'
set system package repository squeeze distribution squeeze
set system package repository squeeze url http://http.us.debian.org/debian

set system package repository squeeze-security components main
set system package repository squeeze-security distribution squeeze/updates
set system package repository squeeze-security url http://security.debian.org
commit
save
exit

The latest version of darkstat is not in the repo, and there are some interesting features I wanted to test (multiple capture interfaces).

Build and install darkstat from source (set your own chroot dir):

sudo apt-get install build-essential zlib1g-dev libpcap-dev bzip2
sudo apt-get update

./configure --with-chroot-dir=/var/lib/darkstat
make
sudo make install

Then run darkstat. An example invocation:

darkstat \
  --chroot /var/lib/darkstat \
  -i eth0 \
  -p 666 \
  --no-daemon \
  --import darkstat.db \
  --export darkstat.db

I haven’t quite figured out how to specify multiple local networks.