openwrt on Linksys WRT54G v2.0

For a looong time I had a WRT54G. For those who don`t know, this is a Linksys router with a linux based firmware. And the folks in Linksys were nice enough to give the source code for the firmware (not like some other vendors!) and the community came up with two major alternatives: openwrt and dd-wrt.

I played with openwrt so I won`t cover dd-wrt. Maybe another blog entry… 😛

Instead of describing stuff, I prepared my installation and configuration notes as a bash command line utility, so that next time I install the openwrt, I can copy paste my stuff to a shell and customize it the same way.

Some of the things will not work for you if you copy paste it, because I deleted some private stuff. ; )

Openwrt imports your Linksys configurations from the original linksys firmware installation. That is automatic, so it`s not covered here! Rest of the things are below.

# Documentation: http://wiki.openwrt.org/

# Installation:
# Downloaded newest whiterussian version from: http://downloads.openwrt.org/whiterussian/newest/default/
# Filename: openwrt-wrt54g-squashfs.bin
# Pushed from the web interface of Linksys default router firmware.

# Changed the root password for the first telnet connection.

passwd

# rebooted, once it reboots it disables the telnet and enables the ssh.
But for some reason the telnet was still there (did not enable to
login) I had to go and disable from /etc/init.d/

mv /etc/init.d/S50telnet /etc/init.d/s50telnet

# It ported every config that I had. Except the wireless LAN didnot work.
# I had to install: nas – 3.90.37-17 – Proprietary Broadcom WPA Authenticator/Supplicant

ipkg install nas

# I wanted to log my routers activity remotely. So I configured syslog
to log it remotely. Of course, I first set up remote logging on my
central log server. (not covered here)
# Change the IP 1.2.3.4 to your remote logging IP

nvram set log_ipaddr=1.2.3.4
nvram commit

# Default iptables rules do not allow to LOG the traffic. So I needed
to install the module for that: iptables-mod-extra – 1.3.3-2 – Other
extra Iptables (IPv4) extensions

ipkg install iptables-mod-extra

# I really didn`t like the idea that the web config was running plain text on port 80, So I disabled it.

mv /etc/init.d/S50httpd /etc/init.d/s50httpd

# I configured some firewall rules in /etc/firewall.user

### copy start ###
echo ” — Go configure your own firewall! —”

### copy end ###

# The date of the box was couple of thousand hours late, so I needed an
ntp client. I installed: ntpclient – 2003_194-2 – NTP client for
setting system time from NTP servers.
# And configured to run at the boot.


ipkg install ntpclient
######## copy start #######
cat > /etc/init.d/S60ntpclient <
#!/bin/sh
/usr/sbin/ntpclient -c 1 -s -h pool.ntp.org &
EOF
######## copy end #######