PDA

Bekijk de volledige versie : HOW TO: Get basic router functionality from the openWRT firmware



d3viant
28-01-2007, 16:48
Ok, thought I'd start off the openWRT HOWTOS :P

Part 1. Flashing the firmware

Get the openWRT firmware (with modified mount_root) from here (http://files.wl500g.info/asus/custom/mod/1.0.4.2-1/openwrt-brcm-2.4-squashfs.rar)
Get the root2hdd.sh script from here (http://files.wl500g.info/asus/custom/mod/1.0.4.2-1/root2hdd.sh)
Unrar that file to give you the .trx image
Put your router into flash mode (unplug power, hold down EZ-Setup and plug power back in. Hold down EZ-Setup until ready light stops flashing)
Check that your computer can ping the router at 192.168.1.1
Upload the trx image ('tftp -i imagename.trx' in windows or

tftp 192.168.1.1
tftp>binary
tftp>trace
tftp>put imagename.trx
for linux
Wait 30 seconds, then unplug router and plug back in again
once the ready light has gone out, telnet to 192.168.1.1.
Set a password for root
passwd root (from now on, you will have to login via ssh instead of telnet)
do 'fdisk -l' to list the detected hard drives - note the name of the IDE drive device
do 'fdisk /dev/harddrivename'
issue the following commands to create a new ext3 partition WARNING - this will erase anything on your drive!
n, enter, 1, enter, enter, t, enter, 1, enter, 83, enter
pressing p and enter should show that you now have one partition on the disc of type linux
press w and enter to write the disk changes, then do 'fdisk -l' again to get the partition name
copy root2hdd.sh to /tmp using scp (puttyscp.exe for windows I think)
modify the boot_partition variable to your hard drive device (with the part1 on the end)
chmod +x /tmp/root2hdd.sh
/tmp/root2hdd.sh
as long as this completes successfully, you should now be able to reboot your router


Part 2. Configuring the router
Some extra packages need to be installed to enable full functionality of the router. You can compile them yourself by downloading the openWRT kamikaze source and putting M next to programs you want in the configuration(important ones listed below) - you can now find the ipkgs in a rar file here (http://ipkg.opensrc.org/mipsel/ipkgs.rar) - kindly hosted by markc.

Install the important ipkgs - that is, bridge, dnsmasq, iptables, the updated kernel with wifi drivers, kernel module brcm-wl.
edit dnsmasq.cont as required (you need to set the fields with @@ parameters in them)
start and stop the firewall to create the /etc/config/firewall file (/etc/init.d/firewall start/stop)
follow the examples in that firewall file to setup port forwarding as required
symbolically link /etc/init.d/dnsmasq to /etc/rc.d/S41dnsmasq - so that it runs on startup
do the same with /etc/init.d/firewall (choose a different number from 41 for conventions sake :) )
NOTE: the default layout of firewall will now prevent you connecting to ssh from the WAN side, uncomment the 2 rules in /etc/firewall.user to allow login from WAN-side
reboot the router to get the new kernel running
login to the router again and run /sbin/wifi detect > /etc/config/wireless
edit this wireless file as you see fit to match your requirements (change ssid etc) more info on this here (http://wiki.openwrt.org/OpenWrtDocs/KamikazeConfiguration)
This should give you the basic router setup requirements!

markc
29-01-2007, 00:31
Excellent tutorial, thank you very much. Some questions from a novice... is it possible to back out of this firmware upgrade and easily go back to the standard ASUS or kfurge firmware? ie; does the tftp part of CFE remain intact even after uploading this foreign firmware?

Would it be feasible to use a USB flashdrive instead of the internal HDD for a test run for a first time install of kamikaze?

And just curious, why did you use rar on the firmware image instead of, say, zip ?

d3viant
29-01-2007, 11:06
It IS possible to go back to the original ASUS firmware - there are instructions for that here (http://back2basic.shacknet.nu/WL700Ge/forum/showthread.php?t=3)

It is also possible to use a usb drive(although you will need to compile a custom firmware image with USB support built in for this), when you do your fdisk -l steps, create an ext3 partition and point root2hdd.sh to the usb drive instead of the internal drive (it should be fairly easy to tell from drive sizes which device is your usb key)

The original image wasn't created by me - I would have used .tar.gz instead of rar :)

I think rar has slightly better compression ratios than zip does on a binary file though...

back2basic
29-01-2007, 15:47
it would be good if someone could host some pre-built important ipkgs somewhere




Path :: http://back2basic.shacknet.nu/WL700Ge/packages/
PackageList (http://back2basic.shacknet.nu/WL700Ge/packages/Packages)

d3viant
29-01-2007, 16:28
I recently deleted all the packages on ubuntu, But I'm comling them agian and will share m with you on my webserver (200GB)

Path :: http://back2basic.shacknet.nu/WL700Ge/(Still compiling please be patient :) )

markc has kindly offered to host the packages also - don't worry about it if it'll take you too long to compile the ipkgs again - I already have a set on my home machine.

Fenix_999
30-01-2007, 01:33
Hi

Thanks for the Tutorial!

One question If I whant to run ti as Access Point the packages that I don't need is the dnsmask and iptables isn't it?

I should be easy to configure isn't it? I'm a little afrid of not beening able set it up.


Thanks,
Ricardo

d3viant
30-01-2007, 21:33
For a bridge/access point then you need dnsmasq and iptables installed.

I am not sure exactly why, but iptables is needed to actually make the router route network packets. Dnsmasq is used to give out IP addresses, so I would recommend using this even if you make dnsmasq assign permanent IP addresses to MAC addresses of network cards.

Amlet1
03-02-2007, 23:41
please help
Part 2. Configuring the router
Some extra packages need to be installed to enable full functionality of the router. You can compile them yourself by downloading the openWRT kamikaze source and putting M next to programs you want in the configuration(important ones listed below) - you can now find the ipkgs in a rar file here - kindly hosted by markc.

1. Install the important ipkgs - that is, bridge, dnsmasq, iptables, the updated kernel with wifi drivers, kernel module brcm-wl.
2. edit dnsmasq.cont as required (you need to set the fields with @@ parameters in them)


I edit /etc/config/network bridge eth0.0 10.1.1.1
vi /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

@ifdef dhcp_enable
dhcp-range=eth0.0,10.1.1.2,10.1.1.254,255.255.255.0,45h
dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases
@endif
@ifdef wan_ifname
except-interface=@@wan_interface@@
@endif

# use /etc/ethers for static hosts; same format as --dhcp-host
# <hwaddr> <ipaddr>
read-ethers

# default gateway and dns for LAN ports
dhcp-option=eth0.0,3,10.1.1.1,10.1.1.2
dhcp-option=eth0.0,6,10.1.1.1,10.1.1.2



eth0.0<> bridge (br-lan)

root#:dnsmasq

dnsmasq: bad option at line 13 of /etc/dnsmasq.conf
dnsmasq: bad option at line 17 of /etc/dnsmasq.conf
dnsmasq: bad option at line 18 of /etc/dnsmasq.conf
dnsmasq: bad option at line 20 of /etc/dnsmasq.conf
dnsmasq: failed to create listening socket: Address already in use

even reboot takes no effect

:(

hmantsao
04-02-2007, 04:01
please help
Part 2. Configuring the router
Some extra packages need to be installed to enable full functionality of the router. You can compile them yourself by downloading the openWRT kamikaze source and putting M next to programs you want in the configuration(important ones listed below) - you can now find the ipkgs in a rar file here - kindly hosted by markc.

1. Install the important ipkgs - that is, bridge, dnsmasq, iptables, the updated kernel with wifi drivers, kernel module brcm-wl.
2. edit dnsmasq.cont as required (you need to set the fields with @@ parameters in them)


I edit /etc/config/network bridge eth0.0 10.1.1.1
vi /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

@ifdef dhcp_enable
dhcp-range=eth0.0,10.1.1.2,10.1.1.254,255.255.255.0,45h
dhcp-authoritative
dhcp-leasefile=/tmp/dhcp.leases
@endif
@ifdef wan_ifname
except-interface=@@wan_interface@@
@endif

# use /etc/ethers for static hosts; same format as --dhcp-host
# <hwaddr> <ipaddr>
read-ethers

# default gateway and dns for LAN ports
dhcp-option=eth0.0,3,10.1.1.1,10.1.1.2
dhcp-option=eth0.0,6,10.1.1.1,10.1.1.2



eth0.0<> bridge (br-lan)

root#:dnsmasq

dnsmasq: bad option at line 13 of /etc/dnsmasq.conf
dnsmasq: bad option at line 17 of /etc/dnsmasq.conf
dnsmasq: bad option at line 18 of /etc/dnsmasq.conf
dnsmasq: bad option at line 20 of /etc/dnsmasq.conf
dnsmasq: failed to create listening socket: Address already in use

even reboot takes no effect

:(

try to chage your eth0.0 to br-lan that on your config

Amlet1
04-02-2007, 10:20
try to chage your eth0.0 to br-lan that on your config

I change to br-lan.Not work.

d3viant
04-02-2007, 14:09
The eth0.0 references shouldn't go in the IP address sections.

It should be like this:

dhcp-range=10.1.1.2,10.1.1.254,255.255.255.0,45h

To specify one interface to run dnsmasq on (ie br-lan) remove the line

except-interface=@@wan_interface@@

and put in

interface=br-lan

mecheng
02-04-2007, 03:43
I got as far as step 16. I use ubuntu as my main OS so I used the command:

scp root2hdd.sh root@192.168.1.1:/tmp/root2hdd.sh

This command transfers the file immediatly and I can go to the router and chmod the file to add execute. ls -al command verifies I have execute rights.

However,

the command

/tmp/root2hdd.sh

gives

-ash: /tmp/root2hdd.sh: not found

anyone know what may be the issue. Is there an alternative to the shell script?

Thanks,

Owen

BarBaar
07-05-2007, 18:54
I got as far as step 16. I use ubuntu as my main OS so I used the command:

scp root2hdd.sh root@192.168.1.1:/tmp/root2hdd.sh

This command transfers the file immediatly and I can go to the router and chmod the file to add execute. ls -al command verifies I have execute rights.

However,

the command

/tmp/root2hdd.sh

gives

-ash: /tmp/root2hdd.sh: not found

anyone know what may be the issue. Is there an alternative to the shell script?

Thanks,

Owen

You probably need to convert the root2hdd.sh script to unix-style..

Anyway, I have 2 issues:

1. For some reason, the router still boots from it's own ROM instead om the hdd, after a cold-start (power removed and reconnected). If I issue the reboot command, the router will boot from the hdd

2. I'm having big problems changing the IP address. I want to set the ip to 192.1680.0.100. I changed ip_address from nvram (and commited) and changed /etc/config/network. Now I reboot (poweroff required I believe) and the router comes up at the right IP. However, due issue 1, I have to reboot. And after this, I can no longer connect to the router (possibly the /etc/config/network on the hdd is a different one than the one I changed?)

back2basic
13-05-2007, 02:01
use the new image created by flippo on http://wl700g.homelinux.net
then change root to a usb stick youre problem shout be gone then

Amlet1
21-09-2007, 22:06
Please help.DC++ correct working passiv mode.
Activ mode It is possible??
please help rules to iptables

I used rules

iptables -t nat -A PREROUTING -d 10.155.15.3 -p tcp -m tcp --dport 23296 -j DNAT --to-destination 10.1.1.1:23296

iptables -t nat -A PREROUTING -d 10.155.15.3 -p udp -m udp --dport 23297 -j DNAT --to-destination 10.1.1.1:23297

I used strong dc++.Search not working to activ mode.Please help.

konimotsinui
11-11-2008, 02:51
I did this and my router now seems to be a brick. How do I restore the original firmware? I can't telnet into it or even ping it. I'm not even sure if it boots.

back2basic
19-11-2008, 22:45
I did this and my router now seems to be a brick. How do I restore the original firmware? I can't telnet into it or even ping it. I'm not even sure if it boots.

check here (http://wl700g.homelinux.net/drupal/)for more info ;)

konimotsinui
02-01-2009, 04:36
check here (http://wl700g.homelinux.net/drupal/)for more info ;)

I fixed it a while ago. Thanks....