Changeset dac4ea5 in freewrt


Ignore:
Timestamp:
May 17, 2007, 11:12:17 PM (19 years ago)
Author:
Phil Sutter <n0-1@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
7fc69e5f
Parents:
8ca8ce4
Message:

full long line cleanup. note that this should not have changed anything at the produced pdf

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • docs/handbook/user/handbook.tex

    r8ca8ce4 rdac4ea5  
    110110and functional Linux distribution for embedded systems. As FreeWRT is a source
    111111code distribution, it does not provide any pre-compiled firmware for embedded
    112 systems. The latest version of this document is always available at the
    113 FreeWRT website. If you have any comments, criticism or found some wrong
    114 description, please send us an e-mail to
    115 \href{mailto:freewrt-handbook@freewrt.org}{freewrt-handbook@freewrt.org}, we are
    116 always happy about getting feedback to this document, and will try to update
    117 or correct the issues mentioned by you.
     112systems. The latest version of this document is always available at the FreeWRT
     113website. If you have any comments, criticism or found some wrong description,
     114please send us an e-mail to
     115\href{mailto:freewrt-handbook@freewrt.org}{freewrt-handbook@freewrt.org}, we
     116are always happy about getting feedback to this document, and will try to
     117update or correct the issues mentioned by you.
    118118
    119119The FreeWRT User handbook is split into several distinct chapters.
    120 \nameref{ch:ADK} covers the building of FreeWRT firmware images.
    121 In \autoref{ch:installing}, \nameref{ch:installing}, all aspects regarding the
     120\nameref{ch:ADK} covers the building of FreeWRT firmware images.  In
     121\autoref{ch:installing}, \nameref{ch:installing}, all aspects regarding the
    122122installation and deinstallation of FreeWRT firmware images are covered.  The
    123123next chapter, \nameref{ch:administration}, covers administrational tasks, such
    124124as network configuration, the FreeWRT configuration filesystem, package
    125 management and update mechanism. The last chapter, \nameref{ch:troubleshooting},
    126 helps troubleshooting problems and recovering a bad firmware installation.  The
    127 appendix contains board specific information.  For FreeWRT 1.0 these are only
    128 Broadcom based embedded systems.
    129 
    130 The intended audience for this handbook are advanced users with basic
    131 knowledge about Linux, networking and software development. The reader should
    132 be aware of basic command line tools, the vi editor and a shell. FreeWRT does
    133 not contain any high level administration tools (e.g. web based
    134 administration) and is fully configured via command line.
     125management and update mechanism. The last chapter,
     126\nameref{ch:troubleshooting}, helps troubleshooting problems and recovering a
     127bad firmware installation.  The appendix contains board specific information.
     128For FreeWRT 1.0 these are only Broadcom based embedded systems.
     129
     130The intended audience for this handbook are advanced users with basic knowledge
     131about Linux, networking and software development. The reader should be aware of
     132basic command line tools, the vi editor and a shell. FreeWRT does not contain
     133any high level administration tools (e.g. web based administration) and is
     134fully configured via command line.
    135135
    136136\section{Typographic Conventions}
    137137
    138 Examples starting with \code{\#} indicate a command that must be invoked as super
    139 user. You can use \command{su} to gain super user privileges.
     138Examples starting with \code{\#} indicate a command that must be invoked as
     139super user. You can use \command{su} to gain super user privileges.
    140140
    141141\begin{Verbatim}[label=example for a command line with super user privileges]
     
    179179\end{itemize}
    180180
    181 In this release we only support the Linux 2.4 kernel. The ADK contains over
    182 600 software packages.
     181In this release we only support the Linux 2.4 kernel. The ADK contains over 600
     182software packages.
    183183
    184184\section{Prerequisites}
     
    187187needed to create a firmware for your embedded system.
    188188
    189 The list of supported GNU/Linux build systems is not an exclusive one, these are just the ones tested and verified. The other millions of linux distributions are very likely to work, too.
     189The list of supported GNU/Linux build systems is not an exclusive one, these
     190are just the ones tested and verified. The other millions of linux
     191distributions are very likely to work, too.
    190192
    191193\begin{itemize}
     
    195197        \item Ubuntu GNU/Linux
    196198        \item Fedora Core
    197         \item OpenBSD (partial support)\footnote{some addon packages does not compile}
    198         \item MirOS BSD (partial support)\footnote{some addon packages does not compile}
     199        \item OpenBSD (partial support)
     200                \footnote{some addon packages does not compile}
     201        \item MirOS BSD (partial support)
     202                \footnote{some addon packages does not compile}
    199203\end{itemize}
    200204
    201205Please install the following software, which is needed to build a basic
    202206firmware image. If you choose more packages some more prerequisites might be
    203 needed. The ADK host checks will warn you about any software you need to install to
    204 compile a specific package.  Here is a list of the required software:
     207needed. The ADK host checks will warn you about any software you need to
     208install to compile a specific package.  Here is a list of the required
     209software:
    205210
    206211\begin{itemize}
     
    223228The ADK scripts will check for the required versions of these tools in advance.
    224229
    225 To build FreeWRT with the ADK it is recommended to have an unprivileged
    226 user. Please \underline{never} build FreeWRT as super user. Because all necessary source
    227 tarballs are downloaded from the internet automatically, your host system
    228 needs a working internet connection.
     230To build FreeWRT with the ADK it is recommended to have an unprivileged user.
     231Please \underline{never} build FreeWRT as super user. Because all necessary
     232source tarballs are downloaded from the internet automatically, your host
     233system needs a working internet connection.
    229234
    230235\section{Getting the source}
     
    232237Now go to a directory where you want to build the firmware. Depending on the
    233238features you select you will need about 2.5--5 GB free disk space. This
    234 includes the ADK itself, any source archives which will be downloaded
    235 and their extracted copies (for compiling).
     239includes the ADK itself, any source archives which will be downloaded and their
     240extracted copies (for compiling).
    236241
    237242To get the latest stable FreeWRT ADK try one of these commands:
     
    243248\end{Verbatim}
    244249
    245 The value $x$ is a place holder for the latest minor release number.
    246 Take a look at our project page to find out which minor release number is the latest one.
     250The value $x$ is a place holder for the latest minor release number.  Take a
     251look at our project page to find out which minor release number is the latest
     252one.
    247253
    248254After successfully downloading, enter the directory:
     
    256262\section{Some Theory First}
    257263
    258 Building a FreeWRT firmware image is just like building a new Linux kernel,
    259 but a little more complex. There is a \app{ncurses}-based configuration menu at the
    260 beginning, the changes made are saved into a file named \file{.config} in the ADK
    261 root. The build is done by the various Makefiles, compiling and linking the
     264Building a FreeWRT firmware image is just like building a new Linux kernel, but
     265a little more complex. There is a \app{ncurses}-based configuration menu at the
     266beginning, the changes made are saved into a file named \file{.config} in the
     267ADK root. The build is done by the various Makefiles, compiling and linking the
    262268sources together accordingly to the symbols defined in \file{.config}.
    263269
    264 Unlike kernel compilation, FreeWRT needs to be cross-compiled. This
    265 leads to special premises, as most of the tools need to be specially build.
    266 But no panic, FreeWRT will do this all for you. In fact, this is done at the
    267 second run of \command{make} (the first one opens the configuration), and
    268 therefore can be seen as part of the first firmware build.  For clarity
    269 though, we will discuss these two things separately.
     270Unlike kernel compilation, FreeWRT needs to be cross-compiled. This leads to
     271special premises, as most of the tools need to be specially build.  But no
     272panic, FreeWRT will do this all for you. In fact, this is done at the second
     273run of \command{make} (the first one opens the configuration), and therefore
     274can be seen as part of the first firmware build.  For clarity though, we will
     275discuss these two things separately.
    270276
    271277\section{Preparing the Build Process}
     
    277283
    278284The first step is to run \command{make}. After checking some prerequisites (see
    279 \nameref{ch:troubleshooting} below for aid in problems), a console based configuration
    280 menu should start. Theoretically no choices have to be made, but it's proven
    281 useful to at least:
     285\nameref{ch:troubleshooting} below for aid in problems), a console based
     286configuration menu should start. Theoretically no choices have to be made, but
     287it's proven useful to at least:
    282288\begin{itemize}
    283289        \item select a target (menu: \code{Embedded System})
     
    285291\end{itemize}
    286292
    287 Then quit saving changes. If you forgot that, just run \command{make} again, redo
    288 your changes, then save.
     293Then quit saving changes. If you forgot that, just run \command{make} again,
     294redo your changes, then save.
    289295
    290296\subsection{Building ADK}
    291297
    292 Now that you have a first minimal configuration, it is time to build the toolchain
    293 for cross-compiling. To do this, just enter \command{make} again. The build starts
    294 downloading and compiling each needed part of the toolchain, and later continues
    295 with building the first firmware image. Later one can be taken as proof of a
    296 working ADK.
    297 
    298 Already experienced in compiling \app{gcc}? Then you know\dots If not, better be told
    299 that it takes \underline{really long} to finish. In the meantime I suggest reading the
    300 next chapter dealing with internals about cross-compiling.
     298Now that you have a first minimal configuration, it is time to build the
     299toolchain for cross-compiling. To do this, just enter \command{make} again. The
     300build starts downloading and compiling each needed part of the toolchain, and
     301later continues with building the first firmware image. Later one can be taken
     302as proof of a working ADK.
     303
     304Already experienced in compiling \app{gcc}? Then you know\dots If not, better
     305be told that it takes \underline{really long} to finish. In the meantime I
     306suggest reading the next chapter dealing with internals about cross-compiling.
    301307
    302308\section{Details Of Cross-Compiling}
    303309
    304 A cross-compile toolchain exists of a set of tools: a compiler, linker, assembler,
    305 debugger and a C~library. A cross-compile toolchain runs on your host system and
    306 creates native binaries for your target system. A cross-compile toolchain is
    307 basically created in six steps:
     310A cross-compile toolchain exists of a set of tools: a compiler, linker,
     311assembler, debugger and a C~library. A cross-compile toolchain runs on your
     312host system and creates native binaries for your target system. A cross-compile
     313toolchain is basically created in six steps:
    308314
    309315\begin{enumerate}
     
    318324The cross-compile toolchain is created in
    319325\file{staging\_dir\_\$(cpu\_arch)}\footnote{e.g. mipsel, which stands for MIPS
    320 Little Endian}. All the tools running on the host, but used to create, analyze or debug
    321 for the target are kept in this directory. All addon headers and libraries
    322 are installed to this directory.
     326Little Endian}. All the tools running on the host, but used to create, analyze
     327or debug for the target are kept in this directory. All addon headers and
     328libraries are installed to this directory.
    323329
    324330If you want to compile a simple application without using the ADK, just use the
     
    339345Your local copy of the FreeWRT ADK should now be prepared for building firmware
    340346images. The next step is to do an extensive configuration for the image you
    341 want to create. To start the configuration menu, type \command{make menuconfig}.
     347want to create. To start the configuration menu, type \command{make
     348menuconfig}.
    342349
    343350When selecting packages, \code{<*>} means it will be inserted into the firmware
     
    347354The target device and filesystem should already been chosen by you to the right
    348355value, if not you will have to issue a \command{make clean} before actually
    349 building the firmware image. Otherwise things get messed up. A smooth
    350 rebuild is a missing feature in the current ADK. For the packages, if unsure, you
    351 can just select one of the package collections. After that, you can still manually
    352 check the choices made by the collection and correct them if appropriate. Do not
    353 forget to save your configuration when leaving!
     356building the firmware image. Otherwise things get messed up. A smooth rebuild
     357is a missing feature in the current ADK. For the packages, if unsure, you can
     358just select one of the package collections. After that, you can still manually
     359check the choices made by the collection and correct them if appropriate. Do
     360not forget to save your configuration when leaving!
    354361
    355362After leaving the menubased configuration, type \command{make} again to build
    356363the new FreeWRT firmware image. Depending on your package selections and
    357 underlying hardware, this will take different amounts of time. For your spare time
    358 there is the following chapter giving some explanation about what is done at this
    359 point.
     364underlying hardware, this will take different amounts of time. For your spare
     365time there is the following chapter giving some explanation about what is done
     366at this point.
    360367
    361368\section{Firmware Build Process In Detail}
     
    373380        \item install all packages to the target root directory
    374381        \item create the root filesystem image
    375         \item create the firmware image (bootloader, kernel and root filesystem)
     382        \item create the firmware image (bootloader, kernel and root
     383                filesystem)
    376384\end{itemize}
    377385
    378 The result of the build process is created in the directory \file{bin/}.
    379 You will find a firmware image in the top level directory. Check the size of
    380 the binary image file to see if it is small enough to fit into flash memory of
    381 your embedded system. Furthermore there is a directory \file{package/}, which
     386The result of the build process is created in the directory \file{bin/}.  You
     387will find a firmware image in the top level directory. Check the size of the
     388binary image file to see if it is small enough to fit into flash memory of your
     389embedded system. Furthermore there is a directory \file{package/}, which
    382390contains all base and add--on packages.
    383391
     
    402410   make: *** [.prereq_done] Error 1
    403411        \end{Verbatim}
    404    it is quite a nice error that tells you to use more up to date software, but we can
    405    anyhow give this hostsystem a try and tell make to ignore those
     412   it is quite a nice error that tells you to use more up to date software, but
     413   we can anyhow give this hostsystem a try and tell make to ignore those
    406414   errors/warnings running \command{make prereq-noerror}.
    407415\end{itemize}
     
    410418
    411419If you encounter any compilation errors, then first try to reproduce the error.
    412 First update your ADK tree via \command{svn update}, to be sure that the error is not
    413 already fixed in the subversion repository. After that do a \command{make clean
    414 \&\& make}, to reproduce your problem.
     420First update your ADK tree via \command{svn update}, to be sure that the error
     421is not already fixed in the subversion repository. After that do a
     422\command{make clean \&\& make}, to reproduce your problem.
    415423
    416424If you can reproduce the problem, please file a bug report. Please always
     
    440448
    441449The following text describes how to use the original firmware's web interface
    442 to flash FreeWRT. The object of demonstration is an \term{Asus WL500gP}, but this
    443 guide should fit more or less fine for other systems, too.
    444 
    445 If you flash a router from \term{Linksys}, we strongly suggest to use the popular
    446 \term{ping exploit} to allow recovery, if your image is broken or the flash
    447 process was interrupted by a power shortage.
     450to flash FreeWRT. The object of demonstration is an \term{Asus WL500gP}, but
     451this guide should fit more or less fine for other systems, too.
     452
     453If you flash a router from \term{Linksys}, we strongly suggest to use the
     454popular \term{ping exploit} to allow recovery, if your image is broken or the
     455flash process was interrupted by a power shortage.
    448456
    449457There are some things that you should have done previously:
     
    459467\parbox{17em}{
    460468After preparation is complete, open your favourite browser and type
    461 \command{192.168.1.1} into the address bar. You should reach the web interface's
    462 startup page:
    463 }\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-startup.png}} \\ [1em]
     469\command{192.168.1.1} into the address bar. You should reach the web
     470interface's startup page:
     471}\hfill\parbox{20em}{
     472        \includegraphics[width=20em]{pics/asus-startup.png}
     473} \\ [1em]
    464474\parbox{17em}{
    465475Then click on \code{System Setup}:
    466 }\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-system_setup.png}} \\ [1em]
     476}\hfill\parbox{20em}{
     477        \includegraphics[width=20em]{pics/asus-system_setup.png}
     478} \\ [1em]
    467479\parbox{17em}{
    468 In the new menu click on \code{Firmware Upgrade}, and enter the name of your firmware image
    469 into the appropriate field:
    470 }\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-fw_upgrade.png}} \\ [1em]
     480In the new menu click on \code{Firmware Upgrade}, and enter the name of your
     481firmware image into the appropriate field:
     482}\hfill\parbox{20em}{
     483        \includegraphics[width=20em]{pics/asus-fw_upgrade.png}
     484} \\ [1em]
    471485Finally click on \code{Upload}. As the whole process of writing the image to
    472 flash and rebooting (don't forget that it creates \app{ssh} hostkeys on first boot)
    473 takes quite long (yes, a couple of minutes). Better go and get a coffee or tea.
    474 
    475 When everything went well, you can login using \app{ssh}. The default username is
    476 "\code{admin}". The default password for images created via WIB or ADK is
    477 "\code{FreeWRT}". It is possible to change this password in the ADK,
    478 before image creation.
     486flash and rebooting (don't forget that it creates \app{ssh} hostkeys on first
     487boot) takes quite long (yes, a couple of minutes). Better go and get a coffee
     488or tea.
     489
     490When everything went well, you can login using \app{ssh}. The default username
     491is "\code{admin}". The default password for images created via WIB or ADK is
     492"\code{FreeWRT}". It is possible to change this password in the ADK, before
     493image creation.
    479494
    480495\subsection{\texttt{mtd} -- The Flash Utility}\label{sec:mtd}
    481496
    482497For this method to work, you need to copy the file containing the firmware
    483 image to the router, preferably into \file{/tmp/}, the memory filesystem should be
    484 big enough to hold the full image. If not, use \app{wget} to get the image
     498image to the router, preferably into \file{/tmp/}, the memory filesystem should
     499be big enough to hold the full image. If not, use \app{wget} to get the image
    485500via http or ftp and pipe the result into \app{mtd}.
    486501
     
    488503additional options (see below).
    489504
    490 The \app{mtd} utility was written with simplicity and code size in mind.
    491 It's features were derived from the
    492 \href{http://sources.redhat.com/jffs2/}{\app{mtd-utils}},
    493 combining the needed parts into a single small tool providing all the
    494 functionality necessary for FreeWRT, and leaving everything out that's not.
     505The \app{mtd} utility was written with simplicity and code size in mind.  It's
     506features were derived from the
     507\href{http://sources.redhat.com/jffs2/}{\app{mtd-utils}}, combining the needed
     508parts into a single small tool providing all the functionality necessary for
     509FreeWRT, and leaving everything out that's not.
    495510
    496511\app{mtd} provides the following features:
    497512\begin{description}
    498513        \item[unlock] some chips need unlocking before they can be written to
    499         \item[erase] this is a filesystem independent method to delete all contents on
    500                 the flash. Basically this is like \app{format} in MS--DOS.
    501         \item[write] this is generally the same functionality as using
    502                 \app{dd} or \app{rawrite}, but \app{mtd} takes care of the quirks
    503                 that have to be paid attention to for correctly handling the type of flash
    504                 in use
     514        \item[erase] this is a filesystem independent method to delete all
     515                contents on the flash. Basically this is like \app{format} in
     516                MS--DOS.
     517        \item[write] this is generally the same functionality as using \app{dd}
     518                or \app{rawrite}, but \app{mtd} takes care of the quirks that
     519                have to be paid attention to for correctly handling the type of
     520                flash in use
    505521\end{description}
    506522
    507 Further it can request your system to reboot. Some of the features mentioned here can
    508 also be combined, so it is e.g. possible to immediately reboot the system after
    509 the flash has been written.
    510 
    511 Mostly, similar to the sample usage shown in the help output should be all that has to be
    512 done to write the firmware to flash:
     523Further it can request your system to reboot. Some of the features mentioned
     524here can also be combined, so it is e.g. possible to immediately reboot the
     525system after the flash has been written.
     526
     527Mostly, similar to the sample usage shown in the help output should be all that
     528has to be done to write the firmware to flash:
    513529\begin{Verbatim}[label=write a previously downloaded new firmware-file into flash]
    514530# mtd -e linux -r write freewrt.bin linux &
     
    522538        \item[\command{-e linux}] erase existing data in flash
    523539        \item[\command{-r}] trigger rebooting right after finishing work
    524         \item[\command{write}] write the firmware image contained in the file given as
    525                 next parameter to flash
    526         \item[\command{freewrt.bin}] the actual image to write -- ignore the suffix,
    527                 it is detected at runtime
    528         \item[\command{linux}] this is an abstract identifier for a certain partition
    529                 in flash, so don't change this
    530         \item[\command{\&}] put the process into background, to prevent accidentally
    531                 stopping
     540        \item[\command{write}] write the firmware image contained in the file
     541                given as next parameter to flash
     542        \item[\command{freewrt.bin}] the actual image to write -- ignore the
     543                suffix, it is detected at runtime
     544        \item[\command{linux}] this is an abstract identifier for a certain
     545                partition in flash, so don't change this
     546        \item[\command{\&}] put the process into background, to prevent
     547                accidentally stopping
    532548\end{description}
    533549
    534550\subsection{Installation using TFTP}\label{sec:tftp}
    535551
    536 All supported target devices are shipped with a builtin bootloader, comparable to
    537 the BIOS of \term{x86} machines. This bootloader is used to bootstrap the system until
    538 it can boot a regular operating system. Besides the ability to load
    539 the executable code from flash, it can be received from another node in the
    540 local area network via the famous TFTP protocol.
     552All supported target devices are shipped with a builtin bootloader, comparable
     553to the BIOS of \term{x86} machines. This bootloader is used to bootstrap the
     554system until it can boot a regular operating system. Besides the ability to
     555load the executable code from flash, it can be received from another node in
     556the local area network via the famous TFTP protocol.
    541557
    542558For doing this, there are two ways:
    543559\begin{itemize}
    544         \item the device acts as a client, asks the local \app{dhcpd} for a lease, the
    545                 address of the next \app{tftpd} and the filename to download
    546         \item the device acts as a server, having a known IP address and waiting for
    547                 any TFTP client to connect and send the file
     560        \item the device acts as a client, asks the local \app{dhcpd} for a
     561                lease, the address of the next \app{tftpd} and the filename to
     562                download
     563        \item the device acts as a server, having a known IP address and
     564                waiting for any TFTP client to connect and send the file
    548565\end{itemize}
    549566
    550567Most of the hardware supported by FreeWRT 1.0 uses the second method.  Only the
    551 device \term{Netgear WGT634u} is using the first method, the bootloader provides a
    552 DHCP/TFTP client. Though this may be a little confusing to people being familiar
    553 with netboot technologies, it is definitely the easier way of doing it. Otherwise
    554 one had to setup both DHCP and TFTP servers and configure them right.
     568device \term{Netgear WGT634u} is using the first method, the bootloader
     569provides a DHCP/TFTP client. Though this may be a little confusing to people
     570being familiar with netboot technologies, it is definitely the easier way of
     571doing it. Otherwise one had to setup both DHCP and TFTP servers and configure
     572them right.
    555573
    556574The even quite simple task of sending the flash image to the target device is
     
    572590get it to wait at boot: \\
    573591\begin{center}
    574         \begin{tabular}{l|l|p{7cm}} % TODO: fill this table
    575                 \strong{Target Device} & \strong{Action to be taken} & \strong{Comments} \\
    576                 \hline
    577                 All supported Linksys models & Ping Exploit & nvram variable \code{boot\_wait} needs to be on \\
    578                 All supported Asus models & Recovery mode & power off
    579                                                             $\rightarrow$ push and hold the reset button
    580                                                             $\rightarrow$ power on
    581                                                             $\rightarrow$ power led is flashing\\
    582         \end{tabular}
     592\begin{tabular}{l|l|p{7cm}} % TODO: fill this table
     593\strong{Target Device} & \strong{Action to be taken} & \strong{Comments} \\
     594\hline
     595All supported Linksys models & Ping Exploit & nvram variable \code{boot\_wait}
     596                                              needs to be on \\
     597All supported Asus models & Recovery mode & power off $\rightarrow$ push and
     598                                            hold the reset button $\rightarrow$
     599                                            power on $\rightarrow$ power led is
     600                                            flashing \\
     601\end{tabular}
    583602\end{center}
    584603
     
    592611\section{Network Configuration}
    593612
    594 The device names for real network interfaces in Linux are named \code{ethx} (\code{x} is
    595 \code{0--9}). If the device has a switch, the different ports are separated via VLAN
    596 technology. The vlan interfaces are named \code{ethx.y}.  The network configuration in
    597 FreeWRT is managed via \app{Busybox}'s \app{ifupdown} implementation. \app{Busybox}'s builtin \app{ip}
    598 command configures the network interfaces. There is no \app{ifconfig} or \app{route}.
     613The device names for real network interfaces in Linux are named \code{ethx}
     614(\code{x} is \code{0--9}). If the device has a switch, the different ports are
     615separated via VLAN technology. The vlan interfaces are named \code{ethx.y}.
     616The network configuration in FreeWRT is managed via \app{Busybox}'s
     617\app{ifupdown} implementation. \app{Busybox}'s builtin \app{ip} command
     618configures the network interfaces. There is no \app{ifconfig} or \app{route}.
    599619To show all configured network interfaces use:
    600620\begin{Verbatim}[label=show IP address]
     
    616636\end{Verbatim}
    617637
    618 \code{auto <iface-name>} is optional and, if set, tells the \app{ifup} script to
    619 start this interface automatically on bootup.
     638\code{auto <iface-name>} is optional and, if set, tells the \app{ifup} script
     639to start this interface automatically on bootup.
    620640
    621641Each interface needs a unique name which, depending on the method, represents
    622 either a physical interface or a logical interface name like \code{eth0.1} for a
    623 physical VLAN or \code{umts} as a logical name for a PPP interface.
     642either a physical interface or a logical interface name like \code{eth0.1} for
     643a physical VLAN or \code{umts} as a logical name for a PPP interface.
    624644
    625645Possible methods are:
    626646\begin{description}
    627         \item[static] use the given options to configure the interface statically
    628         \item[dhcp] just start a dhcp client using the interface \code{iface-name}
    629         \item[manual] don't configure the interface but start \code{pre-up.d} hook scripts
    630         \item[ppp] run \code{pon <provider>} where \code{<provider>} is given as an interface option
     647        \item[static] use the given options to configure the interface
     648                statically
     649        \item[dhcp] just start a dhcp client using the interface
     650                \code{iface-name}
     651        \item[manual] don't configure the interface but start \code{pre-up.d}
     652                hook scripts
     653        \item[ppp] run \code{pon <provider>} where \code{<provider>} is given
     654                as an interface option
    631655\end{description}
    632656
     
    660684
    661685
    662 If you need to do some advanced settings, because you have for example
    663 a powerful switch with a VLAN trunking port connected to one of your switch
     686If you need to do some advanced settings, because you have for example a
     687powerful switch with a VLAN trunking port connected to one of your switch
    664688ports, the configuration would look like this:
    665689
     
    694718\end{Verbatim}
    695719
    696 This configures four VLAN interfaces, \code{eth0.1} on physical ports 2, 3 and 4.
    697 The interfaces \code{eth0.2}, \code{eth0.3} and \code{eth0.4} are three
     720This configures four VLAN interfaces, \code{eth0.1} on physical ports 2, 3 and
     7214.  The interfaces \code{eth0.2}, \code{eth0.3} and \code{eth0.4} are three
    698722different networks with VLAN ID 2--4. The physical port 1 needs to be connected
    699723to a VLAN trunking port on a switch with knows the same VLAN IDs.
     
    704728        \item[port 0] this is typically the port labeled as WAN
    705729        \item[port 1--4] these are typically the ports labeled as LAN
    706         \item[port 5] this special port represents the port where the router--board is
    707                 connected to the switch
    708         \item[*] one interface always need an asterisk behind port 5 which means it is
    709                 the default interface and gets all the packages with unknown tags.
     730        \item[port 5] this special port represents the port where the
     731                router--board is connected to the switch
     732        \item[*] one interface always need an asterisk behind port 5 which
     733                means it is the default interface and gets all the packages
     734                with unknown tags.
    710735\end{description}
    711736
     
    717742        \item[netmask] the netmask     --- required
    718743        \item[broadcast] broadcast address --- only required for legacy
    719         applications (if using \code{+}, it will be calculated automatically by the kernel)
     744                applications (if using \code{+}, it will be calculated
     745                automatically by the kernel)
    720746        \item[gateway] an IP address added as default gateway if present
    721         \item[mac-address] if you need to change your MAC address (required for some DSL providers)
     747        \item[mac-address] if you need to change your MAC address (required for
     748                some DSL providers)
    722749\end{description}
    723750
     
    733760\subsection{Bridging}
    734761
    735 This is mostly needed to combine LAN and WLAN to a homogeneous network.
    736 Be sure you have installed the package \app{bridge-utils}.
     762This is mostly needed to combine LAN and WLAN to a homogeneous network.  Be
     763sure you have installed the package \app{bridge-utils}.
    737764
    738765\begin{Verbatim}[label=\file{/etc/network/interfaces}]
     
    755782
    756783This creates a new bridging interface \code{br0} which combines the VLAN
    757 interface \code{eth0.0} (representing the LAN-ports 1--4) and the WLAN interface
    758 \code{eth1} (on some devices like \term{Asus WL500gP} this might be \code{eth2}).
    759 The bridge interface needs always be the last one, otherwise it can not find
    760 the interfaces in \code{bridge-ifaces}.
     784interface \code{eth0.0} (representing the LAN-ports 1--4) and the WLAN
     785interface \code{eth1} (on some devices like \term{Asus WL500gP} this might be
     786\code{eth2}).  The bridge interface needs always be the last one, otherwise it
     787can not find the interfaces in \code{bridge-ifaces}.
    761788
    762789\subsection{WLAN}
    763790A router containing a WLAN interface has an additional ethernet device
    764791representing it. On Broad\-com-based hardware it is typically \code{eth1}
    765 (\term{Linksys}),\code{eth2} (\term{Asus WL500gP}) or on \term{Netgear WGT634u} which has a Madwifi
    766 WLAN chip, it is \code{ath0}, \code{ath1}, etc. You can use these interfaces
    767 standalone or bridged with other devices, e.g. the internal LAN.
     792(\term{Linksys}),\code{eth2} (\term{Asus WL500gP}) or on \term{Netgear WGT634u}
     793which has a Madwifi WLAN chip, it is \code{ath0}, \code{ath1}, etc. You can use
     794these interfaces standalone or bridged with other devices, e.g. the internal
     795LAN.
    768796
    769797\subsubsection{Basic Settings}
     
    774802\strong{Option} & \strong{Parameter} & \strong{Description} \\
    775803\hline\hline
    776 \code{\strong{type}} & \code{broadcom}                & Broadcom based card \\
    777                      & \code{atheros}                 & Madwifi driver \\
    778 \hline
    779 \code{\strong{mode}} & \code{ap}                      & Access point mode \\
    780                      & \code{sta}                     & Client mode \\
    781                      & \code{adhoc}                   & Ad-Hoc mode \\
    782                      & \code{wds}                     & WDS point-to-point link over wireless\\
    783                      & \code{monitor}                 & The node acts as a passive monitor and only receives packets \\
    784 \hline
    785 \code{\strong{ssid}} & \code{<String>}                & Set the SSID (Network Name) \\
    786 \hline
    787 \code{country}       & \code{\{ALL|DE|JP|US|\ldots\}} & The country code used to determine the regulatory settings. \\
     804\code{\strong{type}} & \code{broadcom} & Broadcom based card \\
     805                     & \code{atheros}  & Madwifi driver \\
     806\hline
     807\code{\strong{mode}} & \code{ap}       & Access point mode \\
     808                     & \code{sta}      & Client mode \\
     809                     & \code{adhoc}    & Ad-Hoc mode \\
     810                     & \code{wds}      & WDS point-to-point link over wireless\\
     811                     & \code{monitor}  & The node acts as a passive monitor and
     812                                         only receives packets \\
     813\hline
     814\code{\strong{ssid}} & \code{<String>} & Set the SSID (Network Name) \\
     815\hline
     816\code{country}       & \code{\{ALL|DE|JP|US|\ldots\}} & The country code used
     817                                                        to determine the
     818                                                        regulatory settings. \\
    788819\hline
    789820\end{tabular}
     
    793824\strong{Option} & \strong{Parameter} & \strong{Description} \\
    794825\hline\hline
    795 \code{\strong{security}} & \code{none}            & No authorization \\
    796                          & \code{wep}             & WEP key \\
    797                          & \code{wpa-psk}         & WPA with preshared key \\
    798                          & \code{8021x}           & IEEE 802.1X authentication \\
     826\code{\strong{security}} & \code{none}    & No authorization \\
     827                         & \code{wep}     & WEP key \\
     828                         & \code{wpa-psk} & WPA with preshared key \\
     829                         & \code{8021x}   & IEEE 802.1X authentication \\
    799830\hline
    800831\code{\strong{authorization}} &                 & \strong{wpa-psk} \\
    801                               & \code{psk}             & WPA PSK \\
    802                               & \code{psk2}            & WPA2 PSK \\
    803                               & \code{psk psk2}        & WPA PSK and WPA2 PSK \\
    804                               &                        & \strong{8021x} \\
    805                               & \code{wpa}             & WPA with RADIUS \\
    806                               & \code{wpa2}            & WPA2 with RADIUS \\
    807                               & \code{wpa wpa2}        & WPA and WPA2 \\
    808 \hline
    809 \code{\strong{encryption}} &                        & \strong{wep} \\
    810                            & ---                    & not needed, automatically by key size \\
    811                            &                        & \strong{wpa-psk} \\
    812                            & \code{tkip}            & RC4 encryption \\
    813                            & \code{aes}             & AES encryption \\
    814                            & \code{aes+tkip}        & support both \\
    815                            &                        & \strong{8021x} \\
    816                            & \code{wep}             & RC4 encryption (static) \\
    817                            & \code{tkip}            & RC4 encryption \\
    818                            & \code{aes}             & AES encryption \\
    819                            & \code{aes+tkip}        & support both \\
    820 \hline
    821 \code{eap-type} &                        & \strong{8021x} \\
    822                 & \code{\strong{tls}}    & Transport Layer Security \\
    823                 & \code{ttls}            & Tunnelled TLS \\
    824                 & \code{peap}            & Protected EAP \\
    825                 & \code{leap}            & Cisco Wireless \\
     832                              & \code{psk}      & WPA PSK \\
     833                              & \code{psk2}     & WPA2 PSK \\
     834                              & \code{psk psk2} & WPA PSK and WPA2 PSK \\
     835                              &                 & \strong{8021x} \\
     836                              & \code{wpa}      & WPA with RADIUS \\
     837                              & \code{wpa2}     & WPA2 with RADIUS \\
     838                              & \code{wpa wpa2} & WPA and WPA2 \\
     839\hline
     840\code{\strong{encryption}} &                 & \strong{wep} \\
     841                           & ---             & not needed, automatically by key size \\
     842                           &                 & \strong{wpa-psk} \\
     843                           & \code{tkip}     & RC4 encryption \\
     844                           & \code{aes}      & AES encryption \\
     845                           & \code{aes+tkip} & support both \\
     846                           &                 & \strong{8021x} \\
     847                           & \code{wep}      & RC4 encryption (static) \\
     848                           & \code{tkip}     & RC4 encryption \\
     849                           & \code{aes}      & AES encryption \\
     850                           & \code{aes+tkip} & support both \\
     851\hline
     852\code{eap-type} &                     & \strong{8021x} \\
     853                & \code{\strong{tls}} & Transport Layer Security \\
     854                & \code{ttls}         & Tunnelled TLS \\
     855                & \code{peap}         & Protected EAP \\
     856                & \code{leap}         & Cisco Wireless \\
    826857\hline
    827858\code{key} &                            & \strong{wep} \\
     
    829860\hline
    830861\code{key[1..4]} &                 & \strong{wep} \\
    831                  & \code{<String>} & WEP key.  The key must be 5, 13 or 16 bytes
    832                                      long, or 10, 26, 32, or 64 hex digits long.  The encryption
    833                                      algorithm is automatically selected based on the key size. key1 is
    834                                      the key for WEP client mode. \\
    835 \hline
    836 \code{wpa-key} &                 & \strong{wpa-psk} \\
    837                & <String>        & Password to use with WPA/WPA2 PSK (at least 8, up to 63 chars) \\
    838 \hline
    839 \code{wpa-gtk-rekey} &                              & \strong{wpa-psk}, \strong{8021x} \\
    840                      & \code{<Int>} (\strong{3600}) & Rekeying interval in seconds. \\
     862                 & \code{<String>} & WEP key.  The key must be 5, 13 or 16
     863                                     bytes long, or 10, 26, 32, or 64 hex
     864                                     digits long.  The encryption algorithm is
     865                                     automatically selected based on the key
     866                                     size. key1 is the key for WEP client mode.
     867                                     \\
     868\hline
     869\code{wpa-key} &          & \strong{wpa-psk} \\
     870               & <String> & Password to use with WPA/WPA2 PSK (at least 8, up
     871                            to 63 chars) \\
     872\hline
     873\code{wpa-gtk-rekey} &                              & \strong{wpa-psk},
     874                                                      \strong{8021x} \\
     875                     & \code{<Int>} (\strong{3600}) & Rekeying interval in
     876                                                      seconds. \\
    841877\hline
    842878\code{\strong{radius-ipaddr}} &                  & \strong{8021x} \\
     
    844880\hline
    845881\code{radius-port} &                              & \strong{8021x} \\
    846                    & \code{<Int>} (\strong{1812}) & RADIUS-Port no. to connect \\
     882                   & \code{<Int>} (\strong{1812}) & RADIUS-Port no. to connect
     883                                                    \\
    847884\hline
    848885\strong{radius-key} &                 & \strong{8021x} \\
    849                     & \code{<String>} & Shared Secret for connection to the Radius server \\
     886                    & \code{<String>} & Shared Secret for connection to the
     887                                        Radius server \\
    850888\hline
    851889\end{longtable}
     
    856894\hline\hline
    857895\code{macmode} & \code{\{0|1|2\}} & 0: Disable MAC address matching. \\
    858                &                  & 1: Deny association to stations on the MAC list. \\
    859                &                  & 2: Allow association to stations on the MAC list. \\
    860 \hline
    861 \code{maclist} & \code{<MAC1> \ldots <MACn>} & List of space separated mac addresses to
    862 allow/deny according to \code{macmode}. Addresses should be entered with colons,
    863 e.g.: "\code{00:02:2D:08:E2:1D 00:03:3E:05:E1:1B}"\\
     896               &                  & 1: Deny association to stations on the MAC
     897                                       list. \\
     898               &                  & 2: Allow association to stations on the MAC
     899                                       list. \\
     900\hline
     901\code{maclist} & \code{<MAC1> \ldots <MACn>} & List of space separated mac
     902                                               addresses to allow/deny
     903                                               according to \code{macmode}.
     904                                               Addresses should be entered with
     905                                               colons, e.g.:
     906                                               "\code{00:02:2D:08:E2:1D
     907                                               00:03:3E:05:E1:1B}"\\
    864908\end{tabular}
    865909
     
    868912\strong{Option}       & \strong{Parameter}          & \strong{Description} \\
    869913\hline\hline
    870 \code{lazywds}        & \code{\{0|1\}}              & Accept WDS connections from anyone \\
    871 \hline
    872 \code{wds-bridge}     & \code{br\{X\}}              & Add WDS peers to bridge brX \\
    873 \hline
    874 \code{wds-security}   & \code{\{wpa-psk\}}          & secure the wds bridge with WPA (optional)\\
    875 \hline
    876 \code{wds-encryption} & \code{\{aes|tkip\}}         & Use AES or TKIP as cipher\\
    877 \hline
    878 \code{wds-wpa-key}    & \code{<String>}             & Password to use with WPA PSK (at least 8, up to 63 chars) \\
    879 \hline
    880 \code{wds}            & \code{<MAC1> \ldots <MACn>} & List of WDS peer mac addresses (\code{xx:xx:xx:xx:xx:xx}, space separated) \\
     914\code{lazywds}        & \code{\{0|1\}}              & Accept WDS connections
     915                                                      from anyone \\
     916\hline
     917\code{wds-bridge}     & \code{br\{X\}}              & Add WDS peers to bridge
     918                                                      brX \\
     919\hline
     920\code{wds-security}   & \code{\{wpa-psk\}}          & secure the wds bridge
     921                                                      with WPA (optional)\\
     922\hline
     923\code{wds-encryption} & \code{\{aes|tkip\}}         & Use AES or TKIP as
     924                                                      cipher\\
     925\hline
     926\code{wds-wpa-key}    & \code{<String>}             & Password to use with WPA
     927                                                      PSK (at least 8, up to 63
     928                                                      chars) \\
     929\hline
     930\code{wds}            & \code{<MAC1> \ldots <MACn>} & List of WDS peer mac
     931                                                      addresses
     932                                                      (\code{xx:xx:xx:xx:xx:xx},
     933                                                      space separated) \\
    881934\hline
    882935\end{tabular}
     
    886939\strong{Option} & \strong{Parameter} & \strong{Description} \\
    887940\hline\hline
    888 \code{channel}      & \code{\{1--14\}}                & The wifi channel \\
    889 \hline
    890 \code{maxassoc}     & \code{\{1--255\}}              & Maximum number of associated clients \\
     941\code{channel}  & \code{\{1--14\}}  & The wifi channel \\
     942\hline
     943\code{maxassoc} & \code{\{1--255\}} & Maximum number of associated clients \\
    891944\hline
    892945% TODO: add descriptions to the different gmode settings
    893 \code{gmode}        &                                 & Set the 54g Mode \\
    894                     & \code{\strong{Auto}}            & default \\
    895                     & \code{LegacyB}                  & \\
    896                     & \code{GOnly}                    & \\
    897                     & \code{BDeferred}                & \\
    898                     & \code{Performance}              & \\
    899                     & \code{LRS}                      & \\
    900 \hline
    901 \code{frameburst}   & \code{\{\strong{0}|1\}}         & Disable/Enable frameburst mode. \\
    902 \hline
    903 \code{txpower}      & \code{\{0--255|\strong{$-1$}\}} & Set the transmit power in dBm \\
    904 \hline
    905 \code{rate}         & \code{<Int> (\strong{$-1$})}    & force a fixed rate \\
    906                     &                                 & valid values for 802.11a are (6, 9, 12, 18, 24, 36, 48, 54) \\
    907                     &                                 & valid values for 802.11b are (1, 2, 5.5, 11) \\
    908                     &                                 & valid values for 802.11g are (1, 2, 5.5, 6, 9, 11, 12, 18, 24, 36, 48, 54) \\
    909                     &                                 & $-1$ means automatically determine the best rate \\
    910 \hline
    911 \code{rts}          & \code{\{0-2347\}}               & Set the RTS threshhold. \\
    912 \hline
    913 \code{frag}         & \code{\{256-2346\}}             & Set the fragmentation threshhold. \\
    914 \hline
    915 \code{afterburner}  & \code{\{\strong{0}|1\}}         & Enable Afterburner capability \\
    916 \hline
    917 \code{isolate}      & \code{\{\strong{0}|1\}}         & Hide Clients from each other \\
    918 \hline
    919 \code{bridge-if}    & \code{\{br0..brX\}}             & The bridge interface (optional) \\
     946\code{gmode} &                      & Set the 54g Mode \\
     947             & \code{\strong{Auto}} & default \\
     948             & \code{LegacyB}       & \\
     949             & \code{GOnly}         & \\
     950             & \code{BDeferred}     & \\
     951             & \code{Performance}   & \\
     952             & \code{LRS}           & \\
     953\hline
     954\code{frameburst} & \code{\{\strong{0}|1\}} & Disable/Enable frameburst mode. \\
     955\hline
     956\code{txpower} & \code{\{0--255|\strong{$-1$}\}} & Set the transmit power in dBm \\
     957\hline
     958\code{rate} & \code{<Int> (\strong{$-1$})} & force a fixed rate \\
     959            &                              & valid values for 802.11a are (6,
     960                                             9, 12, 18, 24, 36, 48, 54) \\
     961            &                              & valid values for 802.11b are (1,
     962                                             2, 5.5, 11) \\
     963            &                              & valid values for 802.11g are (1,
     964                                             2, 5.5, 6, 9, 11, 12, 18, 24, 36,
     965                                             48, 54) \\
     966            &                              & $-1$ means automatically determine
     967                                             the best rate \\
     968\hline
     969\code{rts}          & \code{\{0-2347\}}       & Set the RTS threshhold. \\
     970\hline
     971\code{frag}         & \code{\{256-2346\}}     & Set the fragmentation
     972                                                threshhold. \\
     973\hline
     974\code{afterburner}  & \code{\{\strong{0}|1\}} & Enable Afterburner capability
     975                                                \\
     976\hline
     977\code{isolate}      & \code{\{\strong{0}|1\}} & Hide Clients from each other \\
     978\hline
     979\code{bridge-if}    & \code{\{br0..brX\}}     & The bridge interface (optional)
     980                                                \\
    920981\hline
    921982\end{longtable}
     
    9731034        wireless-mac 00:01:02:03:04:05 06:07:08:09:0a:0b
    9741035\end{Verbatim}
    975 this enables the filter and defines the list to contain addresses that should be allowed.
    976 
    977 To enhance wireless performance, you can enable some flags like Broadcom's SpeedBooster. Normally, these flags are not dangerous:
     1036this enables the filter and defines the list to contain addresses that should
     1037be allowed.
     1038
     1039To enhance wireless performance, you can enable some flags like Broadcom's
     1040SpeedBooster. Normally, these flags are not dangerous:
    9781041\begin{Verbatim}[label=\file{/etc/network/interfaces}]
    9791042        wireless-gmode performance
     
    10631126PPP comes in various flavours for different situations, the most commonly
    10641127needed will likely be DSL and for \term{WRT54G3G} users UMTS. So there exists a
    1065 hook-script that evaluates a \code{use-template} option and generates a ppp-peer.
    1066 This way everything needed so far can be configured within the
    1067 \code{interfaces} file. Be sure you have installed the packages
    1068 \app{kmod-ppp}, \app{ppp} and \app{ppp-mod-pppoe}. For providers
    1069 using PPTP for authentication, instead of PPPoE, you need to install \app{pptp}.
     1128hook-script that evaluates a \code{use-template} option and generates a
     1129ppp-peer.  This way everything needed so far can be configured within the
     1130\code{interfaces} file. Be sure you have installed the packages \app{kmod-ppp},
     1131\app{ppp} and \app{ppp-mod-pppoe}. For providers using PPTP for authentication,
     1132instead of PPPoE, you need to install \app{pptp}.
    10701133
    10711134\subsubsection{DSL with PPPoE}
     
    10801143\end{Verbatim}
    10811144
    1082 Now your DSL connection will be started on boot (\code{auto ppp0})
    1083 and you can manually shut it down with \command{ifdown ppp0} or start it up with
    1084 \command{ifup ppp0}.
    1085 The template \code{dsl} will configure a typical PPPoE peer for you.
     1145Now your DSL connection will be started on boot (\code{auto ppp0}) and you can
     1146manually shut it down with \command{ifdown ppp0} or start it up with
     1147\command{ifup ppp0}.  The template \code{dsl} will configure a typical PPPoE
     1148peer for you.
    10861149
    10871150\subsubsection{DSL with PPTP}
     
    10981161\end{Verbatim}
    10991162
    1100 Now your DSL connection will be started on boot (\code{auto ppp0})
    1101 and you can manually shut it down with \command{ifdown ppp0} or start it up with
    1102 \command{ifup ppp0}.
    1103 The template \code{pptp} will configure a typical PPTP peer for you.
     1163Now your DSL connection will be started on boot (\code{auto ppp0}) and you can
     1164manually shut it down with \command{ifdown ppp0} or start it up with
     1165\command{ifup ppp0}.  The template \code{pptp} will configure a typical PPTP
     1166peer for you.
    11041167
    11051168\subsubsection{UMTS}
     
    11221185give empty double quotes as value like \code{""}.
    11231186
    1124 Note that you have to set the correct APN, username and password for your provider!
    1125 
    1126 You may also remove the pin from your SIM-card and the configuration if you like.
     1187Note that you have to set the correct APN, username and password for your
     1188provider!
     1189
     1190You may also remove the pin from your SIM-card and the configuration if you
     1191like.
    11271192
    11281193For \term{Linksys WRT54G3G} a package called \app{broadcom-watchbutton} will be
    11291194installed, this is a small daemon that monitors the UMTS-button of the router
    11301195and executes \command{ifup umts} or \command{ifdown umts} on a button press.
    1131 You have to set \code{watchbutton=YES} in /etc/rc.conf to have it start automatically.
     1196You have to set \code{watchbutton=YES} in /etc/rc.conf to have it start
     1197automatically.
    11321198
    11331199This is totally independent from the \code{auto umts} setting. Even if you
     
    11361202\subsection{custom interface hooks}
    11371203\subsubsection{per interface}
    1138 You can execute various commands on interface startup or shutdown with special option:
     1204You can execute various commands on interface startup or shutdown with special
     1205option:
    11391206\begin{Verbatim}[label=\file{/etc/network/interfaces}]
    11401207iface foobar inet static
     
    11471214\end{Verbatim}
    11481215
    1149 You can give each option multiple times and their commands will be executed in given order.
     1216You can give each option multiple times and their commands will be executed in
     1217given order.
    11501218\begin{description}
    11511219        \item[pre-up] before the interface will be started
     
    11561224
    11571225\subsubsection{general hooks}
    1158 Additionally you can write scripts executed for each interface if you put them in
     1226Additionally you can write scripts executed for each interface if you put them
     1227in
    11591228\begin{itemize}
    11601229        \item \texttt{/etc/network/if-pre-up.d}
     
    11671236\section{FWCF - FreeWRT Configuration Filesystem}
    11681237
    1169 FWCF is a separate flash partition for all changes made to the \file{/etc/} directory.
    1170 There is a small tool named \app{fwcf}, which is used to setup the system or
    1171 to commit changes to the fwcf partition.
     1238FWCF is a separate flash partition for all changes made to the \file{/etc/}
     1239directory.  There is a small tool named \app{fwcf}, which is used to setup the
     1240system or to commit changes to the fwcf partition.
    11721241
    11731242On bootup the script \file{/sbin/mount\_root} is executed, which calls
    1174 \command{fwcf setup} to setup \file{/etc/} as memory filesystem and overlay the changes committed
    1175 to the fwcf partition.
    1176 
    1177 If you change anything in \file{/etc/} and like to keep the change, it is required to
    1178 execute \command{fwcf commit}. This will compress all changed or new files in
    1179 \file{/etc/} and write the result into the fwcf partition.  The fwcf partition is 128 Kb in
    1180 size. This size is not changeable at the moment.
     1243\command{fwcf setup} to setup \file{/etc/} as memory filesystem and overlay the
     1244changes committed to the fwcf partition.
     1245
     1246If you change anything in \file{/etc/} and like to keep the change, it is
     1247required to execute \command{fwcf commit}. This will compress all changed or
     1248new files in \file{/etc/} and write the result into the fwcf partition.  The
     1249fwcf partition is 128 Kb in size. This size is not changeable at the moment.
    11811250
    11821251If you need more detailed information, please read the specification of FWCF,
    1183 which can be found
    1184 at \url{http://www.freewrt.org/trac/wiki/Documentation/Specs/FwCf}
    1185 
    1186 If you want to remove all your changes and start your configuration from scratch,
    1187 use \command{fwcf erase}. This is also required if you switch between compression
    1188 plugins. Right now LZO plugin is default.
     1252which can be found at
     1253\url{http://www.freewrt.org/trac/wiki/Documentation/Specs/FwCf}
     1254
     1255If you want to remove all your changes and start your configuration from
     1256scratch, use \command{fwcf erase}. This is also required if you switch between
     1257compression plugins. Right now LZO plugin is default.
    11891258
    11901259\section{IPKG - Packagemanagement}
    11911260
    1192 All software for FreeWRT is available as a IPKG package. IPKG is a package manager
    1193 very similar to Debian's \app{dpkg/apt-get} utilities. It is specially designed for
    1194 embedded systems and is widely used. The FreeWRT project use a special version,
    1195 which is embedded to the busybox binary. Normally the command line tool
    1196 \app{ipkg} is pre-installed.
     1261All software for FreeWRT is available as a IPKG package. IPKG is a package
     1262manager very similar to Debian's \app{dpkg/apt-get} utilities. It is specially
     1263designed for embedded systems and is widely used. The FreeWRT project use a
     1264special version, which is embedded to the busybox binary. Normally the command
     1265line tool \app{ipkg} is pre-installed.
    11971266
    11981267IPKG uses a configuration file similar to \file{/etc/apt/sources.list}, which
    1199 contains a list of software repositories available via HTTP or FTP.
    1200 The configuration file \file{/etc/ipkg.conf} contains the official
    1201 FreeWRT 1.0 repository for your board and kernel version.
     1268contains a list of software repositories available via HTTP or FTP.  The
     1269configuration file \file{/etc/ipkg.conf} contains the official FreeWRT 1.0
     1270repository for your board and kernel version.
    12021271
    12031272To update the list of available packages execute following command as root:
     
    12141283\end{Verbatim}
    12151284
    1216 This will install the package \app{tcpdump} and all dependencies onto the flash.
    1217 Where the data is saved depends on the root filesystem you decided to use while
    1218 installing FreeWRT. If you use jffs2 as root filesystem, then the package is
    1219 installed on the big linux partition. If you use squashfs-overlay, then the
    1220 package is installed on the mini-fo overlay filesystem which writes its data
    1221 to the jffs2 data partition. If you use a squashfs-symlinks filesystem, then the
    1222 package data is directly install into the jffs2 data partition, containing
    1223 symlinks to the read-only squashfs partition.
    1224 
    1225 You can also remove packages, but this is only useful if you are using jffs2
    1226 as root filesystem:
     1285This will install the package \app{tcpdump} and all dependencies onto the
     1286flash.  Where the data is saved depends on the root filesystem you decided to
     1287use while installing FreeWRT. If you use jffs2 as root filesystem, then the
     1288package is installed on the big linux partition. If you use squashfs-overlay,
     1289then the package is installed on the mini-fo overlay filesystem which writes
     1290its data to the jffs2 data partition. If you use a squashfs-symlinks
     1291filesystem, then the package data is directly install into the jffs2 data
     1292partition, containing symlinks to the read-only squashfs partition.
     1293
     1294You can also remove packages, but this is only useful if you are using jffs2 as
     1295root filesystem:
    12271296\begin{Verbatim}[label=example removal of \app{tcpdump}]
    12281297# ipkg remove tcpdump
     
    12301299
    12311300This will not remove any dependencies, installed earlier. For example,
    1232 \app{libpcap} is still installed after executing this command.
    1233 On jffs2 root filesystem you should never remove any essential packages like
    1234 \app{busybox}, \app{fwcf} or \app{uclibc}, otherwise you make the embedded system unusable.
    1235 
    1236 Nearly the same as for removing packages, counts for \command{ipkg upgrade}.  Please
    1237 \strong{never ever} use \command{ipkg upgrade} to update your embedded system.  This command
    1238 is only useful to upgrade single packages on a jffs2 rootfilesystem or data
    1239 partition.
     1301\app{libpcap} is still installed after executing this command.  On jffs2 root
     1302filesystem you should never remove any essential packages like \app{busybox},
     1303\app{fwcf} or \app{uclibc}, otherwise you make the embedded system unusable.
     1304
     1305Nearly the same as for removing packages, counts for \command{ipkg upgrade}.
     1306Please \strong{never ever} use \command{ipkg upgrade} to update your embedded
     1307system.  This command is only useful to upgrade single packages on a jffs2
     1308rootfilesystem or data partition.
    12401309
    12411310\section{Startup scripts}
     
    12431312Some of the available packages containing software which start services at boot
    12441313time. For that we provide simple startup scripts, which are installed into the
    1245 directory \file{/etc/init.d}. See following example for
    1246 the package \app{dnsmasq}, a combined dns and dhcp
    1247 server daemon:
     1314directory \file{/etc/init.d}. See following example for the package
     1315\app{dnsmasq}, a combined dns and dhcp server daemon:
    12481316
    12491317\begin{Verbatim}[label=\file{/etc/init.d/S50dnsmasq}]
     
    12751343\end{Verbatim}
    12761344
    1277 After installation the package postinst script will add all needed changes to the
    1278 \file{/etc/} directory. For example packages can add new user and groups, add new
    1279 variables to \file{/etc/rc.conf} or just add new values to existing files as
    1280 \file{/etc/services}. It is FreeWRT policy not to start any services after
    1281 installation or in case of a new boot. To start services on bootup you need to set
    1282 \code{\$servicename=YES} in \file{/etc/rc.conf} and commit your changes via
    1283 \command{fwcf commit}. For every policy exists an exception, we start all essential services
    1284 by default, like ssh daemon, syslog and network initialisation.
    1285 
    1286 For some services you can control the startup behaviour by modifying
    1287 the \code{\$servicename\_flags} variable in \file{/etc/rc.conf}.
    1288 
    1289 For example the variable \code{\$ssh\_opts} is provided as an argument to the dropbear
    1290 ssh daemon to control its behaviour.
     1345After installation the package postinst script will add all needed changes to
     1346the \file{/etc/} directory. For example packages can add new user and groups,
     1347add new variables to \file{/etc/rc.conf} or just add new values to existing
     1348files as \file{/etc/services}. It is FreeWRT policy not to start any services
     1349after installation or in case of a new boot. To start services on bootup you
     1350need to set \code{\$servicename=YES} in \file{/etc/rc.conf} and commit your
     1351changes via \command{fwcf commit}. For every policy exists an exception, we
     1352start all essential services by default, like ssh daemon, syslog and network
     1353initialisation.
     1354
     1355For some services you can control the startup behaviour by modifying the
     1356\code{\$servicename\_flags} variable in \file{/etc/rc.conf}.
     1357
     1358For example the variable \code{\$ssh\_opts} is provided as an argument to the
     1359dropbear ssh daemon to control its behaviour.
    12911360
    12921361Having this policy helps you to configure your FreeWRT embedded system without
    1293 shooting yourself in the foot. For example if you try to realize a firewall system
    1294 and trying to set the rules in \file{/etc/firewall.user}, which is read by
    1295 \file{/etc/init.d/S45firewall}, if the iptables package is installed. You can just
    1296 reload the changed ruleset via \code{/etc/init.d/S45firewall restart}. If you managed
    1297 to kick you out of the system, you can just reboot the system and you gain access
    1298 again. As soon as your are ready with the firewall configuration and you decide
    1299 to activate the firewall rules on bootup, you set \code{firewall=YES} in
    1300 \file{/etc/rc.conf},
    1301 commit your changes via \command{fwcf commit} and reboot. Now the firewall
    1302 rules will be activated on bootup.
     1362shooting yourself in the foot. For example if you try to realize a firewall
     1363system and trying to set the rules in \file{/etc/firewall.user}, which is read
     1364by \file{/etc/init.d/S45firewall}, if the iptables package is installed. You
     1365can just reload the changed ruleset via \code{/etc/init.d/S45firewall restart}.
     1366If you managed to kick you out of the system, you can just reboot the system
     1367and you gain access again. As soon as your are ready with the firewall
     1368configuration and you decide to activate the firewall rules on bootup, you set
     1369\code{firewall=YES} in \file{/etc/rc.conf}, commit your changes via
     1370\command{fwcf commit} and reboot. Now the firewall rules will be activated on
     1371bootup.
    13031372
    13041373
     
    13071376\section{Failsafe Mode}
    13081377
    1309 Failsafe mode is very useful if you misconfigured your embedded system,
    1310 so that you can not access it anymore. E.g. if you accidentially disabled
    1311 secure shell or misconfigured the firewall, so that you can not login any
    1312 more.
     1378Failsafe mode is very useful if you misconfigured your embedded system, so that
     1379you can not access it anymore. E.g. if you accidentially disabled secure shell
     1380or misconfigured the firewall, so that you can not login any more.
    13131381
    13141382When in failsafe mode, the device won't interpret any networking setup files.
     
    13161384set up. It will just set the LAN interface up and give it the IP address
    13171385\file{192.168.1.1} and netmask \file{255.255.255.0}. Then it will start a
    1318 \app{telnet} daemon, so you get straight access (without depending on the installed SSH daemon).
     1386\app{telnet} daemon, so you get straight access (without depending on the
     1387installed SSH daemon).
    13191388
    13201389\subsection{How It Works}
    13211390
    13221391To get FreeWRT into failsafe mode you need physical access to the device and
    1323 the failsafe utility. The failsafe utility is built inside our ADK and
    1324 is available in the directory \file{bin/} after a successful build.
    1325 
    1326 If you just want to compile the tool and not a complete firmware image,
    1327 use following command:
     1392the failsafe utility. The failsafe utility is built inside our ADK and is
     1393available in the directory \file{bin/} after a successful build.
     1394
     1395If you just want to compile the tool and not a complete firmware image, use
     1396following command:
    13281397
    13291398\begin{Verbatim}[label=building the failsafe utility for the host system]
     
    13411410
    13421411Connect your computer to the embedded system via direct or crossed network
    1343 cable. Use the failsafe port (in most cases one of the LAN ports),
    1344 see the device specific page for the exact network port.
    1345 
    1346 Configure your network interface to the IP address \file{192.168.1.2} with network
    1347 mask \file{255.255.255.0}. Now start the failsafe utility on your computer.
     1412cable. Use the failsafe port (in most cases one of the LAN ports), see the
     1413device specific page for the exact network port.
     1414
     1415Configure your network interface to the IP address \file{192.168.1.2} with
     1416network mask \file{255.255.255.0}. Now start the failsafe utility on your
     1417computer.
    13481418
    13491419\begin{Verbatim}
     
    13751445\subsection{Repairing Your FreeWRT Configuration}
    13761446
    1377 If you want to repair your configuration, you first need to
    1378 mount the root filesystem read--writeable. This is best done via:
     1447If you want to repair your configuration, you first need to mount the root
     1448filesystem read--writeable. This is best done via:
    13791449
    13801450\begin{Verbatim}
     
    13951465\end{Verbatim}
    13961466
    1397 If you want to start over with the default \file{/etc/} directory, just remove the fwcf
    1398 partition content with following command:
     1467If you want to start over with the default \file{/etc/} directory, just remove
     1468the fwcf partition content with following command:
    13991469
    14001470\begin{Verbatim}
     
    14021472\end{Verbatim}
    14031473
    1404 You can either use \command{reboot -f} or the option \command{-r} for \app{mtd} to reboot the system.
     1474You can either use \command{reboot -f} or the option \command{-r} for \app{mtd}
     1475to reboot the system.
    14051476
    14061477%\section{Serial Console}
Note: See TracChangeset for help on using the changeset viewer.