source: freewrt/docs/handbook/user/handbook.tex@ 65874e6

freewrt_1_0 freewrt_2_0
Last change on this file since 65874e6 was 65874e6, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago

you can now change the mac address for ethernet devices eth0.x via interfaces

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

  • Property mode set to 100644
File size: 49.5 KB
Line 
1\documentclass[12pt,a4paper,openany,smallheadings,
2headinclude,headsepline,final]{scrreprt}
3\usepackage[utf8]{inputenc}
4\usepackage{amsmath}
5\usepackage{amsfonts}
6\usepackage{amssymb}
7\usepackage{caption2}
8\usepackage[canadian]{babel}
9\usepackage{varioref}
10\usepackage{txfonts}
11\usepackage[pdftex]{graphicx}
12%\usepackage{listings}
13\usepackage{makeidx}
14\usepackage[T1]{fontenc}
15
16% fancy verbatim enables changing of font, fontsize, etc. in verbatim code
17% also set smaller font and a frame as default
18\usepackage{fancyvrb}
19\fvset{fontsize=\small, frame=single}
20
21% marvosym macht Pfeil kaputt, also sichern
22% line 28, /usr/share/texmf/tex/latex/marvosym/marvosym.sty
23\let\RescueRightarrow=\Rightarrow
24\usepackage{marvosym}
25\renewcommand{\Rightarrow}{\RescueRightarrow}
26
27\usepackage[pdftex]{color}
28\definecolor{skyblue}{rgb}{0,0.3323,0.5720}
29\usepackage[%
30colorlinks=true,anchorcolor=red,
31breaklinks=true,linkcolor=blue,urlcolor=red,
32citecolor=skyblue,
33pdfauthor={The FreeWRT Team},
34pdftitle={FreeWRT User Handbook},
35pdfcreator={tetex and VIM},
36pdfsubject={Open Source},
37pdfview=FitV,
38pdfstartview=FitV,
39pdfstartpage={1},
40pdfpagelayout=SinglePage,
41pdfpagemode=None,
42pdfkeywords={FreeWRT}]{hyperref}
43%\usepackage{thumbpdf}
44\usepackage{cancel}
45%\usepackage[final, activate, verbose=true]{microtype}
46\usepackage{ngerman}
47%\usepackage{bookman}
48%\usepackage[a4paper,twoside,rmargin=2cm,lmargin=2cm,tmargin=2.5cm]{geometry}
49\usepackage[a4paper,rmargin=2cm,lmargin=2cm,tmargin=2.5cm,bmargin=3.5cm]{geometry}
50%\usepackage{ncntrsbk}
51\usepackage{float}
52\restylefloat{figure}
53%\bibliographystyle{alphadin}
54\bibliographystyle{alpha}
55
56% Change Section, Chapter Layout
57% http://www.mackichan.com/index.html?techtalk/518.htm~mainFrame
58%\usepackage{sectsty}
59%\allsectionsfont{\raggedleft}
60%\chapterfont{\raggedleft}
61
62% BEGIN Fancy Header Extensions
63% Save Graphics in Latex box
64%\renewcommand{\headheight}{30pt} %Make height wider so picture is ok
65%\renewcommand{\footskip}{45pt} %Make height wider so picture is ok
66
67\usepackage{fixltx2e, mparhack}
68
69% Generate index in preamble
70\makeindex
71\begin{document}
72\setlength{\marginparwidth}{10mm}
73\include{cover}
74\renewcommand{\thepage}{\roman{page}}
75\tableofcontents
76%Set Arabic Numbering 1,2,3,...
77% Clear needed to renumber from the right position
78\cleardoublepage
79\renewcommand{\thepage}{\arabic{page}}
80%Reset Counter
81%\setcounter{page}{1}
82
83% Set marks where it should Change
84\renewcommand{\chaptermark}[1]{%
85\markboth{\large \thechapter.\ \normalsize \scshape #1}{}}
86\renewcommand{\sectionmark}[1]{\markright{\thesection.\ \scshape #1}}
87
88%Bilitz
89%\newcommand{\blitz}{ \mbox{\Huge \Lightning} }
90\newcommand{\blitz}{ \Lightning }
91\newcommand{\entspr}{\stackrel{\wedge}{=}}
92
93
94
95\chapter{Introduction}
96
97Welcome to FreeWRT! This handbook covers the building, installation and usage
98aspects of the FreeWRT 1.0 Linux distribution. FreeWRT is a portable, secure
99and functional Linux distribution for embedded systems. As FreeWRT is a source
100code distribution, it does not provide any pre-compiled firmware for embedded
101systems. The latest version of this document is always available at the
102FreeWRT website. If you have any comments, criticism or found some wrong
103description, please send us an e-mail to freewrt-handbook@freewrt.org, we are
104always happy about getting feedback to this document, and will try to update
105or correct the issues mentioned by you.
106
107The FreeWRT User handbook is split into five distinct sections. Appliance
108Development Kit covers the building of FreeWRT firmware images. The second
109section, Installing FreeWRT, covers all aspects regarding the installation and
110deinstallation of FreeWRT firmware images. The third section is a detailed
111description of the startup process of FreeWRT. The fourth section, Using FreeWRT,
112covers administrational tasks, such as network configuration, the FreeWRT
113configuration filesystem, package management and update mechanism. The last
114section helps troubleshooting problems and recovering a bad firmware installation.
115The appendix contains board specific information. For FreeWRT 1.0 these are only
116Broadcom based embedded systems.
117
118The intended audience for this handbook are advanced users with basic
119knowledge about Linux, networking and software development. The reader should
120be aware of basic command line tools, the vi editor and a shell. FreeWRT does
121not contain any high level administration tools (e.g. web based
122administration) and is fully configured via command line.
123
124\section{Typographic Conventions}
125
126Examples starting with \# indicate a command that must be invoked as super
127user. You can use su to gain super user privileges.
128
129\begin{Verbatim}
130# fwcf commit
131\end{Verbatim}
132
133Examples starting with \$ indicate a command that can be invoked as a normal
134user. The default user account on a freshly installed FreeWRT system is
135,,admin'', the password ,,FreeWRT''.
136
137\begin{Verbatim}
138$ cat /etc/banner
139\end{Verbatim}
140
141\chapter{Appliance Development Kit (ADK)}
142
143The ADK is the core of FreeWRT and contains all scripts and sources to create
144firmware images for every supported embedded system. FreeWRT 1.0 supports the
145following embedded systems:
146
147\begin{itemize}
148\item Asus WL500g
149\item Asus WL500g deluxe
150\item Asus WL500g premium
151\item Linksys WRT54G v2.0
152\item Linksys WRT54G v2.2
153\item Linksys WRT54G v3.0
154\item Linksys WRT54G v3.1
155\item Linksys WRT54G v4.0
156\item Linksys WRT54GS v1.0
157\item Linksys WRT54GS v1.1
158\item Linksys WRT54GS v4
159\item Linksys WRT54G3G
160\item Linksys WRT54GL
161\item Netgear WGT634u
162\end{itemize}
163
164In this release we only support the Linux 2.4 kernel. The ADK contains over
165600 software packages.
166
167\section{Prerequisites}
168
169Here is a list of all supported and tested host systems. The host system is
170needed to create a firmware for your embedded system.
171
172\begin{itemize}
173\item Debian GNU/Linux 3.1 or newer
174\item Gentoo Linux
175\item Ubuntu Dapper Drake or newer
176\item Fedora Core 4 or newer
177\item OpenBSD 3.9 or newer (partial support)\footnote{some addon packages does not compile}
178\item MirOS BSD (partial support)\footnote{some addon packages does not compile}
179\end{itemize}
180
181Please install the following software, which is needed to build a basic
182firmware image. If you choose more packages some more prerequisites might be
183needed. The ADK host checks will warn you about any software you need to install to
184compile a specific package. Here is a list of the required software:
185
186\begin{itemize}
187\item gcc3 or higher
188\item g++
189\item binutils
190\item patch
191\item gzip
192\item bzip2
193\item unzip
194\item flex
195\item bison
196\item GNU make
197\item zlib (+headers)
198\item ncurses (+headers)
199\item (g)libc headers
200\item perl
201\end{itemize}
202
203The ADK scripts will check for the required versions of these tools in advance.
204
205To build FreeWRT with the ADK it is recommended to have an unprivileged
206user. Please \underline{never} build FreeWRT as super user. Because all necessary source
207tarballs are downloaded from the internet automatically, your host system
208needs a working internet connection.
209
210\section{Getting the source}
211
212Now go to a directory where you want to build the firmware. Depending on the
213features you select you will need about 2.5-5 GB free disk space. This
214includes the ADK itself, any source archives which will be downloaded
215and their extracted copies (for compiling).
216
217To get the initial FreeWRT 1.0 ADK try one of these commands:
218\begin{Verbatim}
219$ svn co http://www.freewrt.org/svn/branches/freewrt_1_0 freewrt
220$ svn co svn://www.freewrt.org/branches/freewrt_1_0 freewrt
221\end{Verbatim}
222
223After successfully downloading, enter the directory:
224
225\begin{Verbatim}
226$ cd freewrt
227\end{Verbatim}
228
229This directory will be referred to as the ADK root later on.
230
231\section{Some Theory First}
232
233Building a FreeWRT firmware image is just like building a new Linux kernel,
234but a little more complex. There is a ncurses-based configuration menu at the
235beginning, the changes made are saved into a file named ,,.config'' in the ADK
236root. The build is done by the various Makefiles, compiling and linking the
237sources together accordingly to the symbols defined in ,,.config''.
238
239Unlike kernel compilation, FreeWRT needs to be cross-compiled. This
240leads to special premises, as most of the tools need to be specially build.
241But no panic, FreeWRT will do this all for you. In fact, this is done at the
242second run of \texttt{make} (the first one opens the configuration), and
243therefore can be seen as part of the first firmware build. For clarity
244though, we will discuss these two things separately.
245
246\section{Preparing the Build Process}
247
248After downloading the FreeWRT ADK, it's time to prepare the ADK for the
249building of firmware images (for explanations see the chapter above).
250
251\subsection{Creating A Configuration}
252The first step is to run \texttt{make}. After checking some prerequisites (see
253,,Troubleshooting'' below for aid in problems), a console based configuration
254menu should start. Theoretically no choices have to be made, but it's proven
255useful to at least:
256\begin{itemize}
257\item select a target (menu: ,,Embedded System'')
258\item select the root filesystem type (menu: ,,Target Firmware type'')
259\end{itemize}
260
261Then quit saving changes. If you forgot that, just run \texttt{make} again, redo
262your changes, then save.
263
264\subsection{Building ADK}
265
266Now that you have a first minimal configuration, it is time to build the toolchain
267for cross-compiling. To do this, just enter {{{make}}} again. The build starts
268downloading and compiling each needed part of the toolchain, and later continues
269with building the first firmware image. Later one can be taken as proof of a
270working ADK.
271
272Already experienced in compiling gcc? Then you know... If not, better be told
273that it takes \underline{really long} to finish. In the meantime I suggest reading the
274next chapter dealing with internals about cross-compiling.
275
276\section{Details Of Cross-Compiling}
277
278A cross-compile toolchain exists of a set of tools: a compiler, linker, assembler,
279debugger and a c library. A cross-compile toolchain runs on your host system and
280creates native binaries for your target system. A cross-compile toolchain is
281basically created in six steps:
282
283\begin{enumerate}
284\item Get and prepare the Kernel and C Library headers of your target system
285\item Compile the binutils package for your target
286\item Compile a static C compiler for your target
287\item Compile and install a C library for your target
288\item Compile and install a full C/C++ compiler
289\item Compile and install the GNU debugger
290\end{enumerate}
291
292The cross-compile toolchain is created in
293,,staging\_dir\_\$(cpu\_arch)''\footnote{f.e. mipsel, which stands for MIPS Little
294Endian)}. All the tools running on the host, but used to create, analyze or debug
295for the target are kept in this directory. All addon headers and libraries
296are installed to this directory.
297
298If you want to compile a simple application without using the ADK, just use the
299compiler directly (f.e. compiling a MIPS Little Endian application):
300\begin{verbatim}
301./staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc -o myapp myapp.c
302\end{verbatim}
303
304Check with ,,file'' if you got a MIPS binary:
305\begin{verbatim}
306$ file myapp
307myapp: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), dynamically
308linked (uses shared libs), not stripped
309\end{verbatim}
310
311\section{Building A FreeWRT Firmware Image}
312
313Your local copy of the FreeWRT ADK should now be prepared for building firmware
314images. The next step is to do an extensive configuration for the image you
315want to create. To start the configuration menu, type ,,\texttt{make menuconfig}''.
316
317When selecting packages, \texttt{<*>} means it will be inserted into the firmware
318images and \texttt{<M>} means it will be build as an addon package which can be
319installed later at runtime.
320
321The target device and filesystem should already been chosen by you to the right
322value, if not you will have to issue a ,,\texttt{make clean}'' before actually
323building the firmware image. Otherwise things get messed up. A smooth
324rebuild is a missing feature in the current ADK. For the packages, if unsure, you
325can just select one of the package collections. After that, you can still manually
326check the choices made by the collection and correct them if appropriate. Do not
327forget to save your configuration when leaving!
328
329After leaving the menubased configuration, type ,,\texttt{make}'' again to build
330the new FreeWRT firmware image. Depending on your package selections and
331underlying hardware, this will take different amounts of time. For your spare time
332there is the following chapter giving some explanation about what is done at this
333point.
334
335\section{Firmware Build Process In Detail}
336
337Just like when building the ADK's toolchain, the sources for the selected
338packages are downloaded from the internet first, then build using the
339cross-compiler and libraries of the ADK.
340
341The detailed order of firmware image building is:
342
343\begin{itemize}
344\item compile the Linux kernel and all supported kernel modules
345\item compile all selected packages
346\item clean the target root directory
347\item install all packages to the target root directory
348\item create the root filesystem image
349\item create the firmware image (bootloader, kernel and root filesystem)
350\end{itemize}
351
352The result of the build process is created in the ,,bin'' directory.
353You will find a firmware image in the top level directory. Check the size of
354the bin-file to see if it is small enough to fit into flash memory of
355your embedded system. Furthermore there is a ,,package'' directory, which
356contains all base and addon packages.
357
358\section{Troubleshooting}
359This section deals with various tips for problems with the ADK installation.
360
361\subsection{Errors During Prerequisites Check}
362To re-issue the checks, use ,,make prereq''.
363
364\begin{itemize}
365\item GNU make 3.80 too old
366 On a Fedora Core 4 hostsystem the first you'll get is
367\begin{verbatim}
368 $ make
369 GNU make 3.80 too old.
370 Please install GNU make 3.81 or higher to continue.
371 You can override this check, see http://www.freewrt.org/faq for details.
372 It is suggested to upgrade your copy of bison to
373 GNU Bison 2.3 because of its bug fixes.
374 make: *** [.prereq_done] Error 1
375\end{verbatim}
376
377 it is quite a nice error that tells you to use more up to date software, but we can
378 anyhow give this hostsystem a try and tell make to ignore those errors/warnings:
379\begin{verbatim}
380 make prereq-noerror
381\end{verbatim}
382\end{itemize}
383
384\subsection{Compilation errors}
385
386If you encounter any compilation errors, then first try to reproduce the error.
387First update your ADK tree via ,,svn update'', to be sure that the error is not
388already fixed in the subversion repository. After that do a ,,make clean \&\&
389make'', to reproduce your problem.
390
391If you can reproduce the problem, please file a bug report. Please always
392report following information:
393\begin{itemize}
394\item Operating system type and version
395\item GCC and Binutils versions of your host system
396\item complete error message, not only the last 4 lines
397\end{itemize}
398
399\chapter{Installing FreeWRT Firmware Images}
400
401The FreeWRT ADK produces a single image holding both kernel and root
402filesystem. This image can be written into your hardware's builtin flash memory
403on serveral ways (ordered by needed skills, increasing downwards):
404\begin{itemize} % TODO: insert \ref's to jump to the appropriate section?
405\item via the original firmware's web interface
406\item via \texttt{mtd} when reflashing or migrating from another third party distribution
407\item via network using a TFTP client
408\end{itemize}
409
410\section{Flashing The Firmware}
411
412\subsection{Web Interface Method}
413The following text describes how to use the original firmware's web interface
414to flash FreeWRT. The object of demonstration is an Asus WL500gP, but this
415guide should fit more or less fine for other systems, too.
416
417If you flash a router from Linksys, we strongly suggest to use the popular
418\textbf{ping exploit} to allow recovery, if your image is broken or the flash
419process was interrupted by a power shortage.
420
421There are some things that you should have done previously:
422\begin{itemize}
423\item read the special documentation page about your hardware in our wiki, some
424 systems need special precaution before flashing
425\item a firmware image has to be built (matching the used hardware, of course)
426\item the router has to be powered on
427\item your computer needs to be connected to one of the LAN ports (using IP
428address 192.168.1.2)
429\end{itemize}
430
431\parbox{17em}{
432After preparation is complete, open your favourite browser and type
433\texttt{192.168.1.1} into the address bar. You should reach the web interface's
434startup page:
435}\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-startup.png}} \\ [1em]
436\parbox{17em}{
437Then click \textit{System Setup}:
438}\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-system_setup.png}} \\ [1em]
439\parbox{17em}{
440Then click \textit{Firmware Upgrade}, and enter the name of your firmware image
441into the appropriate field:
442}\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-fw_upgrade.png}} \\ [1em]
443Finally click \textit{Upload}. As the whole process of writing the image to
444flash and rebooting (don't forget that it creates ssh hostkeys on first boot)
445takes quite long, better go and get a coffee or tea.
446
447When everything went good, you can login using ssh. The default username is
448\dq{}admin\dq{}. The default password for images created via WIB or ADK is
449\dq{}FreeWRT\dq{}. It is possible to change this password in the ADK, before image
450creation.
451
452\subsection{\texttt{mtd} -- The Flash Utility}
453
454For this method to work, you need to copy the file containing the firmware
455image to the router, preferably into /tmp, the memory filesystem should be
456big enough to hold the full image. If not, use wget to get the image
457via http or ftp and pipe the result into \texttt{mtd}.
458
459Then the image is written to flash using
460\texttt{mtd}, optionally giving additional options (see below).
461
462The \texttt{mtd} utility was written with simplicity and code size in mind.
463It's features were derived from the mtd-utils, %TODO: insert \ref to homepage
464combining the needed parts into a single small tool providing all the
465functionality necessary for FreeWRT, and leaving everything out that's not.
466
467\texttt{mtd} provides the following features:
468\begin{description}
469\item[unlock] some chips need unlocking before they can be written to
470\item[erase] this is a filesystem independent method to delete all contents on
471 the flash. Basically this is like \texttt{format} in MS--DOS.
472\item[write] this is generally the same functionality as using
473 \texttt{dd} or \texttt{rawrite}, but \texttt{mtd} takes care of the quirks
474 that have to be paid attention to for correctly handling the type of flash
475 in use
476\end{description}
477
478Further it can request your system to reboot. Some of the features mentioned here can
479also be combined, so it is e.g. possible to immediately reboot the system after
480the flash has been written.
481
482Mostly, similar to the sample usage shown in the help output should be all that has to be
483done to write the firmware to flash:
484\begin{Verbatim}
485# mtd -e linux -r write freewrt.bin linux &
486\end{Verbatim}
487Or via wget pipe:
488\begin{Verbatim}
489# wget -O - http://www.yourserver.com/freewrt.bin | mtd -e linux -r write - linux &
490\end{Verbatim}
491The parameters explained in detail: \\
492\begin{tabular}{l|l}
493-e linux & erase existing data in flash\\
494-r & trigger rebooting right after finishing work\\
495write & write the firmware image contained in the file given as next parameter
496 to flash\\
497freewrt.bin & the actual image to write - ignore the suffix, it is detected at
498 runtime\\
499linux & this is an abstract identifier for a certain partition in flash, so
500don't change this\\
501\& & put the process into background, to prevent accidentally stopping\\
502\end{tabular}
503
504\subsection{Installation using TFTP}
505
506All supported target devices are shipped with a builtin bootloader, comparable to
507the BIOS of x86--machines. This bootloader is used to bootstrap the system until
508it can boot a regular operating system. Besides the ability to load
509the executable code from flash, it can be received from another node in the
510local area network via the famous TFTP protocol.
511
512For doing this, there are two ways: \\
513\begin{itemize}
514\item the device acts as a client, asks the local dhcpd for a lease, the
515address of the next tftpd and the filename to download
516\item the device acts as a server, having a known IP address and waiting for
517any TFTP client to connect and send the file
518\end{itemize}
519
520Most of the hardware supported by FreeWRT 1.0 uses the second method. Only the
521device Netgear WGT634u is using the first method, the bootloader provides a
522DHCP/TFTP client. Though this may be a little confusing to people being familiar
523with netboot technologies, it is definitely the easier way of doing it. Otherwise
524one had to setup both DHCP and TFTP servers and configure them right.
525
526The even quite simple task of sending the flash image to the target device is
527made even more easy by providing a little shell script for the job. Invocation
528is as follows:
529\begin{Verbatim}
530$ ./scripts/flash.sh firmware.bin [address]
531\end{Verbatim}
532The second Parameter \textit{address} is used to specify a different IP address
533of the target device than the default \textit{192.168.1.1}.
534
535\textbf{Beware:} do not rename the firmware image before flashing it using the
536script as the original name is parsed to guess what hardware is to be flashed.
537
538To actually being able to flash the device, it has to wait for a tftp
539connection when booting. To complicate installation of third vendor's firmware
540images and to improve bootup time, of course, this feature is disabled by
541default. The following list shows what has to be done for a certain device to
542get it to wait at boot: \\
543\begin{center}\begin{tabular}{l|l|l} % TODO: fill this table
544\textbf{Target Device} & \textbf{Action to be taken} & \textbf{Comments} \\
545\hline
546All supported Linksys models & Ping Exploit & nvram variable boot\_wait needs to be on \\
547All supported Asus models & Recovery mode & power off, push and hold the
548reset button, power on, power led is flashing\\
549\end{tabular}\end{center}
550
551\chapter{FreeWRT Administration}
552
553After the FreeWRT firmware image has been built by the ADK and later flashed
554onto the hardware, the resulting operating system has to be configured. This
555section provides the necessary information to do that, including tips and
556guides for using FreeWRT in general, of course.
557
558\section{Network Configuration}
559
560The device names for real network interfaces in Linux are named ethx (x is
5610-9). If the device has a switch, the different ports are separated via VLAN
562technology. The vlan interfaces are named ethx.y. The network configuration in
563FreeWRT is managed via Busybox's ifupdown implementation. Busybox's ip builtin
564command configures the network interfaces. There is no \texttt{ifconfig} or \texttt{route}.
565To show all configured network interfaces use:
566\begin{Verbatim}
567$ ip addr show
568\end{Verbatim}
569To show the kernel routing table use:
570\begin{Verbatim}
571$ ip route show
572\end{Verbatim}
573
574All available network settings can be found in \texttt{/etc/network/interfaces}
575which has the common form:
576\begin{Verbatim}[label=/etc/network/interfaces]
577auto <iface-name>
578iface <iface-name> inet <method>
579 <option-x> <value>
580 <option-y> <value>
581 <option-z> <value>
582\end{Verbatim}
583
584\texttt{auto <iface-name>} is optional and, if set, tells the "ifup" script to
585start this interface automatically on bootup.
586
587Each interface needs a unique name which, depending on the method, represents
588either a physical interface or a logical interface name like "eth0.1" for a
589physical VLAN or "umts" as a logical name for a PPP interface.
590
591Possible methods are:
592\begin{description}
593\item[static] use the given options to configure the interface statically
594\item[dhcp] just start a dhcp client using the interface \texttt{iface-name}
595\item[manual] don't configure the interface but start pre-up.d hook scripts
596\item[ppp] run \texttt{pon <provider>} where \texttt{<provider>} is given as an interface option
597\end{description}
598
599\subsection{Switch/VLAN}
600The switch built-in into the most routers is capable of separating each port
601using VLAN tagging. You can configure the switch by simply adding the interface
602to the config file and giving the desired switch-ports:
603\begin{Verbatim}[label=/etc/network/interfaces]
604auto eth0.0
605iface eth0.0 inet static
606 switch-ports 1 2 5*
607 address 192.168.1.1
608 netmask 255.255.255.0
609
610auto eth0.1
611iface eth0.1 inet static
612 switch-ports 3 4 5
613 address 192.168.2.1
614 netmask 255.255.255.0
615
616auto eth0.2
617iface eth0.2 inet static
618 switch-ports 0 5
619 address 172.16.1.42
620 netmask 255.255.255.0
621 gateway 172.16.1.1
622\end{Verbatim}
623
624This configures three VLAN interfaces \texttt{eth0.0} on ports 1 and 2,
625\texttt{eth0.1} on port 3 and 4 and \texttt{eth0.2} on port 0.
626
627
628If you need to do some advanced settings, because you have for example
629a powerful switch with a VLAN trunking port connected to one of your switch
630ports, the configuration would look like this:
631
632\begin{Verbatim}[label=/etc/network/interfaces]
633auto eth0.1
634iface eth0.1 inet static
635 switch-ports 2 3 4 5*
636 address 192.168.1.1
637 netmask 255.255.255.0
638
639auto eth0.2
640iface eth0.2 inet static
641 switch-ports 1t 5
642 address 10.2.0.1
643 netmask 255.255.255.0
644 broadcast +
645
646auto eth0.3
647iface eth0.3 inet static
648 switch-ports 1t 5
649 address 10.3.0.1
650 netmask 255.255.255.0
651 broadcast +
652
653auto eth0.4
654iface eth0.4 inet static
655 switch-ports 1t 5
656 address 10.4.0.1
657 netmask 255.255.255.0
658 broadcast +
659
660\end{Verbatim}
661
662This configures four VLAN interfaces, \texttt{eth0.1} on physical ports 2, 3 and 4.
663The interfaces \texttt{eth0.2}, \texttt{eth0.3} and \texttt{eth0.4} are three
664different networks with VLAN ID 2-4. The physical port 1 needs to be connected
665to a VLAN trunking port on a switch with knows the same VLAN IDs.
666
667
668Explanation:
669\begin{description}
670\item[port 0] this is typically the port labeled as WAN
671\item[port 1-4] these are typically the ports labeled as LAN
672\item[port 5] this special port represents the port where the router-board is
673 connected to the switch
674\item[*] one interface always need an asterisk behind port 5 which means it is
675 the default interface and gets all the packages with unknown tags.
676\end{description}
677
678\subsection{Static IP configuration}
679As you can see in the VLAN example three interfaces were configured with static
680IP settings, so these are the commonly used options:
681\begin{description}
682\item[address] the IP address - required
683\item[netmask] the netmask - required
684\item[broadcast] broadcast address - only required for legacy applications (if using +, it will calculated automatically by the kernel)
685\item[gateway] an IP address added as default gateway if present
686\item[mac-address] if you need to change your MAC address (required for some DSL providers)
687\end{description}
688
689\subsection{DHCP}
690That's just as simple as:
691\begin{Verbatim}[label=/etc/network/interfaces]
692auto eth0.1
693iface eth0.1 inet dhcp
694 switch-ports 0 5
695\end{Verbatim}
696Typically this configures the WAN-Port to start a DHCP request on bootup.
697
698\subsection{Bridging}
699
700This is mostly needed to combine LAN and WLAN to a homogeneous network.
701Be sure you have installed the package \texttt{bridge-utils}.
702
703\begin{Verbatim}[label=/etc/network/interfaces]
704auto eth0.0
705iface eth0.0 inet manual
706 switch-ports 1 2 3 4 5*
707
708auto eth1
709iface eth1 inet manual
710 wireless-bridge-if br0
711 [... other wifi-settings, see below ...]
712
713auto br0
714iface br0 inet static
715 bridge-ifaces eth0.0 eth1
716 address 192.168.1.1
717 netmask 255.255.255.0
718 broadcast +
719\end{Verbatim}
720
721This creates a new bridging interface \texttt{br0} which combines the VLAN
722interface \texttt{eth0.0} (representing the LAN-ports 1-4) and the WLAN interface
723\texttt{eth1} (on some devices like Asus WL500gP this might be \texttt{eth2}).
724The bridge interface needs always be the last one, otherwise it can not find
725the interfaces in bridge-ifaces.
726
727\subsection{WLAN}
728A router containing a WLAN interface has an additional ethernet device
729representing it. On Broadcom-based hardware it is typically \texttt{eth1}
730(Linksys),\texttt{eth2} (Asus WL500gP) or on Netgear WGT634u which has a Madwifi
731WLAN chip, it is \texttt{ath0}, \texttt{ath1}, etc. You can use these interfaces
732standalone or bridged with other devices, e.g. the internal LAN.
733
734\subsubsection{Basic Settings}
735
736Mandatory options and default parameters are in bold font.
737
738\begin{tabular}{l|l|l}
739\textbf{Option} & \textbf{Parameter} & \textbf{Description} \\
740\hline
741\textbf{type}& broadcom & Broadcom based card \\
742 & atheros & Madwifi driver \\
743\textbf{mode}& ap & Access point mode \\
744 & sta & Client mode \\
745 & adhoc & Ad-Hoc mode \\
746 & wds & WDS point-to-point link over wireless\\
747 & monitor & The node acts as a passive monitor and only receives packets \\
748\textbf{ssid}& <String> & Set the SSID (Network Name) \\
749country & {ALL|DE|JP|US|...} & The country code used to determine the regulatory settings. \\
750\end{tabular}
751
752\subsubsection{Security Settings}
753\begin{tabular}{l|l|l}
754\textbf{Option} & \textbf{Parameter} & \textbf{Description} \\
755\hline
756\textbf{security}& none & No authorization \\
757 & wep & WEP key \\
758 & wpa-psk & WPA with preshared key \\
759 & 8021x & IEEE 802.1X authentication \\
760\textbf{authorization}& & \textbf{wep} \\
761 & open & Only Open System Authentication \\
762 & shared & Only Shared Key Authentication \\
763 & \textbf{open+shared}& Both Open System and Shared Key Authentication
764 \\
765 & & \textbf{wpa-psk} \\
766 & psk & WPA PSK \\
767 & psk2 & WPA2 PSK \\
768 & psk psk2 & WPA PSK and WPA2 PSK \\
769 & & \textbf{8021x} \\
770 & open & Only Open System Authentication \\
771 & shared & Only Shared Key Authentication \\
772 & wpa & WPA with RADIUS \\
773 & wpa2 & WPA2 with RADIUS \\
774 & wpa wpa2 & WPA and WPA2 \\
775\textbf{encryption}& & \textbf{wep} \\
776 & - & not needed, automatically by key size \\
777 & & \textbf{wpa-psk} \\
778 & tkip & RC4 encryption \\
779 & aes & AES encryption \\
780 & aes+tkip & support both \\
781 & & \textbf{8021x} \\
782 & wep & RC4 encryption (static) \\
783 & tkip & RC4 encryption \\
784 & aes & AES encryption \\
785 & aes+tkip & support both \\
786eap-type & & \textbf{8021x} \\
787 & \textbf{tls} & Transport Layer Security \\
788 & ttls & Tunnelled TLS \\
789 & peap & Protected EAP \\
790 & leap & Cisco Wireless \\
791key & & \textbf{wep} \\
792 &\{\textbf{1}|2|3|4\}& Select WEP key to use. \\
793key[1..4] & & \textbf{wep} \\
794 & <String> & WEP key. The key must be 5, 13 or 16 bytes
795 long, or 10, 26, 32, or 64 hex digits long. The encryption
796 algorithm is automatically selected based on the key size. key1 is
797 the key for WEP client mode. \\
798wpa-key & & \textbf{wpa-psk} \\
799 & <String> & Password to use with WPA/WPA2 PSK (at least 8,
800 up to 63 chars) \\
801wpa-gtk-rekey & & \textbf{wpa-psk}, \textbf{8021x} \\
802 & <Int> (\textbf{3600}) & Rekeying interval in seconds. \\
803\textbf{radius-ipaddr}& & \textbf{8021x} \\
804 & <a.b.c.d> & IP to connect. \\
805radius-port & & \textbf{8021x} \\
806 & <Int> (\textbf{1812}) & RADIUS-Port no. to connect \\
807\textbf{radius-key}& & \textbf{8021x} \\
808 & <String> & Shared Secret for connection to the Radius server \\
809\end{tabular}
810
811\subsubsection{MAC filter}
812\begin{tabular}{l|l|l}
813\textbf{Option} & \textbf{Parameter} & \textbf{Description} \\
814macmode & {0|1|2} & 0 - Disable MAC address matching. \\
815 & & 1 - Deny association to stations on the MAC list. \\
816 & & 2 - Allow association to stations on the MAC list. \\
817maclist & <MAC1> ... <MACn> & List of space separated mac addresses to
818allow/deny according to ''macmode''. Addresses should be entered with colons,
819e.g.: \"00:02:2D:08:E2:1D 00:03:3E:05:E1:1B\"\\
820\end{tabular}
821
822\subsubsection{Wireless Distribution System (WDS) / Repeater / Bridge}
823\begin{tabular}{l|l|l}
824\texttt{Option} & \texttt{Parameter} & \texttt{Description} \\
825lazywds & {0|1} & Accept WDS connections from anyone \\
826wds-bridge & {brX} & Add WDS peers to bridge brX \\
827wds & <MAC1> ... <MACn> & List of WDS peer mac addresses (xx:xx:xx:xx:xx:xx, space separated) \\
828\end{tabular}
829
830\subsubsection{Miscellaneous}
831\begin{tabular}{l|l|l}
832\textbf{Option} & \textbf{Parameter} & \textbf{Description} \\
833channel & \{1-14\} & The wifi channel \\
834maxassoc & \{1-255\} & Maximum number of associated clients \\
835gmode & \{LegacyB| \textbf{Auto}| GOnly| BDeferred| Performance| LRS\} & Set the 54g Mode \\
836frameburst & \{\textbf{0}|1\} & Disable/Enable frameburst mode. \\
837txpower & \{0-255|\textbf{-1}\} & Set the transmit power in dBm \\
838rate & <Int> (\textbf{-1}) & force a fixed rate \\
839 & & valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54) \\
840 & & valid values for 802.11b are (1, 2, 5.5, 11) \\
841 & & valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54) \\
842 & &-1 means automatically determine the best rate \\
843rts & \{0-2347\} & Set the RTS threshhold. \\
844frag & \{256-2346\} & Set the fragmentation threshhold. \\
845afterburner & \{\textbf{0}|1\} & Enable Afterburner capability \\
846isolate & \{\textbf{0}|1\} & Hide Clients from each other \\
847bridge-if & \{br0...brX\} & The bridge interface (optional)
848\end{tabular}
849
850\subsubsection{Examples}
851WLAN with WEP128
852\begin{Verbatim}
853iface eth1 inet static
854 address 192.168.10.1
855 netmask 255.255.255.0
856 broadcast +
857 wireless-type broadcom
858 wireless-country DE
859 wireless-mode ap
860 wireless-ssid FreeWRT
861 wireless-security wep
862 wireless-key1 11223344556677889900112233
863 wireless-channel 11
864\end{Verbatim}
865
866WLAN without encryption
867\begin{Verbatim}
868iface eth1 inet static
869 address 192.168.10.1
870 netmask 255.255.255.0
871 broadcast +
872 wireless-type broadcom
873 wireless-country DE
874 wireless-mode ap
875 wireless-ssid FreeWRT
876 wireless-security none
877 wireless-channel 11
878\end{Verbatim}
879
880WLAN with WPA2 (AES)
881\begin{Verbatim}
882iface eth1 inet static
883 address 192.168.10.1
884 netmask 255.255.255.0
885 broadcast +
886 wireless-type broadcom
887 wireless-country DE
888 wireless-mode ap
889 wireless-ssid FreeWRT
890 wireless-security wpa-psk
891 wireless-authorization psk2
892 wireless-encryption aes
893 wireless-wpa-key 12345678
894 wireless-channel 11
895\end{Verbatim}
896
897If you want to do MAC filtering, add the following to the sample above:
898\begin{Verbatim}
899 wireless-macmode 2
900 wireless-mac 00:01:02:03:04:05 06:07:08:09:0a:0b
901\end{Verbatim}
902this enables the filter and defines the list to contain addresses that should be allowed.
903
904To enhance wireless performance, you can enable some flags like Broadcom's SpeedBooster. Normally, these flags are not dangerous:
905\begin{Verbatim}
906 wireless-gmode performance
907 wireless-frameburst 1
908 wireless-afterburner 1
909\end{Verbatim}
910
911WLAN client with WPA2 (AES) (''untested'')
912\begin{Verbatim}
913iface eth1 inet static
914 address 192.168.10.1
915 netmask 255.255.255.0
916 broadcast +
917 wireless-type broadcom
918 wireless-country DE
919 wireless-mode sta
920 wireless-ssid FreeWRT
921 wireless-security wpa-psk
922 wireless-authorization psk2
923 wireless-encryption aes
924 wireless-wpa-key 12345678
925\end{Verbatim}
926
927WLAN client with WEP128
928\begin{Verbatim}
929iface eth1 inet dhcp
930 wireless-type broadcom
931 wireless-country DE
932 wireless-mode sta
933 wireless-ssid FreeWRT
934 wireless-security wep
935 wireless-key1 11223344556677889900112233
936\end{Verbatim}
937
938WLAN with WDS nodes, the WDS nodes need to have the same
939SSID, channel and encryption parameters.
940
941WDS node 1 (MAC of Wireless 06:05:04:03:02:01)
942\begin{Verbatim}
943iface br0 inet static
944 bridge-ifaces eth1
945 address 192.168.10.1
946 netmask 255.255.255.0
947 broadcast +
948 wireless-type broadcom
949 wireless-country DE
950 wireless-mode wds
951 wireless-ssid FreeWRT-WDS
952 wireless-security none
953 wireless-lazywds 0
954 wireless-wds 01:02:03:04:05:06
955 wireless-wds-bridge br0
956\end{Verbatim}
957WDS node 2 (MAC of Wireless 01:02:03:04:05:06)
958\begin{Verbatim}
959iface br0 inet static
960 bridge-ifaces eth1
961 address 192.168.10.2
962 netmask 255.255.255.0
963 broadcast +
964 wireless-type broadcom
965 wireless-country DE
966 wireless-mode wds
967 wireless-ssid FreeWRT-WDS
968 wireless-security none
969 wireless-lazywds 0
970 wireless-wds 06:05:04:03:02:01
971 wireless-wds-bridge br0
972\end{Verbatim}
973
974Peer-to-Peer mode (no encryption, IP must be static)
975\begin{Verbatim}
976iface eth1 inet static
977 address 192.168.10.1
978 netmask 255.255.255.0
979 broadcast +
980 wireless-type broadcom
981 wireless-country DE
982 wireless-mode adhoc
983 wireless-ssid FreeWRT
984 wireless-security none
985 wireless-channel 11
986\end{Verbatim}
987
988\subsection{PPP}
989
990PPP comes in various flavours for different situations, the most commonly
991needed will likely be DSL and for WRT54G3G users UMTS. So there exists a
992hook-script that evaluates a "use-template" option and generates a ppp-peer.
993This way everything needed so far can be configured within the
994\texttt{interfaces} file. Be sure you have installed the packages
995\texttt{kmod-ppp}, \texttt{ppp} and \texttt{ppp-mod-pppoe}.
996
997\subsubsection{DSL}
998\begin{Verbatim}
999auto ppp0
1000iface ppp0 inet ppp
1001 use-template dsl
1002 provider t-online
1003 ppp-username 0001201234563200123456#0001@t-online.de
1004 ppp-password fooBARfoo
1005 ppp-device eth0.1
1006\end{Verbatim}
1007
1008Now your t-online DSL connection will be started on boot (\texttt{auto ppp0})
1009and you can manually shut it down with \texttt{ifdown ppp0} or start it up with
1010\texttt{ifup ppp0}.
1011The template \texttt{dsl} will configure a typical PPPoE peer for you.
1012
1013\subsubsection{UMTS}
1014Same footprint different template and some specific options. That is all that
1015is needed for an UMTS connection to Vodafone as it can be seen in this example.
1016\begin{Verbatim}
1017iface ppp0 inet ppp
1018 use-template umts
1019 provider umts
1020 #ppp-username ""
1021 #ppp-password ""
1022 ppp-device /dev/noz0
1023 umts-apn web.vodafone.de
1024 umts-pincode 1234
1025 umts-mode umts_first
1026\end{Verbatim}
1027As you can see: unneeded options like \texttt{ppp-username} or
1028\texttt{ppp-password} can just be removed or commented out. Don't leave them
1029without a value as that causes a failure in \texttt{ipup}. It does work if you
1030give empty double quotes as value like "".
1031
1032Note that you have to set the correct APN, username and password for your provider!
1033
1034You may also remove the pin from your SIM-card and the configuration if you like.
1035
1036For Linksys WRT54G3G a package called \texttt{broadcom-watchbutton} will be
1037installed, this is a small daemon that monitors the UMTS-button of the router
1038and executes \texttt{ifup umts} or \texttt{ifdown umts} on a button press.
1039You have to set \texttt{watchbutton=YES} in /etc/rc.conf to have it start automatically.
1040
1041This is totally independent from the \texttt{auto umts} setting. Even if you
1042start the connection on bootup you can shut it down again with a button press.
1043
1044\subsection{custom interface hooks}
1045\subsubsection{per interface}
1046You can execute various commands on interface startup or shutdown with special option:
1047\begin{Verbatim}
1048iface foobar inet static
1049 [...]
1050 pre-up <command>
1051 up <command>
1052 up <command>
1053 down <command>
1054 post-down <command>
1055\end{Verbatim}
1056
1057You can give each option multiple times and their commands will be executed in given order.
1058\begin{description}
1059\item[pre-up] before the interface will be started
1060\item[up] after the interface was started successfully
1061\item[down] before the interface goes down
1062\item[post-down] after the interface shut down
1063\end{description}
1064
1065\subsubsection{general hooks}
1066Additionally you can write scripts executed for each interface if you put them in
1067\begin{itemize}
1068\item \texttt{/etc/network/if-pre-up.d}
1069\item \texttt{/etc/network/if-up.d}
1070\item \texttt{/etc/network/if-down.d}
1071\item \texttt{/etc/network/if-post-down.d}
1072\end{itemize}
1073Same semantics as above.
1074
1075\section{FWCF - FreeWRT Configuration Filesystem}
1076
1077FWCF is a separate flash partition for all changes made to the /etc directory.
1078There is a small tool named \texttt{fwcf}, which is used to setup the system or
1079to commit changes to the fwcf partition.
1080
1081On bootup the script \texttt{/sbin/mount\_root} is executed, which calls \dq{}fwcf
1082setup\dq{} to setup /etc as memory filesystem and overlay the changes committed
1083to the fwcf partition.
1084
1085If you change anything in /etc and like to keep the change, it is required to
1086execute \dq{}fwcf commit\dq{}. This will compress all changed or new files in /etc
1087and write the result into the fwcf partition. The fwcf partition is 128 Kb in
1088size. This size is not changeable at the moment.
1089
1090If you need more detailed information, please read the specification of FWCF,
1091which can be found
1092here \url{http://www.freewrt.org/trac/wiki/Documentation/Specs/FwCf}
1093
1094If you want to remove all your changes and start your configuration from scratch,
1095use \dq{}fwcf erase\dq{}. This is also required if you switch between compression
1096plugins. Right now LZO plugin is default.
1097
1098\section{IPKG - Packagemanagement}
1099
1100All software for FreeWRT is available as a IPKG package. IPKG is a package manager
1101very similar to Debian's dpkg/apt-get utilities. It is specially designed for
1102embedded systems and is widely used. The FreeWRT project use a special version,
1103which is embedded to the busybox binary. Normally the command line tool
1104\texttt{ipkg} is pre-installed.
1105
1106IPKG uses a configuration file similar to /etc/apt/sources.list, which
1107contains a list of software repositories available via HTTP or FTP.
1108The configuration file \texttt{/etc/ipkg.conf} contains the official
1109FreeWRT 1.0 repository for your board and kernel version.
1110
1111To update the list of available packages execute following command as root:
1112\begin{verbatim}
1113# ipkg update
1114\end{verbatim}
1115
1116This command requires a working internet connection, because it will fetch a
1117package list from every repository declared in /etc/ipkg.conf.
1118
1119To install a new package use following command:
1120\begin{verbatim}
1121# ipkg install tcpdump
1122\end{verbatim}
1123
1124This will install the package tcpdump and all dependencies onto the flash.
1125Where the data is saved depends on the root filesystem you decided to use while
1126installing FreeWRT. If you use jffs2 as root filesystem, then the package is
1127installed on the big linux partition. If you use squashfs-overlay, then the
1128package is installed on the mini-fo overlay filesystem which writes its data
1129to the jffs2 data partition. If you use a squashfs-symlinks filesystem, then the
1130package data is directly install into the jffs2 data partition, containing
1131symlinks to the read-only squashfs partition.
1132
1133You can also remove packages, but this is only useful if you are using JFFS2
1134as root filesystem:
1135\begin{verbatim}
1136# ipkg remove tcpdump
1137\end{verbatim}
1138
1139This will not remove any dependencies, installed earlier. For example, libpcap
1140is still installed after executing this command.
1141On jffs2 root filesystem you should never remove any essential packages like
1142busybox, fwcf or uclibc, otherwise you make the embedded system unusable.
1143
1144Nearly the same as for removing packages, counts for ipkg upgrade. Please
1145\textbf{never ever} use ipkg upgrade to update your embedded system. This command
1146is only useful to upgrade single packages on a jffs2 rootfilesystem or data
1147partition.
1148
1149\section{Startup scripts}
1150
1151Some of the available packages containing software which start services at boot
1152time. For that we provide simple startup scripts, which are installed into the
1153directory \texttt{/etc/init.d}. See following example for
1154the package \texttt{dnsmasq}, a combined dns and dhcp
1155server daemon:
1156
1157\begin{verbatim}
1158#!/bin/sh
1159
1160. /etc/rc.conf
1161
1162case $1 in
1163autostart)
1164 test x"${dns_dhcp:-NO}" = x"NO" && exit 0
1165 exec $0 start
1166 ;;
1167start)
1168 [ -f /etc/dnsmasq.conf ] || exit
1169 /usr/sbin/dnsmasq
1170 ;;
1171stop)
1172 killall dnsmasq
1173 ;;
1174restart)
1175 $0 stop
1176 $0 start
1177 ;;
1178*)
1179 echo "Usage: $0 {start | stop | restart}"
1180 ;;
1181esac
1182exit 0
1183\end{verbatim}
1184
1185After installation the package postinst script will add all needed changes to the
1186/etc directory. For example packages can add new user and groups, add new
1187variables to /etc/rc.conf or just add new values to existing files as
1188/etc/services. It is FreeWRT policy to do not start any services after
1189installation or in case of a new boot. To start services on bootup you need to set
1190\$servicename=YES in /etc/rc.conf and commit your changes via \dq{}fwcf
1191commit\dq{}. For every policy exist a exception, we start all essential services
1192by default, like ssh daemon, syslog and network initialisation.
1193
1194For some services you can control the startup behavior by modifying
1195the services\_flags variable in /etc/rc.conf.
1196
1197For example the variable \$ssh\_opts is provided as argument to the dropbear
1198ssh daemon to control its behavior.
1199
1200Having this policy helps you to configure your FreeWRT embedded system without
1201shooting yourself in the foot. For example if you try to realize a firewall system
1202and trying to set the rules in /etc/firewall.user, which is read by
1203/etc/init.d/S45firewall, if the iptables package is installed. You can just
1204reload the changed ruleset via /etc/init.d/S45firewall restart. If you managed
1205to kick you out of the system, you can just reboot the system and you gain access
1206again. As soon as your are ready with the firewall configuration and you decide
1207to activate the firewall rules on bootup, you set \$firewall=YES in /etc/rc.conf,
1208commit your changes via \dq{}fwcf commit\dq{} and reboot. Now the firewall
1209rules will be activated on bootup.
1210
1211
1212\chapter{Troubleshooting}
1213
1214\section{Failsafe Mode}
1215
1216Failsafe mode is very useful if you misconfigured your embedded system,
1217so that you can not access it anymore. E.g. if you accidentially disabled
1218secure shell or misconfigured the firewall, so that you can not login any
1219more.
1220
1221When in failsafe mode, the device won't interpret any networking setup files.
1222It stops even before the root filesystem gets mounted read--write, and fwcf is
1223set up. It will just set the LAN interface up and give it the IP address
1224192.168.1.1 and netmask 255.255.255.0. Then it will start a telnet daemon, so
1225you get straight access (without depending on the installed SSH--daemon).
1226
1227\subsection{How It Works}
1228
1229To get FreeWRT into failsafe mode you need physical access to the device and
1230the failsafe utility. The failsafe utility is built inside our ADK and
1231is available in the directory bin/ after a successful build.
1232
1233If you just want to compile the tool and not a complete firmware image,
1234use following command:
1235
1236\begin{Verbatim}
1237$ make subdir=tools/failsafe install
1238\end{Verbatim}
1239
1240For some operating systems we provide ready to go binaries of failsafe.
1241Take a look at http://www.freewrt.org/downloads/tools/failsafe
1242
1243The tool just opens a network socket and waits for a special UDP packet
1244from the embedded device. FreeWRT sends the UDP packet via the first
1245recognized network interface (eth0).
1246
1247\subsection{Enabling Failsafe Mode}
1248
1249Connect your computer to the embedded system via direct or crossed network
1250cable. Use the failsafe port (in most cases one of the LAN ports),
1251see the device specific page for the exact network port.
1252
1253Configure your network interface to the IP address 192.168.1.2 with network
1254mask 255.255.255.0. Now start the failsafe utility on your computer.
1255
1256\begin{Verbatim}
1257$ ./failsafe
1258\end{Verbatim}
1259
1260After that power on your embedded system and wait for the following message in
1261your failsafe application running on your computer:
1262
1263\begin{Verbatim}
1264Press reset now to enter Failsafe!
1265\end{Verbatim}
1266
1267As soon as this message is displayed you should push the reset button of
1268your embedded system. You have 2 seconds time to push the button. If you
1269successfully enabled the failsafe mode, following message will be displayed:
1270
1271\begin{Verbatim}
1272Entering Failsafe!
1273\end{Verbatim}
1274
1275Now you should be able to login to your embedded system via a telnet
1276application. Just use:
1277
1278\begin{Verbatim}
1279$ telnet 192.168.1.1
1280\end{Verbatim}
1281
1282\subsection{Repairing Your FreeWRT Configuration}
1283
1284If you want to repair your configuration, you first need to
1285mount the root filesystem read--writeable. This is best done via:
1286
1287\begin{Verbatim}
1288# mount_root
1289\end{Verbatim}
1290
1291After that you need to enable the FreeWRT configuration filesystem:
1292
1293\begin{Verbatim}
1294# fwcf setup
1295\end{Verbatim}
1296
1297Now you can change files in /etc and repair your broken configuration.
1298Do not forget to commit your changes afterwards.
1299
1300\begin{Verbatim}
1301# fwcf commit
1302\end{Verbatim}
1303
1304If you want to start over with the default /etc directory, just remove the fwcf
1305partition content with following command:
1306
1307\begin{Verbatim}
1308mtd erase fwcf
1309\end{Verbatim}
1310
1311You can either use "reboot -f" or "-r" for mtd to reboot the system.
1312
1313%\section{Serial Console}
1314
1315%\section{JTAG}
1316
1317% Erstmal auskommentieren. Sind ja paar Seiten die erstmal keiner braucht
1318%\begin{appendix}
1319%\include{A-blaetter}
1320%\end{appendix}
1321
1322%\cleardoublepage
1323%\addcontentsline{toc}{chapter}{\glossaryname}
1324\end{document}
Note: See TracBrowser for help on using the repository browser.