Open Source Routers and OpenWrt
John Marrett
Introduction - Why?
Why Run Open Source Firmware?
- Because it's there
- Flexibility and enhanced functionality
- Stability
- Freedom
Introduction - History
2003
- Linksys releases the WRT54G
- seattlewireless.net / #wrt54g people start hacking on the binary firmware
- Community pressure leads Linksys to release the source code
- Linksys releases the WRT54G v5, and migrates the platform to vxworks
- Linksys releases the WRT54GL, which is basically the old WRT54G v4
- First micro versions are in development, providing support for 2MB routers
Firmware Options - Sveasoft
- One of the first open source firmware alternatives
- Suffered from limitations in customization
- Issues with charging for access to latest "development" firmware
- Accusations of code theft from other router projects
- Still appears to be in a somewhat questionable GPL status
Firmware Options - DD-WRT
- Started as a fork of Sveasoft, in response to their GPL violations
- Became a very popular firmware option
- Has started to develop a lot of the same GPL type issues as Sveasoft
- May still be, at present, the best option for micro routers for users with less technical inclination
OpenWrt
History
- Has its origins in the community surrounding #wrt54g on freenode
- Started with mbm, groz and a few others hacking on irc
- Rebuilt from the ground up, only bringing in the bare minimum components from the Linksys tarball
- Firmly dedicated to the principals of open source development
- The "One Ring" of Open Source Router Firmware
X-Wrt Money Shot
X-Wrt Network Admin
OpenWrt Hardware
- OpenWrt is supported on an incredible variety of hardware, some notable items include:
- Buffalo produces a number of very inexpensive routers with good OpenWrt compatibility
- ASUS WL-500g Premium - 8MB flash, 32 MB ram, 2 x USB 2.0 ports
- Linksys WRTSL54GS - 8MB flash, 32 MB ram, 1 x USB 2.0 port
- Tons of other supported and partially supported devices, check the Table of Hardware
- Always, always verify that the specific model and version is supported before you buy the router.
- The code currently under development in Kamikaze will bring support for a number of new boards
WRT54G Switch Layout
There are a number of different internal layouts, depending on the specific product
Interesting Projects - Software
You can do some pretty incredible things with a few software settings changes
- QoS
- Separate Wireless from Wired Network
- HotSpot
- OpenVPN
- DMZ Network
- GhettoPeer
- Mesh Networking
Interesting Projects - USB
A router with a USB port enables a number of interesting applications
- File Server
- Data Safe
- Music Player
- Web / Security Camera
Interesting Projects - Hardware
For the "serious" hacker only, these projects involve physical modification to the router
GhettoPeer - Diagram
Vlan Config
GhettoPeer - Vlan Config
Vlan Config Changes
nvram set vlan0ports="2 3 4 5*"
nvram set vlan3hwname=et0
nvram set vlan3ports="1 5"
GhettoPeer - Interface Config
Interface Config Changes
wan2_ifname=vlan3
wan2_proto=dhcp
GhettoPeer - Firewall/Startup Config
In /etc/init.d/S45firewall
#After iptables -A FORWARD -i $LAN -o $WAN -j ACCEPT
iptables -A FORWARD -i br0 -o vlan3 -j ACCEPT
#After iptables -t nat -A POSTROUTING -o $WAN -j MASQUERADE
iptables -t nat -A POSTROUTING -o vlan3 -j MASQUERADE
GhettoPeer - Status Script
In /etc/init.d/S45firewall
#Ping Checks against root-servers
#if ping down then
#if on wan
ifdown wan
ifup wan2
else
ifdown wan2
ifup wan
fi
fi
Questions / Router Hacking
Questions?
Presentation Website: zioncluster.ca/openwrt