Wednesday, September 3, 2008

HOW TO: DD-WRT on Asus WL-500G Premium V2

Our goal is simple:


Put DD-WRT on an Asus WL-500G Premium V2

Our process is straight forward
  1. establish ip connectivity to router
  2. download dd-wrt firmware
  3. download Asus WL-500G Premium V2 utilitypack
  4. reboot router in 'restore' mode
  5. disable windows firewall (really?! Yes, I'm afraid so)
  6. install/run Firmware Restoration utility
  7. browse to new firmware and click upload
  8. wait for router to reboot automatically
  9. re-enable windows firewall
Step 1:
My current router was already running on 192.168.1.1 - so I moved it to 192.168.1.2 left my pc on dhcp. I suppose you could always configure a static ip 192.168.1.??? and a subnet of 255.255.255.0 - The point is you have to be able to ping the asus on 192.168.1.1 !

Step 2:
DD-WRT download section:
http://www.dd-wrt.com/dd-wrtv3/dd-wrt/downloads.html

stable -> dd-wrt.v24 SP1 -> Consumer -> ASUS -> WL500g-Premium ->
dd-wrt.v24_mega_generic.bin

Step 3:
GAWD ASUS SITE SUCKS! I hate javascript sometimes...

Asus download section:
http://support.asus.com/download/download.aspx

Product: Wireless
Series: AP/Router
Model: WL-500gP V2

Direct WL-500gP V2 download section
Direct WL-500GP V2 Utility download

*I also found it on the included CD, just run D:\Utility\setup.exe

Step 4:
  • Unplug the router
  • Press and hold small black 'restore' button on back next to antenna
  • Plug in router and continue to hold 'restore'
  • Wait for the power 'icon' on the front to blink on/off once per second
  • Release 'restore' button - power icon should continue to blink
Success:
You should still be able to ping the router on 192.168.1.1 while it is in this mode.

Step 5:

Disable Windows Firewall

You can skip this step for now, but you're going to have to do it eventually. The ASUS firmware Restoration Utility will run, but won't upload while the windows firewall is active.

Start -> Control Panel -> Windows Firewall -> Off

Step 6:

Extract the UT_WL500gPv2_4008.zip that you downloaded earlier and run the setup.exe to install the Asus WL-500G Premium V2 utilitypack

Run the Firmware Restoration Utility:
Start -> Program Files -> ASUS Utility -> WL-500gP V2 Wireless Router -> Firmware Restoration

Step 7:

Click Browse and navigate out to:
dd-wrt.v24_mega_generic.bin

Click Upload...

It kind of bugs me that it didn't ASK what ip I wanted to upload this firmware to, but I guess I think it 'knows'...

While the progress bar is pushing around you may see some blinking on the router at first, but after awhile it just sits there:

Should take about a minute for the progress bar to quit, and then you can click close.

Step 8:

Really, just sit there... for like 45-60 seconds. I know, seems like forever. Eventually the modem will reboot, and you'll get the 'AIR' light lit up and I noticed I could ping it again. While you waiting don't forget Step 9!

Step 9:

Don't forget to turn back on windows firewall!!!

DONE. Navigate back to http://192.168.1.1/ and setup the user:


You haven't really LIVED until you've ssh'd into your router:

login as: root
DD-WRT v24 mega (c) 2008 NewMedia-NET GmbH
Release: 07/27/08 (SVN revision: 10012:10013)
root@192.168.1.1's password:
==========================================================

____ ___ __ ______ _____ ____ _ _
| _ \| _ \ \ \ / / _ \_ _| __ _|___ \| || |
|| | || ||____\ \ /\ / /| |_) || | \ \ / / __) | || |_
||_| ||_||_____\ V V / | _ < | | \ V / / __/|__ _|
|___/|___/ \_/\_/ |_| \_\|_| \_/ |_____| |_|

DD-WRT v24
http://www.dd-wrt.com

==========================================================


BusyBox v1.11.1 (2008-07-27 19:56:11 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

root@DD-WRT:~# cat /proc/cpuinfo
system type : Broadcom BCM5354 chip rev 2
processor : 0
cpu model : BCM3302 V2.9
BogoMIPS : 239.20
wait instruction : no
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : no
hardware watchpoint : no
VCED exceptions : not available
VCEI exceptions : not available
root@DD-WRT:~#

Note the superuser username. Instead of the username you created in the DD-WRT initial configuration page, you have to use 'root' as the login username - but still the same password.

ASUS WL-500g Premium V2 and DD-WRT

So I picked the ASUS WL-500g Premium because...
  1. I knew it was supported by DD-WRT
  2. Lots of memory (32 MB)
I think I read somewhere that it was actually a pretty good piece of hardware for this kind of thing... but it doesn't matter - it looks cool:



Not going to be needing this:



ASUS WL-500g Premium V2 default IP:
192.168.1.1

ASUS WL-500g Premium V2 default Login:
Username: admin
Password: admin

So this is what we're trying to get rid of:

OK, so now how to get DD-WRT onto this thing...

HOW TO: DD-WRT wireless bridge

Got my package from newegg today:

Two ASUS WL-500g wireless routers. I plan to load them with DD-WRT and build a stable wireless bridge.

So I'd like to create a complete guide here, as I work - more updates to follow!

Update:
HOW TO: DD-WRT on Asus WL-500G Premium V2
Easy DD-WRT wireless bridge

Friday, August 15, 2008

Best Bash Script EVER - "Just In Case"

clayg@m-net:~$ cat bin/jic
#!/bin/bash
if [ $# -eq 0 ]
then
echo "usage: jic [filename]"
exit 1
fi
if ! [ -e $1 ]
then
echo "$1 does not exist!"
exit 1
fi
ext=$(date +%y%m%d.%H%M%S)
jic=$1.$ext
cp $1 $jic
chmod -x $jic
echo "SAVED: $jic"

Credit goes to a sourpuss I used to work with by the name of Chuck Carson, who gave me the idea. Where ever you are big guy - thanks.

The script creates a backup copy of a file you are about to modify:
# jic /etc/sysconfig/iptables
would create a copy called /etc/sysconfig/iptables.YYMMDD.HHMMSS

you know... just in case

Also handy for versioning revisions to scripts you're working on - never now when you're latest hack will turn out to be a total bust.

Also - go get yourself a free shell account on http://www.arbornet.org/

Sunday, July 13, 2008

can linux tell me how many open memory slots i have

yes it can:
sudo lshw

lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc.

So if you're running linux and you need to know your graphics chip set, your motherboard manufacturer or model number... but you're too lazy to open the case and look ;)

Try the Linux utility List Hardware.

Friday, June 20, 2008

Use nmap to scan for ssh servers on subnet

Nmap ("Network Mapper") is a free and open source utility for network exploration or security auditing. If you don't have it - get it:
sudo apt-get install nmap
There's also a GUI called Zenmap that I use sometimes. But I'm trying to learn my way around the powerful command line interface...

Here's a simple example that will scan all computers on your 255.255.255.0 subnet and report any devices listening on port 22 - the default for SSH. All of this along with the version of SSH that the server is running is output to a text file 'sshservers':
nmap -p 22 --open -sV 10.0.0.0/24 > sshservers
They say "necessity is the mother of invention" - See what happened was the DHCP server at worked assigned one of my machines a new ip and I wanted to try and track it down remotely. The only thing I could really think of that I knew - was that it was running sshd and it was somewhere in on this one 'VLAN'. To narrow down possible candidates I wanted to gather a list of all the machines on this one subnet listening on port 22. Nmap is perfect for this kind of job!

Lets break it down
nmap : the executable name
-p 22 : specifies the port to test
--open : suppress output for clients that are not listening
-sV : display the version string reported by the scanned server
10.0.0.0/24 : the target network, could have been 192.168.0.0/24
(/24 specifies a subnet of 255.255.255.0, look up slash notation)
> sshservers : redirects standard output to a file named 'sshservers'
Here was me:
Interesting ports on [ipaddressremoved]:
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1.2 (protocol 2.0)
MAC Address: [macaddressremoved] (Intel)
Service Info: OS: Linux

Friday, June 6, 2008

Rambling

I bought a domain - it's clayg.info

Godaddy said it was only $0.99 - but it ended up being $1.19 after some kind of ICANN tax. I also got a dyndns.org account that I'm going to use keep a pointer to my computer at home. And I'm going to have a few cname records for static private ips around the office - 10.0.0.0 stuff. I'd never even thought of it, but if you're on a network where you don't control the dns records - it IS surprisingly handy.

I bought a used e machine that I'm going to clean up into a project server. I want to install a few different things. FreeBSD, Apache, PHP, JBoss, MySQL & PostgreSQL. I'll have it setup here at home and use the godaddy/dyndns address like my own little web host.

I got that Ubuntu and Windows XP secure synergy tunneled through ssh setup working. But I didn't take very good notes. The highlights were definitely:
a) use CopSSH for the ssh server on the windows box
b) start the synergy client from /etc/gdm/PreSession/Default

Just after the fi, and before the exit
ssh -f -N -L 24800:[synergy server ip]:24800 [username]@[synergy server ip]
synergyc -f localhost > /dev/null &

Obviously setting up ssh keys for passwordless authentication is key. Generate the key on the client, and then append the public key to the ~/.ssh/authorized_key file on the server.

The SWT project is coming along. I've updated the engine to better support multiple 'views' in the right pane. I'll post the source here when I get a chance.

Oh and I'm a dad: