| 1 | \documentclass[12pt,a4paper,openany,smallheadings,
|
|---|
| 2 | headinclude,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[%
|
|---|
| 30 | colorlinks=true,anchorcolor=red,
|
|---|
| 31 | breaklinks=true,linkcolor=blue,urlcolor=red,
|
|---|
| 32 | citecolor=skyblue,
|
|---|
| 33 | pdfauthor={The FreeWRT Team},
|
|---|
| 34 | pdftitle={FreeWRT User Handbook},
|
|---|
| 35 | pdfcreator={tetex and VIM},
|
|---|
| 36 | pdfsubject={Open Source},
|
|---|
| 37 | pdfview=FitV,
|
|---|
| 38 | pdfstartview=FitV,
|
|---|
| 39 | pdfstartpage={1},
|
|---|
| 40 | pdfpagelayout=SinglePage,
|
|---|
| 41 | pdfpagemode=None,
|
|---|
| 42 | pdfkeywords={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 |
|
|---|
| 97 | Welcome to FreeWRT! This handbook covers the building, installation and usage
|
|---|
| 98 | aspects of the FreeWRT 1.0 Linux distribution. FreeWRT is a portable, secure
|
|---|
| 99 | and functional Linux distribution for embedded systems. As FreeWRT is a source
|
|---|
| 100 | code distribution, it does not provide any pre-compiled firmware for embedded
|
|---|
| 101 | systems. The latest version of this document is always available at the
|
|---|
| 102 | FreeWRT website. If you have any comments, criticism or found some wrong
|
|---|
| 103 | description, please send us an e-mail to freewrt-handbook@freewrt.org, we are
|
|---|
| 104 | always happy about getting feedback to this document, and will try to update
|
|---|
| 105 | or correct the issues mentioned by you.
|
|---|
| 106 |
|
|---|
| 107 | The FreeWRT User handbook is split into five distinct sections. Appliance
|
|---|
| 108 | Development Kit covers the building of FreeWRT firmware images. The second
|
|---|
| 109 | section, Installing FreeWRT, covers all aspects regarding the installation and
|
|---|
| 110 | deinstallation of FreeWRT firmware images. The third section is a detailed
|
|---|
| 111 | description of the startup process of FreeWRT. The fourth section, Using FreeWRT,
|
|---|
| 112 | covers administrational tasks, such as network configuration, the FreeWRT
|
|---|
| 113 | configuration filesystem, package management and update mechanism. The last
|
|---|
| 114 | section helps troubleshooting problems and recovering a bad firmware installation.
|
|---|
| 115 | The appendix contains board specific information. For FreeWRT 1.0 these are only
|
|---|
| 116 | Broadcom based embedded systems.
|
|---|
| 117 |
|
|---|
| 118 | The intended audience for this handbook are advanced users with basic
|
|---|
| 119 | knowledge about Linux, networking and software development. The reader should
|
|---|
| 120 | be aware of basic command line tools, the vi editor and a shell. FreeWRT does
|
|---|
| 121 | not contain any high level administration tools (e.g. web based
|
|---|
| 122 | administration) and is fully configured via command line.
|
|---|
| 123 |
|
|---|
| 124 | \section{Typographic Conventions}
|
|---|
| 125 |
|
|---|
| 126 | Examples starting with \# indicate a command that must be invoked as super
|
|---|
| 127 | user. You can use su to gain super user privileges.
|
|---|
| 128 |
|
|---|
| 129 | \begin{Verbatim}
|
|---|
| 130 | # fwcf commit
|
|---|
| 131 | \end{Verbatim}
|
|---|
| 132 |
|
|---|
| 133 | Examples starting with \$ indicate a command that can be invoked as a normal
|
|---|
| 134 | user. 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 |
|
|---|
| 143 | The ADK is the core of FreeWRT and contains all scripts and sources to create
|
|---|
| 144 | firmware images for every supported embedded system. FreeWRT 1.0 supports the
|
|---|
| 145 | following 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 |
|
|---|
| 164 | In this release we only support the Linux 2.4 kernel. The ADK contains over
|
|---|
| 165 | 600 software packages.
|
|---|
| 166 |
|
|---|
| 167 | \section{Prerequisites}
|
|---|
| 168 |
|
|---|
| 169 | Here is a list of all supported and tested host systems. The host system is
|
|---|
| 170 | needed 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 |
|
|---|
| 181 | Please install the following software, which is needed to build a basic
|
|---|
| 182 | firmware image. If you choose more packages some more prerequisites might be
|
|---|
| 183 | needed. The ADK host checks will warn you about any software you need to install to
|
|---|
| 184 | compile 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 |
|
|---|
| 203 | The ADK scripts will check for the required versions of these tools in advance.
|
|---|
| 204 |
|
|---|
| 205 | To build FreeWRT with the ADK it is recommended to have an unprivileged
|
|---|
| 206 | user. Please \underline{never} build FreeWRT as super user. Because all necessary source
|
|---|
| 207 | tarballs are downloaded from the internet automatically, your host system
|
|---|
| 208 | needs a working internet connection.
|
|---|
| 209 |
|
|---|
| 210 | \section{Getting the source}
|
|---|
| 211 |
|
|---|
| 212 | Now go to a directory where you want to build the firmware. Depending on the
|
|---|
| 213 | features you select you will need about 2.5-5 GB free disk space. This
|
|---|
| 214 | includes the ADK itself, any source archives which will be downloaded
|
|---|
| 215 | and their extracted copies (for compiling).
|
|---|
| 216 |
|
|---|
| 217 | To 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 |
|
|---|
| 223 | After successfully downloading, enter the directory:
|
|---|
| 224 |
|
|---|
| 225 | \begin{Verbatim}
|
|---|
| 226 | $ cd freewrt
|
|---|
| 227 | \end{Verbatim}
|
|---|
| 228 |
|
|---|
| 229 | This directory will be referred to as the ADK root later on.
|
|---|
| 230 |
|
|---|
| 231 | \section{Some Theory First}
|
|---|
| 232 |
|
|---|
| 233 | Building a FreeWRT firmware image is just like building a new Linux kernel,
|
|---|
| 234 | but a little more complex. There is a ncurses-based configuration menu at the
|
|---|
| 235 | beginning, the changes made are saved into a file named ,,.config'' in the ADK
|
|---|
| 236 | root. The build is done by the various Makefiles, compiling and linking the
|
|---|
| 237 | sources together accordingly to the symbols defined in ,,.config''.
|
|---|
| 238 |
|
|---|
| 239 | Unlike kernel compilation, FreeWRT needs to be cross-compiled. This
|
|---|
| 240 | leads to special premises, as most of the tools need to be specially build.
|
|---|
| 241 | But no panic, FreeWRT will do this all for you. In fact, this is done at the
|
|---|
| 242 | second run of \texttt{make} (the first one opens the configuration), and
|
|---|
| 243 | therefore can be seen as part of the first firmware build. For clarity
|
|---|
| 244 | though, we will discuss these two things separately.
|
|---|
| 245 |
|
|---|
| 246 | \section{Preparing the Build Process}
|
|---|
| 247 |
|
|---|
| 248 | After downloading the FreeWRT ADK, it's time to prepare the ADK for the
|
|---|
| 249 | building of firmware images (for explanations see the chapter above).
|
|---|
| 250 |
|
|---|
| 251 | \subsection{Creating A Configuration}
|
|---|
| 252 | The first step is to run \texttt{make}. After checking some prerequisites (see
|
|---|
| 253 | ,,Troubleshooting'' below for aid in problems), a console based configuration
|
|---|
| 254 | menu should start. Theoretically no choices have to be made, but it's proven
|
|---|
| 255 | useful 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 |
|
|---|
| 261 | Then quit saving changes. If you forgot that, just run \texttt{make} again, redo
|
|---|
| 262 | your changes, then save.
|
|---|
| 263 |
|
|---|
| 264 | \subsection{Building ADK}
|
|---|
| 265 |
|
|---|
| 266 | Now that you have a first minimal configuration, it is time to build the toolchain
|
|---|
| 267 | for cross-compiling. To do this, just enter {{{make}}} again. The build starts
|
|---|
| 268 | downloading and compiling each needed part of the toolchain, and later continues
|
|---|
| 269 | with building the first firmware image. Later one can be taken as proof of a
|
|---|
| 270 | working ADK.
|
|---|
| 271 |
|
|---|
| 272 | Already experienced in compiling gcc? Then you know... If not, better be told
|
|---|
| 273 | that it takes \underline{really long} to finish. In the meantime I suggest reading the
|
|---|
| 274 | next chapter dealing with internals about cross-compiling.
|
|---|
| 275 |
|
|---|
| 276 | \section{Details Of Cross-Compiling}
|
|---|
| 277 |
|
|---|
| 278 | A cross-compile toolchain exists of a set of tools: a compiler, linker, assembler,
|
|---|
| 279 | debugger and a c library. A cross-compile toolchain runs on your host system and
|
|---|
| 280 | creates native binaries for your target system. A cross-compile toolchain is
|
|---|
| 281 | basically 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 |
|
|---|
| 292 | The cross-compile toolchain is created in
|
|---|
| 293 | ,,staging\_dir\_\$(cpu\_arch)''\footnote{f.e. mipsel, which stands for MIPS Little
|
|---|
| 294 | Endian)}. All the tools running on the host, but used to create, analyze or debug
|
|---|
| 295 | for the target are kept in this directory. All addon headers and libraries
|
|---|
| 296 | are installed to this directory.
|
|---|
| 297 |
|
|---|
| 298 | If you want to compile a simple application without using the ADK, just use the
|
|---|
| 299 | compiler 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 |
|
|---|
| 304 | Check with ,,file'' if you got a MIPS binary:
|
|---|
| 305 | \begin{verbatim}
|
|---|
| 306 | $ file myapp
|
|---|
| 307 | myapp: ELF 32-bit LSB MIPS-I executable, MIPS, version 1 (SYSV), dynamically
|
|---|
| 308 | linked (uses shared libs), not stripped
|
|---|
| 309 | \end{verbatim}
|
|---|
| 310 |
|
|---|
| 311 | \section{Building A FreeWRT Firmware Image}
|
|---|
| 312 |
|
|---|
| 313 | Your local copy of the FreeWRT ADK should now be prepared for building firmware
|
|---|
| 314 | images. The next step is to do an extensive configuration for the image you
|
|---|
| 315 | want to create. To start the configuration menu, type ,,\texttt{make menuconfig}''.
|
|---|
| 316 |
|
|---|
| 317 | When selecting packages, \texttt{<*>} means it will be inserted into the firmware
|
|---|
| 318 | images and \texttt{<M>} means it will be build as an addon package which can be
|
|---|
| 319 | installed later at runtime.
|
|---|
| 320 |
|
|---|
| 321 | The target device and filesystem should already been chosen by you to the right
|
|---|
| 322 | value, if not you will have to issue a ,,\texttt{make clean}'' before actually
|
|---|
| 323 | building the firmware image. Otherwise things get messed up. A smooth
|
|---|
| 324 | rebuild is a missing feature in the current ADK. For the packages, if unsure, you
|
|---|
| 325 | can just select one of the package collections. After that, you can still manually
|
|---|
| 326 | check the choices made by the collection and correct them if appropriate. Do not
|
|---|
| 327 | forget to save your configuration when leaving!
|
|---|
| 328 |
|
|---|
| 329 | After leaving the menubased configuration, type ,,\texttt{make}'' again to build
|
|---|
| 330 | the new FreeWRT firmware image. Depending on your package selections and
|
|---|
| 331 | underlying hardware, this will take different amounts of time. For your spare time
|
|---|
| 332 | there is the following chapter giving some explanation about what is done at this
|
|---|
| 333 | point.
|
|---|
| 334 |
|
|---|
| 335 | \section{Firmware Build Process In Detail}
|
|---|
| 336 |
|
|---|
| 337 | Just like when building the ADK's toolchain, the sources for the selected
|
|---|
| 338 | packages are downloaded from the internet first, then build using the
|
|---|
| 339 | cross-compiler and libraries of the ADK.
|
|---|
| 340 |
|
|---|
| 341 | The 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 |
|
|---|
| 352 | The result of the build process is created in the ,,bin'' directory.
|
|---|
| 353 | You will find a firmware image in the top level directory. Check the size of
|
|---|
| 354 | the bin-file to see if it is small enough to fit into flash memory of
|
|---|
| 355 | your embedded system. Furthermore there is a ,,package'' directory, which
|
|---|
| 356 | contains all base and addon packages.
|
|---|
| 357 |
|
|---|
| 358 | \section{Troubleshooting}
|
|---|
| 359 | This section deals with various tips for problems with the ADK installation.
|
|---|
| 360 |
|
|---|
| 361 | \subsection{Errors During Prerequisites Check}
|
|---|
| 362 | To 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 |
|
|---|
| 386 | If you encounter any compilation errors, then first try to reproduce the error.
|
|---|
| 387 | First update your ADK tree via ,,svn update'', to be sure that the error is not
|
|---|
| 388 | already fixed in the subversion repository. After that do a ,,make clean \&\&
|
|---|
| 389 | make'', to reproduce your problem.
|
|---|
| 390 |
|
|---|
| 391 | If you can reproduce the problem, please file a bug report. Please always
|
|---|
| 392 | report 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 |
|
|---|
| 401 | The FreeWRT ADK produces a single image holding both kernel and root
|
|---|
| 402 | filesystem. This image can be written into your hardware's builtin flash memory
|
|---|
| 403 | on 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}
|
|---|
| 413 | The following text describes how to use the original firmware's web interface
|
|---|
| 414 | to flash FreeWRT. The object of demonstration is an Asus WL500gP, but this
|
|---|
| 415 | guide should fit more or less fine for other systems, too.
|
|---|
| 416 |
|
|---|
| 417 | If 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
|
|---|
| 419 | process was interrupted by a power shortage.
|
|---|
| 420 |
|
|---|
| 421 | There 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
|
|---|
| 428 | address 192.168.1.2)
|
|---|
| 429 | \end{itemize}
|
|---|
| 430 |
|
|---|
| 431 | \parbox{17em}{
|
|---|
| 432 | After 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
|
|---|
| 434 | startup page:
|
|---|
| 435 | }\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-startup.png}} \\ [1em]
|
|---|
| 436 | \parbox{17em}{
|
|---|
| 437 | Then click \textit{System Setup}:
|
|---|
| 438 | }\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-system_setup.png}} \\ [1em]
|
|---|
| 439 | \parbox{17em}{
|
|---|
| 440 | Then click \textit{Firmware Upgrade}, and enter the name of your firmware image
|
|---|
| 441 | into the appropriate field:
|
|---|
| 442 | }\hfill\parbox{20em}{\includegraphics[width=20em]{pics/asus-fw_upgrade.png}} \\ [1em]
|
|---|
| 443 | Finally click \textit{Upload}. As the whole process of writing the image to
|
|---|
| 444 | flash and rebooting (don't forget that it creates ssh hostkeys on first boot)
|
|---|
| 445 | takes quite long, better go and get a coffee or tea.
|
|---|
| 446 |
|
|---|
| 447 | When 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
|
|---|
| 450 | creation.
|
|---|
| 451 |
|
|---|
| 452 | \subsection{\texttt{mtd} -- The Flash Utility}
|
|---|
| 453 |
|
|---|
| 454 | For this method to work, you need to copy the file containing the firmware
|
|---|
| 455 | image to the router, preferably into /tmp, the memory filesystem should be
|
|---|
| 456 | big enough to hold the full image. If not, use wget to get the image
|
|---|
| 457 | via http or ftp and pipe the result into \texttt{mtd}.
|
|---|
| 458 |
|
|---|
| 459 | Then the image is written to flash using
|
|---|
| 460 | \texttt{mtd}, optionally giving additional options (see below).
|
|---|
| 461 |
|
|---|
| 462 | The \texttt{mtd} utility was written with simplicity and code size in mind.
|
|---|
| 463 | It's features were derived from the mtd-utils, %TODO: insert \ref to homepage
|
|---|
| 464 | combining the needed parts into a single small tool providing all the
|
|---|
| 465 | functionality 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 |
|
|---|
| 478 | Further it can request your system to reboot. Some of the features mentioned here can
|
|---|
| 479 | also be combined, so it is e.g. possible to immediately reboot the system after
|
|---|
| 480 | the flash has been written.
|
|---|
| 481 |
|
|---|
| 482 | Mostly, similar to the sample usage shown in the help output should be all that has to be
|
|---|
| 483 | done to write the firmware to flash:
|
|---|
| 484 | \begin{Verbatim}
|
|---|
| 485 | # mtd -e linux -r write freewrt.bin linux &
|
|---|
| 486 | \end{Verbatim}
|
|---|
| 487 | Or via wget pipe:
|
|---|
| 488 | \begin{Verbatim}
|
|---|
| 489 | # wget -O - http://www.yourserver.com/freewrt.bin | mtd -e linux -r write - linux &
|
|---|
| 490 | \end{Verbatim}
|
|---|
| 491 | The 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\\
|
|---|
| 495 | write & write the firmware image contained in the file given as next parameter
|
|---|
| 496 | to flash\\
|
|---|
| 497 | freewrt.bin & the actual image to write - ignore the suffix, it is detected at
|
|---|
| 498 | runtime\\
|
|---|
| 499 | linux & this is an abstract identifier for a certain partition in flash, so
|
|---|
| 500 | don't change this\\
|
|---|
| 501 | \& & put the process into background, to prevent accidentally stopping\\
|
|---|
| 502 | \end{tabular}
|
|---|
| 503 |
|
|---|
| 504 | \subsection{Installation using TFTP}
|
|---|
| 505 |
|
|---|
| 506 | All supported target devices are shipped with a builtin bootloader, comparable to
|
|---|
| 507 | the BIOS of x86--machines. This bootloader is used to bootstrap the system until
|
|---|
| 508 | it can boot a regular operating system. Besides the ability to load
|
|---|
| 509 | the executable code from flash, it can be received from another node in the
|
|---|
| 510 | local area network via the famous TFTP protocol.
|
|---|
| 511 |
|
|---|
| 512 | For 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
|
|---|
| 515 | address 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
|
|---|
| 517 | any TFTP client to connect and send the file
|
|---|
| 518 | \end{itemize}
|
|---|
| 519 |
|
|---|
| 520 | Most of the hardware supported by FreeWRT 1.0 uses the second method. Only the
|
|---|
| 521 | device Netgear WGT634u is using the first method, the bootloader provides a
|
|---|
| 522 | DHCP/TFTP client. Though this may be a little confusing to people being familiar
|
|---|
| 523 | with netboot technologies, it is definitely the easier way of doing it. Otherwise
|
|---|
| 524 | one had to setup both DHCP and TFTP servers and configure them right.
|
|---|
| 525 |
|
|---|
| 526 | The even quite simple task of sending the flash image to the target device is
|
|---|
| 527 | made even more easy by providing a little shell script for the job. Invocation
|
|---|
| 528 | is as follows:
|
|---|
| 529 | \begin{Verbatim}
|
|---|
| 530 | $ ./scripts/flash.sh firmware.bin [address]
|
|---|
| 531 | \end{Verbatim}
|
|---|
| 532 | The second Parameter \textit{address} is used to specify a different IP address
|
|---|
| 533 | of 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
|
|---|
| 536 | script as the original name is parsed to guess what hardware is to be flashed.
|
|---|
| 537 |
|
|---|
| 538 | To actually being able to flash the device, it has to wait for a tftp
|
|---|
| 539 | connection when booting. To complicate installation of third vendor's firmware
|
|---|
| 540 | images and to improve bootup time, of course, this feature is disabled by
|
|---|
| 541 | default. The following list shows what has to be done for a certain device to
|
|---|
| 542 | get 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
|
|---|
| 546 | All supported Linksys models & Ping Exploit & nvram variable boot\_wait needs to be on \\
|
|---|
| 547 | All supported Asus models & Recovery mode & power off, push and hold the
|
|---|
| 548 | reset button, power on, power led is flashing\\
|
|---|
| 549 | \end{tabular}\end{center}
|
|---|
| 550 |
|
|---|
| 551 | \chapter{FreeWRT Administration}
|
|---|
| 552 |
|
|---|
| 553 | After the FreeWRT firmware image has been built by the ADK and later flashed
|
|---|
| 554 | onto the hardware, the resulting operating system has to be configured. This
|
|---|
| 555 | section provides the necessary information to do that, including tips and
|
|---|
| 556 | guides for using FreeWRT in general, of course.
|
|---|
| 557 |
|
|---|
| 558 | \section{Network Configuration}
|
|---|
| 559 |
|
|---|
| 560 | The device names for real network interfaces in Linux are named ethx (x is
|
|---|
| 561 | 0-9). If the device has a switch, the different ports are separated via VLAN
|
|---|
| 562 | technology. The vlan interfaces are named ethx.y. The network configuration in
|
|---|
| 563 | FreeWRT is managed via Busybox's ifupdown implementation. Busybox's ip builtin
|
|---|
| 564 | command configures the network interfaces. There is no \texttt{ifconfig} or \texttt{route}.
|
|---|
| 565 | To show all configured network interfaces use:
|
|---|
| 566 | \begin{Verbatim}
|
|---|
| 567 | $ ip addr show
|
|---|
| 568 | \end{Verbatim}
|
|---|
| 569 | To show the kernel routing table use:
|
|---|
| 570 | \begin{Verbatim}
|
|---|
| 571 | $ ip route show
|
|---|
| 572 | \end{Verbatim}
|
|---|
| 573 |
|
|---|
| 574 | All available network settings can be found in \texttt{/etc/network/interfaces}
|
|---|
| 575 | which has the common form:
|
|---|
| 576 | \begin{Verbatim}[label=/etc/network/interfaces]
|
|---|
| 577 | auto <iface-name>
|
|---|
| 578 | iface <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
|
|---|
| 585 | start this interface automatically on bootup.
|
|---|
| 586 |
|
|---|
| 587 | Each interface needs a unique name which, depending on the method, represents
|
|---|
| 588 | either a physical interface or a logical interface name like "eth0.1" for a
|
|---|
| 589 | physical VLAN or "umts" as a logical name for a PPP interface.
|
|---|
| 590 |
|
|---|
| 591 | Possible 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}
|
|---|
| 600 | The switch built-in into the most routers is capable of separating each port
|
|---|
| 601 | using VLAN tagging. You can configure the switch by simply adding the interface
|
|---|
| 602 | to the config file and giving the desired switch-ports:
|
|---|
| 603 | \begin{Verbatim}[label=/etc/network/interfaces]
|
|---|
| 604 | auto eth0.0
|
|---|
| 605 | iface eth0.0 inet static
|
|---|
| 606 | switch-ports 1 2 5*
|
|---|
| 607 | address 192.168.1.1
|
|---|
| 608 | netmask 255.255.255.0
|
|---|
| 609 |
|
|---|
| 610 | auto eth0.1
|
|---|
| 611 | iface eth0.1 inet static
|
|---|
| 612 | switch-ports 3 4 5
|
|---|
| 613 | address 192.168.2.1
|
|---|
| 614 | netmask 255.255.255.0
|
|---|
| 615 |
|
|---|
| 616 | auto eth0.2
|
|---|
| 617 | iface 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 |
|
|---|
| 624 | This 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 |
|
|---|
| 628 | If you need to do some advanced settings, because you have for example
|
|---|
| 629 | a powerful switch with a VLAN trunking port connected to one of your switch
|
|---|
| 630 | ports, the configuration would look like this:
|
|---|
| 631 |
|
|---|
| 632 | \begin{Verbatim}[label=/etc/network/interfaces]
|
|---|
| 633 | auto eth0.1
|
|---|
| 634 | iface eth0.1 inet static
|
|---|
| 635 | switch-ports 2 3 4 5*
|
|---|
| 636 | address 192.168.1.1
|
|---|
| 637 | netmask 255.255.255.0
|
|---|
| 638 |
|
|---|
| 639 | auto eth0.2
|
|---|
| 640 | iface eth0.2 inet static
|
|---|
| 641 | switch-ports 1t 5
|
|---|
| 642 | address 10.2.0.1
|
|---|
| 643 | netmask 255.255.255.0
|
|---|
| 644 | broadcast +
|
|---|
| 645 |
|
|---|
| 646 | auto eth0.3
|
|---|
| 647 | iface eth0.3 inet static
|
|---|
| 648 | switch-ports 1t 5
|
|---|
| 649 | address 10.3.0.1
|
|---|
| 650 | netmask 255.255.255.0
|
|---|
| 651 | broadcast +
|
|---|
| 652 |
|
|---|
| 653 | auto eth0.4
|
|---|
| 654 | iface 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 |
|
|---|
| 662 | This configures four VLAN interfaces, \texttt{eth0.1} on physical ports 2, 3 and 4.
|
|---|
| 663 | The interfaces \texttt{eth0.2}, \texttt{eth0.3} and \texttt{eth0.4} are three
|
|---|
| 664 | different networks with VLAN ID 2-4. The physical port 1 needs to be connected
|
|---|
| 665 | to a VLAN trunking port on a switch with knows the same VLAN IDs.
|
|---|
| 666 |
|
|---|
| 667 |
|
|---|
| 668 | Explanation:
|
|---|
| 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}
|
|---|
| 679 | As you can see in the VLAN example three interfaces were configured with static
|
|---|
| 680 | IP 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}
|
|---|
| 690 | That's just as simple as:
|
|---|
| 691 | \begin{Verbatim}[label=/etc/network/interfaces]
|
|---|
| 692 | auto eth0.1
|
|---|
| 693 | iface eth0.1 inet dhcp
|
|---|
| 694 | switch-ports 0 5
|
|---|
| 695 | \end{Verbatim}
|
|---|
| 696 | Typically this configures the WAN-Port to start a DHCP request on bootup.
|
|---|
| 697 |
|
|---|
| 698 | \subsection{Bridging}
|
|---|
| 699 |
|
|---|
| 700 | This is mostly needed to combine LAN and WLAN to a homogeneous network.
|
|---|
| 701 | Be sure you have installed the package \texttt{bridge-utils}.
|
|---|
| 702 |
|
|---|
| 703 | \begin{Verbatim}[label=/etc/network/interfaces]
|
|---|
| 704 | auto eth0.0
|
|---|
| 705 | iface eth0.0 inet manual
|
|---|
| 706 | switch-ports 1 2 3 4 5*
|
|---|
| 707 |
|
|---|
| 708 | auto eth1
|
|---|
| 709 | iface eth1 inet manual
|
|---|
| 710 | wireless-bridge-if br0
|
|---|
| 711 | [... other wifi-settings, see below ...]
|
|---|
| 712 |
|
|---|
| 713 | auto br0
|
|---|
| 714 | iface 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 |
|
|---|
| 721 | This creates a new bridging interface \texttt{br0} which combines the VLAN
|
|---|
| 722 | interface \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}).
|
|---|
| 724 | The bridge interface needs always be the last one, otherwise it can not find
|
|---|
| 725 | the interfaces in bridge-ifaces.
|
|---|
| 726 |
|
|---|
| 727 | \subsection{WLAN}
|
|---|
| 728 | A router containing a WLAN interface has an additional ethernet device
|
|---|
| 729 | representing it. On Broadcom-based hardware it is typically \texttt{eth1}
|
|---|
| 730 | (Linksys),\texttt{eth2} (Asus WL500gP) or on Netgear WGT634u which has a Madwifi
|
|---|
| 731 | WLAN chip, it is \texttt{ath0}, \texttt{ath1}, etc. You can use these interfaces
|
|---|
| 732 | standalone or bridged with other devices, e.g. the internal LAN.
|
|---|
| 733 |
|
|---|
| 734 | \subsubsection{Basic Settings}
|
|---|
| 735 |
|
|---|
| 736 | Mandatory 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) \\
|
|---|
| 749 | country & {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 \\
|
|---|
| 786 | eap-type & & \textbf{8021x} \\
|
|---|
| 787 | & \textbf{tls} & Transport Layer Security \\
|
|---|
| 788 | & ttls & Tunnelled TLS \\
|
|---|
| 789 | & peap & Protected EAP \\
|
|---|
| 790 | & leap & Cisco Wireless \\
|
|---|
| 791 | key & & \textbf{wep} \\
|
|---|
| 792 | &\{\textbf{1}|2|3|4\}& Select WEP key to use. \\
|
|---|
| 793 | key[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. \\
|
|---|
| 798 | wpa-key & & \textbf{wpa-psk} \\
|
|---|
| 799 | & <String> & Password to use with WPA/WPA2 PSK (at least 8,
|
|---|
| 800 | up to 63 chars) \\
|
|---|
| 801 | wpa-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. \\
|
|---|
| 805 | radius-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} \\
|
|---|
| 814 | macmode & {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. \\
|
|---|
| 817 | maclist & <MAC1> ... <MACn> & List of space separated mac addresses to
|
|---|
| 818 | allow/deny according to ''macmode''. Addresses should be entered with colons,
|
|---|
| 819 | e.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} \\
|
|---|
| 825 | lazywds & {0|1} & Accept WDS connections from anyone \\
|
|---|
| 826 | wds-bridge & {brX} & Add WDS peers to bridge brX \\
|
|---|
| 827 | wds & <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} \\
|
|---|
| 833 | channel & \{1-14\} & The wifi channel \\
|
|---|
| 834 | maxassoc & \{1-255\} & Maximum number of associated clients \\
|
|---|
| 835 | gmode & \{LegacyB| \textbf{Auto}| GOnly| BDeferred| Performance| LRS\} & Set the 54g Mode \\
|
|---|
| 836 | frameburst & \{\textbf{0}|1\} & Disable/Enable frameburst mode. \\
|
|---|
| 837 | txpower & \{0-255|\textbf{-1}\} & Set the transmit power in dBm \\
|
|---|
| 838 | rate & <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 \\
|
|---|
| 843 | rts & \{0-2347\} & Set the RTS threshhold. \\
|
|---|
| 844 | frag & \{256-2346\} & Set the fragmentation threshhold. \\
|
|---|
| 845 | afterburner & \{\textbf{0}|1\} & Enable Afterburner capability \\
|
|---|
| 846 | isolate & \{\textbf{0}|1\} & Hide Clients from each other \\
|
|---|
| 847 | bridge-if & \{br0...brX\} & The bridge interface (optional)
|
|---|
| 848 | \end{tabular}
|
|---|
| 849 |
|
|---|
| 850 | \subsubsection{Examples}
|
|---|
| 851 | WLAN with WEP128
|
|---|
| 852 | \begin{Verbatim}
|
|---|
| 853 | iface 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 |
|
|---|
| 866 | WLAN without encryption
|
|---|
| 867 | \begin{Verbatim}
|
|---|
| 868 | iface 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 |
|
|---|
| 880 | WLAN with WPA2 (AES)
|
|---|
| 881 | \begin{Verbatim}
|
|---|
| 882 | iface 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 |
|
|---|
| 897 | If 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}
|
|---|
| 902 | this enables the filter and defines the list to contain addresses that should be allowed.
|
|---|
| 903 |
|
|---|
| 904 | To 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 |
|
|---|
| 911 | WLAN client with WPA2 (AES) (''untested'')
|
|---|
| 912 | \begin{Verbatim}
|
|---|
| 913 | iface 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 |
|
|---|
| 927 | WLAN client with WEP128
|
|---|
| 928 | \begin{Verbatim}
|
|---|
| 929 | iface 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 |
|
|---|
| 938 | WLAN with WDS nodes, the WDS nodes need to have the same
|
|---|
| 939 | SSID, channel and encryption parameters.
|
|---|
| 940 |
|
|---|
| 941 | WDS node 1 (MAC of Wireless 06:05:04:03:02:01)
|
|---|
| 942 | \begin{Verbatim}
|
|---|
| 943 | iface 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}
|
|---|
| 957 | WDS node 2 (MAC of Wireless 01:02:03:04:05:06)
|
|---|
| 958 | \begin{Verbatim}
|
|---|
| 959 | iface 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 |
|
|---|
| 974 | Peer-to-Peer mode (no encryption, IP must be static)
|
|---|
| 975 | \begin{Verbatim}
|
|---|
| 976 | iface 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 |
|
|---|
| 990 | PPP comes in various flavours for different situations, the most commonly
|
|---|
| 991 | needed will likely be DSL and for WRT54G3G users UMTS. So there exists a
|
|---|
| 992 | hook-script that evaluates a "use-template" option and generates a ppp-peer.
|
|---|
| 993 | This 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}
|
|---|
| 999 | auto ppp0
|
|---|
| 1000 | iface 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 |
|
|---|
| 1008 | Now your t-online DSL connection will be started on boot (\texttt{auto ppp0})
|
|---|
| 1009 | and you can manually shut it down with \texttt{ifdown ppp0} or start it up with
|
|---|
| 1010 | \texttt{ifup ppp0}.
|
|---|
| 1011 | The template \texttt{dsl} will configure a typical PPPoE peer for you.
|
|---|
| 1012 |
|
|---|
| 1013 | \subsubsection{UMTS}
|
|---|
| 1014 | Same footprint different template and some specific options. That is all that
|
|---|
| 1015 | is needed for an UMTS connection to Vodafone as it can be seen in this example.
|
|---|
| 1016 | \begin{Verbatim}
|
|---|
| 1017 | iface 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}
|
|---|
| 1027 | As 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
|
|---|
| 1029 | without a value as that causes a failure in \texttt{ipup}. It does work if you
|
|---|
| 1030 | give empty double quotes as value like "".
|
|---|
| 1031 |
|
|---|
| 1032 | Note that you have to set the correct APN, username and password for your provider!
|
|---|
| 1033 |
|
|---|
| 1034 | You may also remove the pin from your SIM-card and the configuration if you like.
|
|---|
| 1035 |
|
|---|
| 1036 | For Linksys WRT54G3G a package called \texttt{broadcom-watchbutton} will be
|
|---|
| 1037 | installed, this is a small daemon that monitors the UMTS-button of the router
|
|---|
| 1038 | and executes \texttt{ifup umts} or \texttt{ifdown umts} on a button press.
|
|---|
| 1039 | You have to set \texttt{watchbutton=YES} in /etc/rc.conf to have it start automatically.
|
|---|
| 1040 |
|
|---|
| 1041 | This is totally independent from the \texttt{auto umts} setting. Even if you
|
|---|
| 1042 | start the connection on bootup you can shut it down again with a button press.
|
|---|
| 1043 |
|
|---|
| 1044 | \subsection{custom interface hooks}
|
|---|
| 1045 | \subsubsection{per interface}
|
|---|
| 1046 | You can execute various commands on interface startup or shutdown with special option:
|
|---|
| 1047 | \begin{Verbatim}
|
|---|
| 1048 | iface 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 |
|
|---|
| 1057 | You 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}
|
|---|
| 1066 | Additionally 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}
|
|---|
| 1073 | Same semantics as above.
|
|---|
| 1074 |
|
|---|
| 1075 | \section{FWCF - FreeWRT Configuration Filesystem}
|
|---|
| 1076 |
|
|---|
| 1077 | FWCF is a separate flash partition for all changes made to the /etc directory.
|
|---|
| 1078 | There is a small tool named \texttt{fwcf}, which is used to setup the system or
|
|---|
| 1079 | to commit changes to the fwcf partition.
|
|---|
| 1080 |
|
|---|
| 1081 | On bootup the script \texttt{/sbin/mount\_root} is executed, which calls \dq{}fwcf
|
|---|
| 1082 | setup\dq{} to setup /etc as memory filesystem and overlay the changes committed
|
|---|
| 1083 | to the fwcf partition.
|
|---|
| 1084 |
|
|---|
| 1085 | If you change anything in /etc and like to keep the change, it is required to
|
|---|
| 1086 | execute \dq{}fwcf commit\dq{}. This will compress all changed or new files in /etc
|
|---|
| 1087 | and write the result into the fwcf partition. The fwcf partition is 128 Kb in
|
|---|
| 1088 | size. This size is not changeable at the moment.
|
|---|
| 1089 |
|
|---|
| 1090 | If you need more detailed information, please read the specification of FWCF,
|
|---|
| 1091 | which can be found
|
|---|
| 1092 | here \url{http://www.freewrt.org/trac/wiki/Documentation/Specs/FwCf}
|
|---|
| 1093 |
|
|---|
| 1094 | If you want to remove all your changes and start your configuration from scratch,
|
|---|
| 1095 | use \dq{}fwcf erase\dq{}. This is also required if you switch between compression
|
|---|
| 1096 | plugins. Right now LZO plugin is default.
|
|---|
| 1097 |
|
|---|
| 1098 | \section{IPKG - Packagemanagement}
|
|---|
| 1099 |
|
|---|
| 1100 | All software for FreeWRT is available as a IPKG package. IPKG is a package manager
|
|---|
| 1101 | very similar to Debian's dpkg/apt-get utilities. It is specially designed for
|
|---|
| 1102 | embedded systems and is widely used. The FreeWRT project use a special version,
|
|---|
| 1103 | which is embedded to the busybox binary. Normally the command line tool
|
|---|
| 1104 | \texttt{ipkg} is pre-installed.
|
|---|
| 1105 |
|
|---|
| 1106 | IPKG uses a configuration file similar to /etc/apt/sources.list, which
|
|---|
| 1107 | contains a list of software repositories available via HTTP or FTP.
|
|---|
| 1108 | The configuration file \texttt{/etc/ipkg.conf} contains the official
|
|---|
| 1109 | FreeWRT 1.0 repository for your board and kernel version.
|
|---|
| 1110 |
|
|---|
| 1111 | To update the list of available packages execute following command as root:
|
|---|
| 1112 | \begin{verbatim}
|
|---|
| 1113 | # ipkg update
|
|---|
| 1114 | \end{verbatim}
|
|---|
| 1115 |
|
|---|
| 1116 | This command requires a working internet connection, because it will fetch a
|
|---|
| 1117 | package list from every repository declared in /etc/ipkg.conf.
|
|---|
| 1118 |
|
|---|
| 1119 | To install a new package use following command:
|
|---|
| 1120 | \begin{verbatim}
|
|---|
| 1121 | # ipkg install tcpdump
|
|---|
| 1122 | \end{verbatim}
|
|---|
| 1123 |
|
|---|
| 1124 | This will install the package tcpdump and all dependencies onto the flash.
|
|---|
| 1125 | Where the data is saved depends on the root filesystem you decided to use while
|
|---|
| 1126 | installing FreeWRT. If you use jffs2 as root filesystem, then the package is
|
|---|
| 1127 | installed on the big linux partition. If you use squashfs-overlay, then the
|
|---|
| 1128 | package is installed on the mini-fo overlay filesystem which writes its data
|
|---|
| 1129 | to the jffs2 data partition. If you use a squashfs-symlinks filesystem, then the
|
|---|
| 1130 | package data is directly install into the jffs2 data partition, containing
|
|---|
| 1131 | symlinks to the read-only squashfs partition.
|
|---|
| 1132 |
|
|---|
| 1133 | You can also remove packages, but this is only useful if you are using JFFS2
|
|---|
| 1134 | as root filesystem:
|
|---|
| 1135 | \begin{verbatim}
|
|---|
| 1136 | # ipkg remove tcpdump
|
|---|
| 1137 | \end{verbatim}
|
|---|
| 1138 |
|
|---|
| 1139 | This will not remove any dependencies, installed earlier. For example, libpcap
|
|---|
| 1140 | is still installed after executing this command.
|
|---|
| 1141 | On jffs2 root filesystem you should never remove any essential packages like
|
|---|
| 1142 | busybox, fwcf or uclibc, otherwise you make the embedded system unusable.
|
|---|
| 1143 |
|
|---|
| 1144 | Nearly 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
|
|---|
| 1146 | is only useful to upgrade single packages on a jffs2 rootfilesystem or data
|
|---|
| 1147 | partition.
|
|---|
| 1148 |
|
|---|
| 1149 | \section{Startup scripts}
|
|---|
| 1150 |
|
|---|
| 1151 | Some of the available packages containing software which start services at boot
|
|---|
| 1152 | time. For that we provide simple startup scripts, which are installed into the
|
|---|
| 1153 | directory \texttt{/etc/init.d}. See following example for
|
|---|
| 1154 | the package \texttt{dnsmasq}, a combined dns and dhcp
|
|---|
| 1155 | server daemon:
|
|---|
| 1156 |
|
|---|
| 1157 | \begin{verbatim}
|
|---|
| 1158 | #!/bin/sh
|
|---|
| 1159 |
|
|---|
| 1160 | . /etc/rc.conf
|
|---|
| 1161 |
|
|---|
| 1162 | case $1 in
|
|---|
| 1163 | autostart)
|
|---|
| 1164 | test x"${dns_dhcp:-NO}" = x"NO" && exit 0
|
|---|
| 1165 | exec $0 start
|
|---|
| 1166 | ;;
|
|---|
| 1167 | start)
|
|---|
| 1168 | [ -f /etc/dnsmasq.conf ] || exit
|
|---|
| 1169 | /usr/sbin/dnsmasq
|
|---|
| 1170 | ;;
|
|---|
| 1171 | stop)
|
|---|
| 1172 | killall dnsmasq
|
|---|
| 1173 | ;;
|
|---|
| 1174 | restart)
|
|---|
| 1175 | $0 stop
|
|---|
| 1176 | $0 start
|
|---|
| 1177 | ;;
|
|---|
| 1178 | *)
|
|---|
| 1179 | echo "Usage: $0 {start | stop | restart}"
|
|---|
| 1180 | ;;
|
|---|
| 1181 | esac
|
|---|
| 1182 | exit 0
|
|---|
| 1183 | \end{verbatim}
|
|---|
| 1184 |
|
|---|
| 1185 | After 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
|
|---|
| 1187 | variables 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
|
|---|
| 1189 | installation 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
|
|---|
| 1191 | commit\dq{}. For every policy exist a exception, we start all essential services
|
|---|
| 1192 | by default, like ssh daemon, syslog and network initialisation.
|
|---|
| 1193 |
|
|---|
| 1194 | For some services you can control the startup behavior by modifying
|
|---|
| 1195 | the services\_flags variable in /etc/rc.conf.
|
|---|
| 1196 |
|
|---|
| 1197 | For example the variable \$ssh\_opts is provided as argument to the dropbear
|
|---|
| 1198 | ssh daemon to control its behavior.
|
|---|
| 1199 |
|
|---|
| 1200 | Having this policy helps you to configure your FreeWRT embedded system without
|
|---|
| 1201 | shooting yourself in the foot. For example if you try to realize a firewall system
|
|---|
| 1202 | and 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
|
|---|
| 1204 | reload the changed ruleset via /etc/init.d/S45firewall restart. If you managed
|
|---|
| 1205 | to kick you out of the system, you can just reboot the system and you gain access
|
|---|
| 1206 | again. As soon as your are ready with the firewall configuration and you decide
|
|---|
| 1207 | to activate the firewall rules on bootup, you set \$firewall=YES in /etc/rc.conf,
|
|---|
| 1208 | commit your changes via \dq{}fwcf commit\dq{} and reboot. Now the firewall
|
|---|
| 1209 | rules will be activated on bootup.
|
|---|
| 1210 |
|
|---|
| 1211 |
|
|---|
| 1212 | \chapter{Troubleshooting}
|
|---|
| 1213 |
|
|---|
| 1214 | \section{Failsafe Mode}
|
|---|
| 1215 |
|
|---|
| 1216 | Failsafe mode is very useful if you misconfigured your embedded system,
|
|---|
| 1217 | so that you can not access it anymore. E.g. if you accidentially disabled
|
|---|
| 1218 | secure shell or misconfigured the firewall, so that you can not login any
|
|---|
| 1219 | more.
|
|---|
| 1220 |
|
|---|
| 1221 | When in failsafe mode, the device won't interpret any networking setup files.
|
|---|
| 1222 | It stops even before the root filesystem gets mounted read--write, and fwcf is
|
|---|
| 1223 | set up. It will just set the LAN interface up and give it the IP address
|
|---|
| 1224 | 192.168.1.1 and netmask 255.255.255.0. Then it will start a telnet daemon, so
|
|---|
| 1225 | you get straight access (without depending on the installed SSH--daemon).
|
|---|
| 1226 |
|
|---|
| 1227 | \subsection{How It Works}
|
|---|
| 1228 |
|
|---|
| 1229 | To get FreeWRT into failsafe mode you need physical access to the device and
|
|---|
| 1230 | the failsafe utility. The failsafe utility is built inside our ADK and
|
|---|
| 1231 | is available in the directory bin/ after a successful build.
|
|---|
| 1232 |
|
|---|
| 1233 | If you just want to compile the tool and not a complete firmware image,
|
|---|
| 1234 | use following command:
|
|---|
| 1235 |
|
|---|
| 1236 | \begin{Verbatim}
|
|---|
| 1237 | $ make subdir=tools/failsafe install
|
|---|
| 1238 | \end{Verbatim}
|
|---|
| 1239 |
|
|---|
| 1240 | For some operating systems we provide ready to go binaries of failsafe.
|
|---|
| 1241 | Take a look at http://www.freewrt.org/downloads/tools/failsafe
|
|---|
| 1242 |
|
|---|
| 1243 | The tool just opens a network socket and waits for a special UDP packet
|
|---|
| 1244 | from the embedded device. FreeWRT sends the UDP packet via the first
|
|---|
| 1245 | recognized network interface (eth0).
|
|---|
| 1246 |
|
|---|
| 1247 | \subsection{Enabling Failsafe Mode}
|
|---|
| 1248 |
|
|---|
| 1249 | Connect your computer to the embedded system via direct or crossed network
|
|---|
| 1250 | cable. Use the failsafe port (in most cases one of the LAN ports),
|
|---|
| 1251 | see the device specific page for the exact network port.
|
|---|
| 1252 |
|
|---|
| 1253 | Configure your network interface to the IP address 192.168.1.2 with network
|
|---|
| 1254 | mask 255.255.255.0. Now start the failsafe utility on your computer.
|
|---|
| 1255 |
|
|---|
| 1256 | \begin{Verbatim}
|
|---|
| 1257 | $ ./failsafe
|
|---|
| 1258 | \end{Verbatim}
|
|---|
| 1259 |
|
|---|
| 1260 | After that power on your embedded system and wait for the following message in
|
|---|
| 1261 | your failsafe application running on your computer:
|
|---|
| 1262 |
|
|---|
| 1263 | \begin{Verbatim}
|
|---|
| 1264 | Press reset now to enter Failsafe!
|
|---|
| 1265 | \end{Verbatim}
|
|---|
| 1266 |
|
|---|
| 1267 | As soon as this message is displayed you should push the reset button of
|
|---|
| 1268 | your embedded system. You have 2 seconds time to push the button. If you
|
|---|
| 1269 | successfully enabled the failsafe mode, following message will be displayed:
|
|---|
| 1270 |
|
|---|
| 1271 | \begin{Verbatim}
|
|---|
| 1272 | Entering Failsafe!
|
|---|
| 1273 | \end{Verbatim}
|
|---|
| 1274 |
|
|---|
| 1275 | Now you should be able to login to your embedded system via a telnet
|
|---|
| 1276 | application. Just use:
|
|---|
| 1277 |
|
|---|
| 1278 | \begin{Verbatim}
|
|---|
| 1279 | $ telnet 192.168.1.1
|
|---|
| 1280 | \end{Verbatim}
|
|---|
| 1281 |
|
|---|
| 1282 | \subsection{Repairing Your FreeWRT Configuration}
|
|---|
| 1283 |
|
|---|
| 1284 | If you want to repair your configuration, you first need to
|
|---|
| 1285 | mount the root filesystem read--writeable. This is best done via:
|
|---|
| 1286 |
|
|---|
| 1287 | \begin{Verbatim}
|
|---|
| 1288 | # mount_root
|
|---|
| 1289 | \end{Verbatim}
|
|---|
| 1290 |
|
|---|
| 1291 | After that you need to enable the FreeWRT configuration filesystem:
|
|---|
| 1292 |
|
|---|
| 1293 | \begin{Verbatim}
|
|---|
| 1294 | # fwcf setup
|
|---|
| 1295 | \end{Verbatim}
|
|---|
| 1296 |
|
|---|
| 1297 | Now you can change files in /etc and repair your broken configuration.
|
|---|
| 1298 | Do not forget to commit your changes afterwards.
|
|---|
| 1299 |
|
|---|
| 1300 | \begin{Verbatim}
|
|---|
| 1301 | # fwcf commit
|
|---|
| 1302 | \end{Verbatim}
|
|---|
| 1303 |
|
|---|
| 1304 | If you want to start over with the default /etc directory, just remove the fwcf
|
|---|
| 1305 | partition content with following command:
|
|---|
| 1306 |
|
|---|
| 1307 | \begin{Verbatim}
|
|---|
| 1308 | mtd erase fwcf
|
|---|
| 1309 | \end{Verbatim}
|
|---|
| 1310 |
|
|---|
| 1311 | You 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}
|
|---|