Network configuration ASUS WL-500gP with Kamikaze 7.06
-----------------------------------------------------------------------------------------------
I looked for a How-To for Kamikaze, but there are only pieces out there
when i bought my router three days ago.
I hope, this How-To will help you.
Please give me Feedback, or correct me, if i made a mistake!
There is a second howto too, for setting up ASUS WL-500gP in sta-mode (routed client mode) with wpa-encryption
http://forum.openwrt.org/viewtopic.php?id=11502
But first, do the basics
Okay, lets start:
0. Basics
I used this image for flashing my router:
http://myhost.webhop.net/openwrt/openwr … s-xwrt.trx
The webif-package is already installed. If you have questions to webif see: http://x-wrt.org/
You can access via browser to: http://192.168.1.1 after setting a password (type passwd) per telnet on 192.168.1.1
But, you won't need it, because you have this howto and be carefull if you chance setting, i don't know which files are the webif² is editing.
Basic-Basics like how to work with vi or something like this must be known, otherwise you shouldn't do this howto!
1. Boot from USB-Stick
This is optional, it's nice, because you have a full-functionally fail-save mode on your rom.
Do this, if your network settings are correct and you have ssh-access to the router.
Everytime you restart the router without USB-Stick, you'll get the configuration
you've done before copying the files on the usb-stick (usb2)!
if you're using usb1 have a look at
http://wiki.openwrt.org/UsbStorageHowto … =%28usb%29
First you have format your usb-stick and write a filesystem on it:
We need the following packages
ipkg update
ipkg install kmod-fs-ext2 kmod-fs-ext3 fdisk e2fsprogs kmod-usb2 kmod-usb-storage
Then put your stick into the router, and format it, (with this, you'll create one partition)
root@SR-71:/mnt# fdisk /dev/scsi/host0/bus0/target0/lun0/disc
The number of cylinders for this disk is set to 60801.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
So, then you type
Command (m for help): d
fdisk asks you which partitions you want to delete, delete 1, nexttime 2, 3, 4... (if you have those partitions)
Then type
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-60801, default 1): #[enter]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): #[enter]
Using default value 60801
Let's write that to the stick:
Command (m for help): w
Syncing discs...
So, now we have one partition on your stick, lets make a filesystem:
mke2fs -j /dev/scsi/host0/bus0/target0/lun0/part1
If there's an error like this:
Creating journal (4096 blocks): mke2fs: No such file or directory
while trying to create journal
try this:
ln -s /proc/mounts /etc/mtab
But, normally everything goes right.
Now we are able to mount the stick: (in this example on /mnt)
mount -t ext3 -o rw /dev/scsi/host0/bus0/target0/lun0/part1 /mnt
Then we make a /tmp/root mount it to /rom and copiing the files (and at last unmount it and the stick)
mkdir /tmp/root
mount -o bind /rom /tmp/root
cp /tmp/root/* /mnt -a
umount /tmp/root
umount /mnt
Now your whole filesystem is copied on the stick.
We need to tell the image stored on the rom to boot from the usb-stick.
To do this it's necessary to delete your /sbin/init (it's linked to the busybox)
rm /sbin/init
and replace it with this:
#!/bin/sh
boot_dev="/dev/scsi/host0/bus0/target0/lun0/part1"
for module in usbcore ehci-hcd scsi_mod sd_mod usb-storage jbd ext3; do {
insmod $module
}; done
sleep 2s
mount -o rw "$boot_dev" /mnt
[ -x /mnt/sbin/init ] && {
. /bin/firstboot
pivot /mnt /mnt
}
exec /bin/busybox init
This file must be executeable and reboot
chmod a+x /sbin/init && reboot
Now, you should boot from usb-stick!
2. Network basics
please, backup your /etc/config/network /etc/config/wireless, and your /etc/dnsmasq.conf
those backups will save your nerves
cp /etc/config/network /etc/config/network.bak
cp /etc/config/wireless /etc/config/wireless.bak
cp /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
First a short Introduction.
Setting up the IP,Netmask,Gateway and DNS of the Router (Bridge)
uci set network.lan.ipaddr="192.168.2.1"
uci set network.lan.netmask="255.255.255.0"
uci set network.lan.gateway="192.168.0.1"
uci set network.lan.dns="192.168.0.1"
uci commit && ifup -a
Now you should able to ping an address somewhere else.
3. DHCP
For Connected Clients we need a default gateway to 192.168.2.1, set also the dns to 192.168.2.1 (Bridge IP)
and at last an ip-address-pool:
I dicided for dhcp-clients: 192.168.2.2 - 192.168.2.20
This is my /etc/dnsmasq.conf
# filter what we send upstream
domain-needed
bogus-priv
filterwin2k
localise-queries
# allow /etc/hosts and dhcp lookups via *.lan
local=/lan/
domain=lan
expand-hosts
resolv-file=/tmp/resolv.conf.auto
dhcp-range=lan,192.168.2.2,192.168.2.20,255.255.255.0,24h
dhcp-option=lan,3,192.168.2.1
dhcp-option=lan,6,192.168.2.1
dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases
except-interface=eth0
read-ethers
DHCP-server works, but not the ip-range... i get a wired-ip of 192.168.2.102 and a wireless-ip of 192.168.2.223
this is a little bit strange.
have a look at these lines:
local=/lan/
domain=lan
It is the name of your Interface in /etc/config/network
Edit if needed!
Next step: Turn on the
4. WIFI
Edit your /etc/config/wireless:
config wifi-device wl0
option type broadcom
option channel 1
# disable radio to prevent an open ap after reflashing:
option disabled 0
config wifi-iface
option device wl0
option network lan
option mode ap
option ssid defcon
option hidden 0
option encryption psk
option key mykey123
wl0 is my wifi-interface
defcon is my ssid
with this option, wl0 will be bridged with lan
option network lan
and this is our wpa-psk encryption
option encryption psk
option key mykey123
To bring the AP on-air type
/sbin/wifi start
5. SAMBA
To turn on the Samba-Server we need:
ipkg install samba-common samba-server
But then samba wouldn't start, because it looks for your Router's name and IP.
So wee need to add a line to /etc/hosts
(this is my /etc/hosts: SR-71 is my Router's name)
127.0.0.1 localhost
192.168.2.1 SR-71
Then you should able to ping yourself with
root@SR-71:~# ping sr-71
PING SR-71 (192.168.2.1): 56 data bytes
64 bytes from 192.168.2.1: icmp_seq=0 ttl=64 time=0.7 ms
64 bytes from 192.168.2.1: icmp_seq=1 ttl=64 time=0.4 ms
64 bytes from 192.168.2.1: icmp_seq=2 ttl=64 time=0.4 ms
64 bytes from 192.168.2.1: icmp_seq=3 ttl=64 time=3.7 ms
--- SR-71 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.4/1.3/3.7 ms
If this was successful, you can edit the
/etc/samba/smb.conf
actually, your /tmp is shared.
And now, turn on SAMBA with
/etc/init.d/samba start
EDIT:
05.07.2007: Write the 0. Basics
05.07.2007: Write the 1. Boot from USB-Stick
06.07.2007: Replaced init script with script from mbm (post 4)
08.07.2007: Correct kmod-fs-ext2, kmod-fs-ext3
11.07.2007: Added the "w" to the fdisk-section
14.04.2008: Correct some grammar mistakes
(Last edited by spelth on 16 Apr 2008, 01:54)