source: freewrt/docs/handbook/freewrt-handbook.txt@ 025bc8e

freewrt_1_0 freewrt_2_0
Last change on this file since 025bc8e was 025bc8e, checked in by Phil Sutter <n0-1@…>, 19 years ago

Ok, moved the handbook to the right place now.

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@1138 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 36.7 KB
Line 
1FreeWRT 1.0 Handbook
2====================
3
4= Introduction =
5
6Welcome to FreeWRT! This handbook covers the building, installation and usage
7aspects of the FreeWRT 1.0 Linux distribution. FreeWRT is a portable, secure
8and functional Linux distribution for embedded systems. As FreeWRT is a source
9code distribution, it does not provide any pre-compiled firmware for embedded
10systems. The latest version of this document is always available at the
11FreeWRT website. If you have any comments, criticism or found some wrong
12description, please send us an eMail to freewrt-handbook@freewrt.org, we are
13always happy about getting feedback to this document, and will try to update
14or correct the issues mentioned by you.
15
16The handbook is split into five distinct sections. Appliance Development Kit
17covers the building of FreeWRT firmware images. The second section, Installing
18FreeWRT, covers all aspects regarding the installation and deinstallation of
19FreeWRT firmware images. The third section is a detailed description of the
20startup process of FreeWRT. The fourth section, Using FreeWRT, covers
21administrational tasks, such as network configuration, the FreeWRT
22configuration filesystem, package management and update mechanism. The last
23section helps troubleshooting problems and recovering a bad firmware
24installation. The appendix contains board specific information. For FreeWRT
251.0 these are only Broadcom based embedded systems.
26
27The intended audience for this handbook are advanced users with basic
28knowledge about Linux, networking and software development. The reader should
29be aware of basic command line tools, the vi editor and a shell. FreeWRT does
30not contain any high level administration tools (e.g. web based
31administration) and is fully configured via command line.
32
33== Typographic Conventions ==
34
35Examples starting with # indicate a command that must be invoked as super
36user. You can use su to gain super user privilges.
37
38{{{
39# fwcf commit
40}}}
41
42Examples staring with $ indicate a command that can be invoked as a normal
43user. The default user account on a freshly installed FreeWRT system is
44"admin".
45
46{{{
47$ cat /etc/banner
48}}}
49
50
51= Appliance Development Kit (ADK) =
52
53Our appliance development kit is called "buildroot". The ADK is the core of
54FreeWRT and contains all scripts and sources to create firmware images for
55every supported embedded system. FreeWRT 1.0 supports the following embedded
56systems:
57
58 * Asus WL500g
59 * Asus WL500g deluxe
60 * Asus WL500g premium
61 * Linksys WRT54G v1.0
62 * Linksys WRT54G v1.1
63 * Linksys WRT54G v2.0
64 * Linksys WRT54G v2.2
65 * Linksys WRT54G v3.0
66 * Linksys WRT54G v3.1
67 * Linksys WRT54G v4.0
68 * Linksys WRT54GS v1.0
69 * Linksys WRT54GS v1.1
70 * Linksys WRT54GS v4
71 * Linksys WRT54G3G
72 * Netgear WGT634u
73
74In this release we only support the Linux 2.4 kernel. The ADK contains over
75300 software packages.
76
77== Prerequisites ==
78
79Here is a list of all supported and tested host systems. The host system is
80needed to create a firmware for your embedded system.
81
82 * Debian GNU/Linux 3.1 or newer
83 * Gentoo Linux
84 * Ubuntu Dapper Drake or newer
85 * Fedora Core 4 or newer
86 * OpenBSD 3.9 or newer
87 * MirOS BSD
88
89Please install the following software, which is needed to build a basic
90firmware image. If you choose more packages some more prerequisites might be
91needed. Buildroot will warn you about any software you need to install to
92compile a specific package. Here is a list of the required software:
93
94 * gcc3 or higher
95 * g++
96 * binutils
97 * patch
98 * gzip
99 * bzip2
100 * unzip
101 * flex
102 * bison
103 * GNU make
104 * zlib (+headers)
105 * ncurses (+headers)
106 * (g)libc headers
107 * subversion
108 * perl
109
110The buildroot checks for the required versions of these tools in advance.
111
112To build FreeWRT with buildroot it is recommended to have an unprivileged
113user. Please _never_ build FreeWRT as super user. Because all necessary source
114tarballs are downloaded from the internet automagically, your host system
115needs a working internet connection.
116
117== Getting the source ==
118
119Now go to a directory where you want to build the firmware. Depending on the
120features you select you will need about 2.5-5 GB free disk space. This
121includes the buildroot itself, any source archives which will be downloaded
122and their extracted copies (for compiling).
123
124To get the initial FreeWRT 1.0 buildroot try one of these commands:
125{{{
126$ svn co http://www.freewrt.org/svn/branches/freewrt_1_0 freewrt
127$ svn co svn://www.freewrt.org/branches/freewrt_1_0 freewrt
128}}}
129
130After successfully downloading, enter the directory:
131{{{
132$ cd freewrt
133}}}
134
135This directory will be referred to as the ADK root later on.
136
137== Some Theory First ==
138
139Building a FreeWRT firmware image is just like building a new Linux kernel,
140but a little more complex. There is a ncurses-based configuration menu at the
141beginning, the changes made are saved into a file named ".config" in the ADK
142root. The build is done by the various Makefiles, compiling and linking the
143sources together accordingly to the symbols defined in ".config".
144
145Unlike kernel compilation, FreeWRT needs to be cross-compiled always. This
146leads to special premises, as most of the tools need to be specially build.
147But no panic, FreeWRT will do this all for you. In fact, this is done at the
148second run of {{{make}}} (the first one opens the configuration), and
149therefore can be seen as part of the first firmware build. For clarity
150though, we will discuss these two things separately.
151
152== Preparing the Build Process ==
153
154After downloading the FreeWRT ADK, it's time to prepare the ADK for the
155building of firmware Images (for explanations see the chapter above).
156
157=== Creating A Configuration ===
158The first step is to run {{{make}}}. After checking some prerequisites (see
159"Troubleshooting" below for aid in problems), a console based configuration
160menu should start. Theoretically no choices have to be made, but it's proven
161usefull to at least:
162 * select a target (menu: "Embedded System")
163 * select the root filesystem type (menu: "Target Firmware type")
164
165Then quit saving changes. If you forgot that, just run {{{make}}} again, redo
166your changes, then save.
167
168=== Building ADK ===
169Now that you have a (first) configuration, it is time to build the toolchain
170(compiler, libraries) for cross-compiling. To do this, just enter {{{make}}}
171again. The build starts downloading and compiling each needed part of the
172toolchain, and later continues with building the first firmware image. Later
173one can be taken as proof of a working ADK.
174
175Already experienced in compiling gcc? Then you know... If not, better be told
176that it takes _really_long_ to finish. In the meantime I suggest reading the
177next (optional) chapter dealing with internals about cross-compiling.
178
179== Details Of Cross-Compiling ==
180
181TODO: someone with enough knowledge about this may fill this chapter with
182_interesting_ information!
183
184== Building A FreeWRT Firmware Image ==
185
186Ok. Your local copy of the FreeWRT ADK should now be prepared for building
187images. The next step is to do an extensive configuration for the image you
188want to create. To start the configuration menu, type {{{make menuconfig}}}.
189
190when selecting packages, <*> means it will be inserted into the firmware
191images and <M> means it will be build as an addon package which can be
192installed later.
193
194The target device and filesystem should already been chosen by you to the
195right value, if not you will have to issue a {{{make clean}}} before actually
196building the firmware image, because otherwise things get messed up. (smooth
197rebuild is a (yet) missing feature in our buildroot.) For the packages, if
198unsure, you can just select one of the package collections. After that, you
199can still manually check the choices made by the collection and correct them
200if appropriate. Do not forget to save your configuration when leaving!
201
202Guess ... right, type {{{make}}} again to build the new FreeWRT firmware
203image. Depending on your package selections and underlying hardware, this will
204take different amounts of time. For your spare time there is the following
205chapter giving some explanation about what is done at this point.
206
207== Firmware Build Process In Detail ==
208
209Just like when building the ADK's toolchain, the sources for the selected
210packages are downloaded from the internet first, then build using the
211cross-compiler and libraries of the ADK.
212
213TODO: more to follow by some more skilled people!!
214
215== Troubleshooting ==
216This section deals with various tips for problems with ADK installation.
217
218=== Errors During Prerequisites Check ===
219To re-issue the checks, use "make prereq".
220
221 * GNU make 3.80 too old
222 On my FC4 buildsystem the first I get is
223 {{{
224 $ make
225 GNU make 3.80 too old.
226 Please install GNU make 3.81 or higher to continue.
227 You can override this check, see http://www.freewrt.org/faq for details.
228 It is suggested to upgrade your copy of bison to
229 GNU Bison 2.3 because of its bug fixes.
230 make: *** [.prereq_done] Error 1
231 }}}
232
233 it is quite a nice error that tells me to use more up to date software, but we can
234 anyhow give this hostsystem a try and tell make to ignore those errors/warnings:
235 {{{
236 make prereq-noerror
237 }}}
238
239
240= Installing FreeWRT =
241
242This document describes how to
243 * build FreeWRT firmware images using the buildroot environment,
244 * install the compiled firmware image to your router,
245 * restore the original firmware.
246
247== Configuring ==
248
249To start a fresh new build, type {{{make}}}. Some early preparation and
250checking is done, then a console based configuration menu should start.
251See section "Troubleshooting" below if there are errors.
252
253[[PICS]]
254
255The ncurses based menu will aid you in configuring the firmware to be build.
256At least:
257 * select a target (menu: "Embedded System")
258 * select the root filesystem type (menu: "Target Firmware type")
259
260when selecting packages, <*> means it will be inserted into the firmware
261images and <M> means it will be build as an addon package which can be
262installed later. If you change the target or root filesystem later you always
263need to clean up before rebuilding using {{{make clean}}}. (smooth rebuild is
264a (yet) missing feature in our buildroot)
265
266After finishing your selections hit "exit" and save your configuration. As
267already mentioned above, the file containing your configuration is ".config"
268in buildroot's top directory. '''BEWARE:''' never mess with manually editing
269this autogenerated file, it may lead to unexpected results. (such as exploding
270embedded systems, etc.)
271
272== Build it ==
273You have a config now and the system starts to build whatever you configured
274starting with the mandatory toolchain for crosscompiling. That looks like this:
275
276 * download the sources for the toolchain
277 * build the toolchain
278 * download the next piece of source
279 * and so on.
280
281And after the toolchain is built it goes on with the kernel and the packages.
282Finally the built binaries are tied together to a firmware image for your selected
283target platform.
284
285BTW: not only get a cup of coffee now but have a walk to the next coffee bar ...
286
287== have fun ==
288Coffe finished? Then it might be time to use your freshly built firmware now. If
289you don't know how, you are absolutely right here, as this is the handbook,
290currently pointing to the next chapter.
291
292== Build your firmware image ==
293
294Here is a step by step guide:
295 * If you might want to remove FreeWRT and restore the original firmware of your
296 * embedded system, you should get a working firmware image from the manufacturer
297 * of your embedded system first.
298 * Test the manufacturers firmware image, update the firmware on your embedded
299 * system just to see that everything works fine!
300 * For a minimum build of FreeWRT you need 1,2 GB free space on your hard disk of
301 * your host system. If you compile a full build of all available packages you
302 * might need up to 8 GB free space on your hard disk.
303 * Either install subversion on your host system to get the latest source of the
304 * buildroot or use the latest daily sourcecode snapshots from
305 * http://www.freewrt.org/downloads/source/ .
306 * Don't do the next steps as a priviliged user (f.e. root on a Linux system).
307 * Change to an unpriviliged user first.
308 * Create a directory in which the buildroot system will reside. Everything will
309 * be done inside this directory. The command rm -Rf <directory name> will remove
310 * all FreeWRT stuff, if you want to get rid of it, so don't worry!
311 * Change to the newly created directory.
312 * Get the FreeWRT buildroot environment:
313 * svn co svn://www.freewrt.org/
314 * wget http://www.freewrt.org/downloads/source/<name of the latest stable or
315 * trunk archive>[[BR]]
316 Then extract the files via tar xzvf freewrt-src-<version><date>.tar.gz
317 * After downloading approx. 200MB do:[[BR]]
318 cd www.freewrt.org/trunk/freewrt
319 * Now type: make menuconfig.[[BR]]
320 After a while a configuration menu will appear. If not you might need to
321install the ncurses development package of your host system.
322 * Select your embedded system model and select one of the target filesystems.
323 * For every software or kernel module package you have three options
324 1. not selected < >
325 2. Build a s standalone package <M>
326 3. Include the package into the firmware image <*>
327 * Do not include too many packages into the firmware image file, it is limited in
328 * size! (depends on your hardware). You can install additional packages later.
329 * If you like, step through the configuration options to see whats available.
330 * Quit the configuration menu and save your configuration.
331 * To build the firmware image type "make" or "make v" for verbose mode.
332 * Your compile has been started now. This will take some time (30 minutes (P4
333 * 3GHZ) to 10 Hours (100 MHz P1) ) depending on your hardware. The toolchain for
334 * crosscompiling will be build first, then the kernel for the system and at last
335 * all selected packages.
336 * For some packages to compile, some extra tools need to be installed on your
337 * host system, please read the error messages carefully.
338 * After the build has been completed you will find all packages and one firmware
339 * image in the bin directory (do: cd bin ; ls -l)
340
341== Flashing the compiled firmware to your embedded system ==
342 * For Linksys Routers like WRT54GL, you can use the webinterface. Just select the
343 * firmware upgrade page, and select the FreeWRT image as firmware file. Do
344 * NEVER remove power from your router while it flashes !!
345 * Now type: ssh admin@192.168.1.1 (Use default password FreeWRT, if you didn't
346 * changed it in the configuration process)
347 * You should be logged into your router now. Congratulation. Use "su" to get root
348 * access.
349
350== How to install and remove software via the ipkg utility ==
351
352Use the ipkg utility to install and remove software.
353
354ipkg install <filename> # this is used for installing software
355ipkg remove <package-name> # this is used for removing a package
356ipkg list_installed # lists all installed packages by the name of the package
357
358To install a new package you need to transfer the package to your router this can
359be done by using scp or ftp.
360When you want to use ftp you need to start vsftpd on your router first.
361When the package has been transferred to your router, you can install it by
362typing: ipkg install <package filname>
363
364
365== First steps ==
366
367== Startup process ==
368
369=== Flash layout ===
370
371The flash layout of the supported embedded systems is designed in the same way.
372There are some model specific differences between the exact sizes and partition
373offsets.
374
375We always have a separate partition for the bootloader. After that we have a
376partition for the kernel including a embedded root filesystem.
377
378=== Bootloader ===
379
380The bootloader initializes the hardware, f.e. CPU, cache and ethernet devices.
381The different supported embedded systems have different bootloaders, with
382different features and sizes. To access the bootloader and a command line
383prompt you always need a serial connection to the embedded system.
384Not all embedded systems have a serial device onboard or only some crippled
385ones. Most of the time you can solder the board to get some working serial
386device, but this is not part of this short technical introduction.
387
388=== Kernel ===
389
390The kernel is configured via append line to startup the ash compatible
391/etc/preinit script.
392
393=== Preinit ===
394
395This is needed to first make some checks, which root filesystem is used and
396then to switch the root filesystem to that. This is either a complete writable
397root filesystem, which fills up the complete available flash.
398
399The preinit script exports the environment variable PATH and then mounts the
400virtual proc filesystem to /proc.
401
402There is another board specific preinit script, which is used to setup
403some board specific drivers or startup variables. (preinit.arch)
404After that the script mount\_root will mount the root filesystem and
405all other filesystems and startup init to start the system.
406
407is_dirty:
408reserved a byte for this flag at the end of the lzma loader
40915:21 < nbd> (where it would not disturb the boot loader or the firmware)
41015:22 < nbd> so the offset to this byte is the offset to the second partition - 1
41115:23 < nbd> directly after flashing this byte is set to 0
41215:23 < nbd> and in shell 0 == true :)
41315:24 < nbd> jffs2root changes it
41415:24 < nbd> --clean
41515:24 < nbd> initially it's 0, jffs2root sets it to 1
416
417=== Root filesystem ===
418
419- mini-fo
420- jffs2
421- symlinks
422
423=== Init scripts ===
424
425In /etc/inittab we use /etc/init.d/rcS to startup all services, which
426are activated in /etc/rc.conf
427
428== Configuration filesystem ==
429
430
431== Network configuration ==
432
433= Network Configuration =
434
435The device names for real network interfaces in Linux are named ethx (x is 0-9).
436If the device has a switch the different ports are separated via VLAN technology.
437The vlan interfaces are named ethx.y.
438The network configuration in FreeWRT is managed via Busybox's ifupdown
439implementation. Busybox's ip builtin
440command configures the network interfaces. There is no "ifconfig" or "route".
441To show all configured network interfaces use:
442{{{
443$ ip addr show
444}}}
445To show the kernel routing table use:
446{{{
447$ ip route show
448}}}
449
450All available network settings can be found in {{{/etc/network/interfaces}}} which
451has the common form:
452{{{
453auto <iface-name>
454iface <iface-name> inet <method>
455 <option-x> <value>
456 <option-y> <value>
457 <option-z> <value>
458}}}
459
460{{{auto <iface-name>}}} is optional and, if set, tells the "ifup" script to start
461this interface automatically on bootup.
462
463Each interface needs a unique name which, depending on the method, represent a
464physical interface or a logical interface name like "eth0.1" for a physical VLAN
465or "umts" as a logical name for a ppp interface.
466
467Possible methods are:
468{{{
469 static :use the given options to configure the interface statically
470 dhcp :just start a dhcp client using the interface "iface-name"
471 manual :don't configure the interface but start pre-up.d hook scripts
472 ppp :run "pon <provider>" where "<provider>" is given as an interface option
473}}}
474
475== Switch/VLAN ==
476The switch built-in in the most routers is capable of separating each port using
477VLAN tagging. You can configure the switch simply by adding the interface to the
478config file and give the desired switch-ports:
479{{{
480auto eth0.0
481iface eth0.0 inet static
482 switch-ports 1 2 5*
483 address 192.168.1.1
484 netmask 255.255.255.0
485
486auto eth0.1
487iface eth0.1 inet static
488 switch-ports 3 4 5
489 address 192.168.2.1
490 netmask 255.255.255.0
491
492auto eth0.2
493iface eth0.2 inet static
494 switch-ports 0 5
495 address 172.16.1.42
496 netmask 255.255.255.0
497 gateway 172.16.1.1
498}}}
499
500This configures three VLAN interfaces "eth0.0" on "1" and "2", "eth0.1" on port
501"3" and "4" and "eth0.2" on port "0".
502Explanation:
503{{{
504 port 0 :this is typically the port labeled as WAN
505 port 1-4 :these are typically the ports labeled as LAN
506 port 5 :this special port represents the port where the
507 router-board is connected to the switch
508 * :one interface always need an asterisk behind port 5
509 which means it is the default interface and gets all
510 the packages with unknown tags.
511}}}
512
513== Static IP configuration ==
514As you can see in the VLAN example I configured three interfaces with static IP
515settings, so these are the commonly used options:
516{{{
517 address :the IP address - required
518 netmask :the netmask - required
519 gateway :an IP address added as default gateway if present
520}}}
521
522== DHCP ==
523That's just as simple as:
524{{{
525auto eth0.1
526iface eth0.1 inet dhcp
527 switch-ports 0 5
528}}}
529Typically this configures the WAN-Port to start a DHCP request on bootup.
530
531== Bridging ==
532This is mostly needed to combine LAN and WLAN to a homogeneous network like:
533{{{
534auto eth0.0
535iface eth0.0 inet manual
536 switch-ports 1 2 3 4 5*
537
538auto eth1
539iface eth1 inet manual
540 [... wifi-settings, see below ...]
541
542auto br0
543iface br0 inet static
544 bridge-ifaces eth0.0 eth1
545 address 192.168.1.1
546 netmask 255.255.255.0
547}}}
548This creates a new bridging interface "br0" which combines the VLAN interface
549eth0.0 (representing the LAN-ports 1-4) and the WLAN interface "eth1" (on some
550devices like Asus WL500g or Linksys WRT54G v1.1 this might be eth2).
551
552== WLAN ==
553A router containing a WLAN interface has an additional ethernet device, which
554represents it. On Broadcom based hardware it is typically eth1 (Linksys) or eth2
555(Asus) (in the current driver version), on Madwifi devices it is ath0, ath1, etc.
556You can use these interfaces standalone or bridged with other devices, e.g. the
557internal LAN.
558
559=== Basic Settings ===
560
561^*^ with Option means mandatory, ^*^ with Parameter means default.
562
563|| '''Option''' || '''Parameter''' || '''Description''' ||
564|| type^*^ || broadcom || Broadcom based card ||
565|| || atheros || Madwifi driver ||
566|| mode^*^ || ap || Access point mode ||
567|| || sta || Client mode ||
568|| || adhoc || Ad-Hoc mode ||
569|| || wds || WDS point-to-point link ||
570|| || monitor || The node acts as a passive monitor and only
571receives packets ||
572|| ssid^*^ || <String> || Set the SSID (Network Name) ||
573|| country || {ALL|DE|JP|US|...} || The country code used to determine the
574regulatory settings. ||
575
576=== Security Settings ===
577
578|| '''Option''' || '''Parameter''' || '''Description''' ||
579|| security^*^ || open || No authorization ||
580|| || wep || WEP key ||
581|| || wpa-psk || WPA with preshared key ||
582|| || 8021x || IEEE 802.1X authentication ||
583|| authorization^*^ || || '''wep''' ||
584|| || open || Only Open System Authentication ||
585|| || shared || Only Shared Key Authentication ||
586|| || open+shared^*^ || Both Open System and Shared Key
587Authentication ||
588|| || || '''wpa-psk''' ||
589|| || psk || WPA PSK ||
590|| || psk2 || WPA2 PSK ||
591|| || psk psk2 || WPA PSK and WPA2 PSK ||
592|| || || '''8021x''' ||
593|| || open || Only Open System Authentication ||
594|| || shared || Only Shared Key Authentication ||
595|| || wpa || WPA with RADIUS ||
596|| || wpa2 || WPA2 with RADIUS ||
597|| || wpa wpa2 || WPA and WPA2 ||
598|| encryption^*^ || || '''wep''' ||
599|| || - || not needed, automatically by key size ||
600|| || || '''wpa-psk''' ||
601|| || tkip || RC4 encryption ||
602|| || aes || AES encryption ||
603|| || aes+tkip || support both ||
604|| || || '''8021x''' ||
605|| || wep || RC4 encryption (static) ||
606|| || tkip || RC4 encryption ||
607|| || aes || AES encryption ||
608|| || aes+tkip || support both ||
609|| eap-type || || '''8021x''' ||
610|| || tls^*^ || Transport Layer Security ||
611|| || ttls || Tunnelled TLS ||
612|| || peap || Protected EAP ||
613|| || leap || Cisco Wireless ||
614|| key || || '''wep''' ||
615|| || {1^*^|2|3|4} || Select WEP key to use. ||
616|| key[1..4] || || '''wep''' ||
617|| || <String> || WEP key. The key must be 5, 13 or 16 bytes
618long, or 10, 26, 32, or 64 hex digits long. The encryption algorithm is
619automatically selected based on the key size. key1 is the key for WEP client mode.
620||
621|| wpa-key || || '''wpa-psk''' ||
622|| || <String> || Password to use with WPA/WPA2 PSK (at least
6238, up to 63 chars) ||
624|| wpa-gtk-rekey || || '''wpa-psk''', '''8021x''' ||
625|| || <Int> (3600^*^) || Rekeying interval in seconds. ||
626|| radius-ipaddr^*^ || || '''8021x''' ||
627|| || <a.b.c.d> || IP to connect. ||
628|| radius-port || || '''8021x''' ||
629|| || <Int> (1812^*^) || RADIUS-Port# to connect ||
630|| radius-key^*^ || || '''8021x''' ||
631|| || <String> || Shared Secret for connection to the Radius
632server ||
633
634=== MAC filter ===
635
636|| '''Option''' || '''Parameter''' || '''Description''' ||
637|| macmode || {0|1|2} || 0 - Disable MAC address matching. ||
638|| || || 1 - Deny association to stations on the MAC
639list. ||
640|| || || 2 - Allow association to stations on the MAC
641list. ||
642|| maclist || <MAC1> ... <MACn> || List of space separated mac addresses to
643allow/deny according to ''macmode''. Addresses should be entered with colons,
644e.g.: "00:02:2D:08:E2:1D 00:03:3E:05:E1:1B". note that if you have more than one
645mac use quotes or only the first will be recognized. ||
646
647=== Wireless Distribution System (WDS) / Repeater / Bridge ===
648|| '''Option''' || '''Parameter''' || '''Description''' ||
649|| lazywds || {0|1} || Accept WDS connections from anyone ||
650|| wds || <MAC1> ... <MACn> || List of WDS peer mac addresses
651(xx:xx:xx:xx:xx:xx, space separated) ||
652
653=== Miscellaneous ===
654|| '''Option''' || '''Parameter''' || '''Description''' ||
655|| channel || {1-14} || The wifi channel ||
656|| maxassoc || {1-255} || Maximum number of associated clients ||
657|| gmode || {LegacyB| Auto^*^| GOnly| BDeferred| Performance| LRS} || Set
658the 54g Mode ||
659|| frameburst || {0^*^|1} || Disable/Enable frameburst mode. ||
660|| txpower || {0-255|-1^*^} || Set the transmit power in dBm ||
661|| rate || <Int> (-1^*^) || force a fixed rate ||
662|| || || valid values for 802.11a are (6, 9, 12, 18,
66324, 36, 48, 54) ||
664|| || || valid values for 802.11b are (1, 2, 5.5, 11)
665||
666|| || || valid values for 802.11g are (1, 2, 5.5, 6,
6679, 11, 12, 18, 24, 36, 48, 54) ||
668|| || ||-1 means automatically determine the best
669rate ||
670|| rts || {0-2347} || Set the RTS threshhold. ||
671|| frag || {256-2346} || Set the fragmentation threshhold. ||
672|| afterburner || {0^*^|1} || Enable Afterburner capability ||
673|| isolate || {0^*^|1} || Hide Clients from each other ||
674
675=== Examples ===
676WLAN with WEP128
677{{{
678iface eth1 inet static
679 address 192.168.10.1
680 netmask 255.255.255.0
681 wireless-type broadcom
682 wireless-country DE
683 wireless-mode ap
684 wireless-ssid FreeWRT
685 wireless-security wep
686 wireless-key1 11223344556677889900112233
687 wireless-channel 11
688}}}
689
690WLAN without encryption
691{{{
692iface eth1 inet static
693 address 192.168.10.1
694 netmask 255.255.255.0
695 wireless-type broadcom
696 wireless-country DE
697 wireless-mode ap
698 wireless-ssid FreeWRT
699 wireless-security open
700 wireless-channel 11
701}}}
702
703WLAN with WPA2 (AES)
704{{{
705iface eth1 inet static
706 address 192.168.10.1
707 netmask 255.255.255.0
708 wireless-type broadcom
709 wireless-country DE
710 wireless-mode ap
711 wireless-ssid FreeWRT
712 wireless-security wpa-psk
713 wireless-authorization psk2
714 wireless-encryption aes
715 wireless-wpa-key 12345678
716 wireless-channel 11
717}}}
718
719If you want to do MAC filtering, add the following to the sample above:
720{{{
721 wireless-macmode 2
722 wireless-mac 00:01:02:03:04:05 06:07:08:09:0a:0b
723}}}
724this enables the filter and defines the list to contain addresses that should be
725allowed.
726
727To enhanced wireless performance, you can enable some flags like Broadcom's
728SpeedBooster. Normally, these flags are not dangerous:
729{{{
730 wireless-gmode performance
731 wireless-frameburst 1
732 wireless-afterburner 1
733}}}
734
735WLAN client with WPA2 (AES) (''untested'')
736{{{
737iface eth1 inet static
738 address 192.168.10.1
739 netmask 255.255.255.0
740 wireless-type broadcom
741 wireless-country DE
742 wireless-mode sta
743 wireless-ssid FreeWRT
744 wireless-security wpa-psk
745 wireless-authorization psk2
746 wireless-encryption aes
747 wireless-wpa-key 12345678
748}}}
749
750WLAN client with WEP128
751{{{
752iface eth1 inet dhcp
753 wireless-type broadcom
754 wireless-country DE
755 wireless-mode sta
756 wireless-ssid FreeWRT
757 wireless-security wep
758 wireless-key1 11223344556677889900112233
759}}}
760
761== PPP ==
762PPP comes in various flavours for different situations, the most commonly needed
763will be DSL I think and for WRT54G3G users UMTS. So we made a hook-script that
764evaluates a "use-template" option and generates a ppp-peer. This way everything
765needed so far can be configured within the "interfaces" file.
766
767=== DSL ===
768{{{
769auto ppp0
770iface ppp0 inet ppp
771 use-template dsl
772 provider t-online
773 ppp-username 0001201234563200123456#0001@t-online.de
774 ppp-password fooBARfoo
775 ppp-device eth0.1
776}}}
777
778Now your t-online dsl connection will be started on boot ("auto ppp0") and you can
779manually shut it down with "ifdown ppp0" or start it up with "ifup ppp0".
780The template "dsl" will configure a typical PPPoE peer for you.
781
782=== UMTS ===
783Same footprint different template and some specific options. That all needed for
784an UMTS connection to Vodafone as it can be seen in this example.
785{{{
786iface ppp0 inet ppp
787 use-template umts
788 provider umts
789 #ppp-username ""
790 #ppp-password ""
791 ppp-device /dev/noz0
792 umts-apn web.vodafone.de
793 umts-pincode 1234
794 umts-mode umts_first
795}}}
796As you can see: unneeded options like "ppp-username" or "ppp-password" can just be
797removed or commented out. Don't leave them without a value as that causes a
798failure in "ipup". It does work if you give empty double quotes as value like "".
799
800Note that you have to set the correct APN, username and password for your
801provider!
802
803You may also remove the pin from your SIM-card and the configuration if you like.
804
805For Linksys WRT54G3G a package called "broadcom-watchbutton" will be installed,
806this is a small daemon that monitors the UMTS-button of the router and executes
807"ifup umts" or "ifdown umts" on a button press.
808You have to set "watchdog=YES" in /etc/rc.conf to have it start automagically.
809
810This is totally independent from the "auto umts" setting. Even if you start the
811connection on bootup you can shut it down again with a button press.
812
813== custom interface hooks ==
814=== per interface ===
815You can execute various commands on interface startup or shutdown with special
816option:
817{{{
818iface foobar inet static
819 [...]
820 pre-up <command>
821 up <command>
822 up <command>
823 down <command>
824 post-down <command>
825}}}
826
827You can give each option multiple times and their commands will be executed in
828given order.
829{{{
830 pre-up :before the interface will be started
831 up :after the interface was started successfully
832 down :before the interface goes down
833 post-down :after the interface shut down
834}}}
835
836=== general hooks ===
837Additionally you can write script executed for each interface if you put them in
838 * /etc/network/if-pre-up.d
839 * /etc/network/if-up.d
840 * /etc/network/if-down.d
841 * /etc/network/if-post-down.d
842Same semantics as above.
843
844
845== Package management ==
846
847== Troubleshooting ==
848
849=== Failsafe mode ===
850
851Failsafe mode is very useful if you misconfigured your embedded system,
852so that you can not access it anymore. For example you disabled accidently
853secure shell or misconfigured the firewall, so that you can not login via
854secure shell.
855
856== How it works ==
857
858To get FreeWRT into failsafe mode you need physical access to the device and
859the failsafe utility. The failsafe utility is build inside our ADK and
860is available in the directory bin/ after a successful build.
861
862If you just want to compile the tool and not a complete firmware image,
863use following command:
864{{{
865$ make subdir=tools/failsafe install
866}}}
867
868For some operating systems we provide ready to go binaries of failsafe.
869Take a look at http://www.freewrt.org/downloads/tools/failsafe
870
871The tool just opens a network socket and waits for a special UDP packet
872from the embedded device. FreeWRT sends the UDP packet via the first
873recognized network interface (eth0).
874
875== Enable failsafe mode ==
876
877Connect your computer to the embedded system via direct or crossed network
878cable. Use the failsafe port, in most cases one of the LAN ports,
879see the device specific page for the exact network port.
880
881Configure your network interface to the IP address 192.168.1.2 with network
882mask 255.255.255.0. Now start the failsafe utility on your computer.
883
884{{{
885./failsafe
886}}}
887
888After that startup your embedded system and wait for the following message in your
889failsafe application running on your computer:
890{{{
891Press reset now to enter Failsafe!
892}}}
893
894As soon as this message is displayed you should push the reset button of
895your embedded system. You have 2 seconds time to push the button. If you
896successfully enabled the failsafe mode, following message is displayed:
897{{{
898Entering Failsafe!
899}}}
900
901Now you should be able to login to your embedded system via a telnet
902application. Just use:
903{{{
904telnet 192.168.1.1
905}}}
906
907== Repair your FreeWRT configuration ==
908
909If you want to repair your configuration, you first need to
910mount the root filesystem via:
911{{{
912mount_root
913}}}
914
915After that you need to enable the FreeWRT configuration filesystem:
916{{{
917fwcf setup
918}}}
919
920Now you can change files in /etc and repair your broken configuration.
921Do not forget to commit your changes afterwards.
922{{{
923fwcf commit
924}}}
925
926If you want to start with the default /etc directory, just remove the fwcf
927partition content with following command:
928{{{
929mtd erase fwcf
930}}}
931
932Software reset/reboot does not work in failsafe, please disconnect the power cable
933to restart.
934
935== Serial console ==
936
937== JTAG ==
938
939== Restoring the original firmware ==
940
941Removing FreeWRT and restoring the original Firmware is very simple. Just transfer
942the original firmware image, which was downloaded before you installed FreeWRT to
943your embedded system, to your embedded system via secure copy (scp/pscp). See the
944following steps:
945
946 * Transfer the manufacturers firmware image to the router. This can be done via
947 * scp/pscp
948 * For using scp do: scp <firmware-image-filename> admin@192.168.1.1:
949 * Now login to your router via ssh and get root access.
950 * Now write the firmware to the flash ROM by typing: mtd write -r
951 * <firmware-image-filename> linux
952 * Your router will reboot when the flash process is completed and the original
953 * firmware has been restored.
954
955= Broadcom specific notes =
956
957=== Drivers ===
958
959=== NVRAM ===
960
961== Default settings ==
962On many router models, you can completly erase the NVRAM, some values will then
963reappear as default. This is often useful when you want to drop the relicts from
964the original firmware. Please look into the model docs to make sure its safe.
965{{{
966mtd -r erase nvram
967}}}
968
969== boot_wait ==
970On many router models (like Linksys), you can flash the router via tftp even in a
971special failsafe mode. To make sure the router will wait long enough for the tftp
972put command, set the special NVRAM parameter boot_wait
973{{{
974nvram set boot_wait=on
975nvram commit
976}}}
977
978= Firmware =
979
980== Flashing via TFTP ==
981You have to set the router in failsafe mode (often done by holding the reset
982button when switching the router on), then you can upload the image. On most
983routers, the default ip address is 192.168.1.1, unfortunately, Asus routers uses
984the ip address saved in nvram.
985{{{
986tftp 192.168.1.1
987tftp> binary
988tftp> trace
989tftp> rexmt 1
990tftp> put <image.bin>
991}}}
992
993or from Windows:
994{{{
995tftp -i 192.168.1.1 put <image.bin>
996}}}
997
998== Flashing via mtd ==
999
1000If you have direct access to the router, you can use mtd to flash the firmware
1001locally. Copy the bin file via scp to the router (to /tmp memory filesystem) and
1002execute:
1003{{{
1004mtd -r write <image.bin> linux
1005}}}
1006
1007If you update from older FreeWRT installations and you want to remove your changes
1008to /etc, use:
1009{{{
1010mtd -e fwcf -r write <image.bin> linux
1011}}}
1012
1013The mtd application automatically convert bin to trx, so that a manual convert via
1014dd is not necessary.
1015
Note: See TracBrowser for help on using the repository browser.