Changeset dac4ea5 in freewrt
- Timestamp:
- May 17, 2007, 11:12:17 PM (19 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- 7fc69e5f
- Parents:
- 8ca8ce4
- File:
-
- 1 edited
-
docs/handbook/user/handbook.tex (modified) (55 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/handbook/user/handbook.tex
r8ca8ce4 rdac4ea5 110 110 and functional Linux distribution for embedded systems. As FreeWRT is a source 111 111 code 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 to115 \href{mailto:freewrt-handbook@freewrt.org}{freewrt-handbook@freewrt.org}, we are116 a lways happy about getting feedback to this document, and will try to update117 or correct the issues mentioned by you.112 systems. The latest version of this document is always available at the FreeWRT 113 website. If you have any comments, criticism or found some wrong description, 114 please send us an e-mail to 115 \href{mailto:freewrt-handbook@freewrt.org}{freewrt-handbook@freewrt.org}, we 116 are always happy about getting feedback to this document, and will try to 117 update or correct the issues mentioned by you. 118 118 119 119 The 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 the120 \nameref{ch:ADK} covers the building of FreeWRT firmware images. In 121 \autoref{ch:installing}, \nameref{ch:installing}, all aspects regarding the 122 122 installation and deinstallation of FreeWRT firmware images are covered. The 123 123 next chapter, \nameref{ch:administration}, covers administrational tasks, such 124 124 as 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 b e aware of basic command line tools, the vi editor and a shell. FreeWRT does133 not contain any high level administration tools (e.g. web based 134 administration) and isfully configured via command line.125 management and update mechanism. The last chapter, 126 \nameref{ch:troubleshooting}, helps troubleshooting problems and recovering a 127 bad firmware installation. The appendix contains board specific information. 128 For FreeWRT 1.0 these are only Broadcom based embedded systems. 129 130 The intended audience for this handbook are advanced users with basic knowledge 131 about Linux, networking and software development. The reader should be aware of 132 basic command line tools, the vi editor and a shell. FreeWRT does not contain 133 any high level administration tools (e.g. web based administration) and is 134 fully configured via command line. 135 135 136 136 \section{Typographic Conventions} 137 137 138 Examples starting with \code{\#} indicate a command that must be invoked as super139 user. You can use \command{su} to gain super user privileges.138 Examples starting with \code{\#} indicate a command that must be invoked as 139 super user. You can use \command{su} to gain super user privileges. 140 140 141 141 \begin{Verbatim}[label=example for a command line with super user privileges] … … 179 179 \end{itemize} 180 180 181 In this release we only support the Linux 2.4 kernel. The ADK contains over 182 600software packages.181 In this release we only support the Linux 2.4 kernel. The ADK contains over 600 182 software packages. 183 183 184 184 \section{Prerequisites} … … 187 187 needed to create a firmware for your embedded system. 188 188 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. 189 The list of supported GNU/Linux build systems is not an exclusive one, these 190 are just the ones tested and verified. The other millions of linux 191 distributions are very likely to work, too. 190 192 191 193 \begin{itemize} … … 195 197 \item Ubuntu GNU/Linux 196 198 \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} 199 203 \end{itemize} 200 204 201 205 Please install the following software, which is needed to build a basic 202 206 firmware 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: 207 needed. The ADK host checks will warn you about any software you need to 208 install to compile a specific package. Here is a list of the required 209 software: 205 210 206 211 \begin{itemize} … … 223 228 The ADK scripts will check for the required versions of these tools in advance. 224 229 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.230 To build FreeWRT with the ADK it is recommended to have an unprivileged user. 231 Please \underline{never} build FreeWRT as super user. Because all necessary 232 source tarballs are downloaded from the internet automatically, your host 233 system needs a working internet connection. 229 234 230 235 \section{Getting the source} … … 232 237 Now go to a directory where you want to build the firmware. Depending on the 233 238 features 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 theirextracted copies (for compiling).239 includes the ADK itself, any source archives which will be downloaded and their 240 extracted copies (for compiling). 236 241 237 242 To get the latest stable FreeWRT ADK try one of these commands: … … 243 248 \end{Verbatim} 244 249 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. 250 The value $x$ is a place holder for the latest minor release number. Take a 251 look at our project page to find out which minor release number is the latest 252 one. 247 253 248 254 After successfully downloading, enter the directory: … … 256 262 \section{Some Theory First} 257 263 258 Building a FreeWRT firmware image is just like building a new Linux kernel, 259 buta little more complex. There is a \app{ncurses}-based configuration menu at the260 beginning, the changes made are saved into a file named \file{.config} in the ADK261 root. The build is done by the various Makefiles, compiling and linking the264 Building a FreeWRT firmware image is just like building a new Linux kernel, but 265 a little more complex. There is a \app{ncurses}-based configuration menu at the 266 beginning, the changes made are saved into a file named \file{.config} in the 267 ADK root. The build is done by the various Makefiles, compiling and linking the 262 268 sources together accordingly to the symbols defined in \file{.config}. 263 269 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 willdiscuss these two things separately.270 Unlike kernel compilation, FreeWRT needs to be cross-compiled. This leads to 271 special premises, as most of the tools need to be specially build. But no 272 panic, FreeWRT will do this all for you. In fact, this is done at the second 273 run of \command{make} (the first one opens the configuration), and therefore 274 can be seen as part of the first firmware build. For clarity though, we will 275 discuss these two things separately. 270 276 271 277 \section{Preparing the Build Process} … … 277 283 278 284 The first step is to run \command{make}. After checking some prerequisites (see 279 \nameref{ch:troubleshooting} below for aid in problems), a console based configuration280 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 286 configuration menu should start. Theoretically no choices have to be made, but 287 it's proven useful to at least: 282 288 \begin{itemize} 283 289 \item select a target (menu: \code{Embedded System}) … … 285 291 \end{itemize} 286 292 287 Then quit saving changes. If you forgot that, just run \command{make} again, redo288 your changes, then save.293 Then quit saving changes. If you forgot that, just run \command{make} again, 294 redo your changes, then save. 289 295 290 296 \subsection{Building ADK} 291 297 292 Now that you have a first minimal configuration, it is time to build the toolchain293 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 told299 that it takes \underline{really long} to finish. In the meantime I suggest reading the 300 next chapter dealing with internals about cross-compiling.298 Now that you have a first minimal configuration, it is time to build the 299 toolchain for cross-compiling. To do this, just enter \command{make} again. The 300 build starts downloading and compiling each needed part of the toolchain, and 301 later continues with building the first firmware image. Later one can be taken 302 as proof of a working ADK. 303 304 Already experienced in compiling \app{gcc}? Then you know\dots If not, better 305 be told that it takes \underline{really long} to finish. In the meantime I 306 suggest reading the next chapter dealing with internals about cross-compiling. 301 307 302 308 \section{Details Of Cross-Compiling} 303 309 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:310 A cross-compile toolchain exists of a set of tools: a compiler, linker, 311 assembler, debugger and a C~library. A cross-compile toolchain runs on your 312 host system and creates native binaries for your target system. A cross-compile 313 toolchain is basically created in six steps: 308 314 309 315 \begin{enumerate} … … 318 324 The cross-compile toolchain is created in 319 325 \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 debug321 for the target are kept in this directory. All addon headers and libraries 322 are installed to this directory.326 Little Endian}. All the tools running on the host, but used to create, analyze 327 or debug for the target are kept in this directory. All addon headers and 328 libraries are installed to this directory. 323 329 324 330 If you want to compile a simple application without using the ADK, just use the … … 339 345 Your local copy of the FreeWRT ADK should now be prepared for building firmware 340 346 images. 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}. 347 want to create. To start the configuration menu, type \command{make 348 menuconfig}. 342 349 343 350 When selecting packages, \code{<*>} means it will be inserted into the firmware … … 347 354 The target device and filesystem should already been chosen by you to the right 348 355 value, 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 canjust select one of the package collections. After that, you can still manually352 check the choices made by the collection and correct them if appropriate. Do not353 forget to save your configuration when leaving!356 building the firmware image. Otherwise things get messed up. A smooth rebuild 357 is a missing feature in the current ADK. For the packages, if unsure, you can 358 just select one of the package collections. After that, you can still manually 359 check the choices made by the collection and correct them if appropriate. Do 360 not forget to save your configuration when leaving! 354 361 355 362 After leaving the menubased configuration, type \command{make} again to build 356 363 the new FreeWRT firmware image. Depending on your package selections and 357 underlying hardware, this will take different amounts of time. For your spare time358 t here is the following chapter giving some explanation about what is done at this359 point.364 underlying hardware, this will take different amounts of time. For your spare 365 time there is the following chapter giving some explanation about what is done 366 at this point. 360 367 361 368 \section{Firmware Build Process In Detail} … … 373 380 \item install all packages to the target root directory 374 381 \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) 376 384 \end{itemize} 377 385 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 yourembedded system. Furthermore there is a directory \file{package/}, which386 The result of the build process is created in the directory \file{bin/}. You 387 will find a firmware image in the top level directory. Check the size of the 388 binary image file to see if it is small enough to fit into flash memory of your 389 embedded system. Furthermore there is a directory \file{package/}, which 382 390 contains all base and add--on packages. 383 391 … … 402 410 make: *** [.prereq_done] Error 1 403 411 \end{Verbatim} 404 it is quite a nice error that tells you to use more up to date software, but we can405 anyhow give this hostsystem a try and tell make to ignore those412 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 406 414 errors/warnings running \command{make prereq-noerror}. 407 415 \end{itemize} … … 410 418 411 419 If 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 not413 already fixed in the subversion repository. After that do a \command{make clean 414 \ &\& make}, to reproduce your problem.420 First update your ADK tree via \command{svn update}, to be sure that the error 421 is not already fixed in the subversion repository. After that do a 422 \command{make clean \&\& make}, to reproduce your problem. 415 423 416 424 If you can reproduce the problem, please file a bug report. Please always … … 440 448 441 449 The 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 this443 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 popular446 \term{ping exploit} to allow recovery, if your image is broken or the flash 447 process was interrupted by a power shortage.450 to flash FreeWRT. The object of demonstration is an \term{Asus WL500gP}, but 451 this guide should fit more or less fine for other systems, too. 452 453 If you flash a router from \term{Linksys}, we strongly suggest to use the 454 popular \term{ping exploit} to allow recovery, if your image is broken or the 455 flash process was interrupted by a power shortage. 448 456 449 457 There are some things that you should have done previously: … … 459 467 \parbox{17em}{ 460 468 After 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 470 interface's startup page: 471 }\hfill\parbox{20em}{ 472 \includegraphics[width=20em]{pics/asus-startup.png} 473 } \\ [1em] 464 474 \parbox{17em}{ 465 475 Then 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] 467 479 \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] 480 In the new menu click on \code{Firmware Upgrade}, and enter the name of your 481 firmware image into the appropriate field: 482 }\hfill\parbox{20em}{ 483 \includegraphics[width=20em]{pics/asus-fw_upgrade.png} 484 } \\ [1em] 471 485 Finally 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. 486 flash and rebooting (don't forget that it creates \app{ssh} hostkeys on first 487 boot) takes quite long (yes, a couple of minutes). Better go and get a coffee 488 or tea. 489 490 When everything went well, you can login using \app{ssh}. The default username 491 is "\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 493 image creation. 479 494 480 495 \subsection{\texttt{mtd} -- The Flash Utility}\label{sec:mtd} 481 496 482 497 For 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 be484 b ig enough to hold the full image. If not, use \app{wget} to get the image498 image to the router, preferably into \file{/tmp/}, the memory filesystem should 499 be big enough to hold the full image. If not, use \app{wget} to get the image 485 500 via http or ftp and pipe the result into \app{mtd}. 486 501 … … 488 503 additional options (see below). 489 504 490 The \app{mtd} utility was written with simplicity and code size in mind. 491 It'sfeatures were derived from the492 \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 forFreeWRT, and leaving everything out that's not.505 The \app{mtd} utility was written with simplicity and code size in mind. It's 506 features were derived from the 507 \href{http://sources.redhat.com/jffs2/}{\app{mtd-utils}}, combining the needed 508 parts into a single small tool providing all the functionality necessary for 509 FreeWRT, and leaving everything out that's not. 495 510 496 511 \app{mtd} provides the following features: 497 512 \begin{description} 498 513 \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 505 521 \end{description} 506 522 507 Further it can request your system to reboot. Some of the features mentioned here can508 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 be512 done to write the firmware to flash:523 Further it can request your system to reboot. Some of the features mentioned 524 here can also be combined, so it is e.g. possible to immediately reboot the 525 system after the flash has been written. 526 527 Mostly, similar to the sample usage shown in the help output should be all that 528 has to be done to write the firmware to flash: 513 529 \begin{Verbatim}[label=write a previously downloaded new firmware-file into flash] 514 530 # mtd -e linux -r write freewrt.bin linux & … … 522 538 \item[\command{-e linux}] erase existing data in flash 523 539 \item[\command{-r}] trigger rebooting right after finishing work 524 \item[\command{write}] write the firmware image contained in the file given as525 next parameter to flash526 \item[\command{freewrt.bin}] the actual image to write -- ignore the suffix,527 it is detected at runtime528 \item[\command{linux}] this is an abstract identifier for a certain partition529 in flash, so don't change this530 \item[\command{\&}] put the process into background, to prevent accidentally531 stopping540 \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 532 548 \end{description} 533 549 534 550 \subsection{Installation using TFTP}\label{sec:tftp} 535 551 536 All supported target devices are shipped with a builtin bootloader, comparable to537 t he BIOS of \term{x86} machines. This bootloader is used to bootstrap the system until538 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.552 All supported target devices are shipped with a builtin bootloader, comparable 553 to the BIOS of \term{x86} machines. This bootloader is used to bootstrap the 554 system until it can boot a regular operating system. Besides the ability to 555 load the executable code from flash, it can be received from another node in 556 the local area network via the famous TFTP protocol. 541 557 542 558 For doing this, there are two ways: 543 559 \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 548 565 \end{itemize} 549 566 550 567 Most 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. 568 device \term{Netgear WGT634u} is using the first method, the bootloader 569 provides a DHCP/TFTP client. Though this may be a little confusing to people 570 being familiar with netboot technologies, it is definitely the easier way of 571 doing it. Otherwise one had to setup both DHCP and TFTP servers and configure 572 them right. 555 573 556 574 The even quite simple task of sending the flash image to the target device is … … 572 590 get it to wait at boot: \\ 573 591 \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 595 All supported Linksys models & Ping Exploit & nvram variable \code{boot\_wait} 596 needs to be on \\ 597 All 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} 583 602 \end{center} 584 603 … … 592 611 \section{Network Configuration} 593 612 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}. 613 The 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 615 separated via VLAN technology. The vlan interfaces are named \code{ethx.y}. 616 The network configuration in FreeWRT is managed via \app{Busybox}'s 617 \app{ifupdown} implementation. \app{Busybox}'s builtin \app{ip} command 618 configures the network interfaces. There is no \app{ifconfig} or \app{route}. 599 619 To show all configured network interfaces use: 600 620 \begin{Verbatim}[label=show IP address] … … 616 636 \end{Verbatim} 617 637 618 \code{auto <iface-name>} is optional and, if set, tells the \app{ifup} script to619 start this interface automatically on bootup.638 \code{auto <iface-name>} is optional and, if set, tells the \app{ifup} script 639 to start this interface automatically on bootup. 620 640 621 641 Each 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 a623 physical VLAN or \code{umts} as a logical name for a PPP interface.642 either a physical interface or a logical interface name like \code{eth0.1} for 643 a physical VLAN or \code{umts} as a logical name for a PPP interface. 624 644 625 645 Possible methods are: 626 646 \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 631 655 \end{description} 632 656 … … 660 684 661 685 662 If you need to do some advanced settings, because you have for example 663 apowerful switch with a VLAN trunking port connected to one of your switch686 If you need to do some advanced settings, because you have for example a 687 powerful switch with a VLAN trunking port connected to one of your switch 664 688 ports, the configuration would look like this: 665 689 … … 694 718 \end{Verbatim} 695 719 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 three720 This configures four VLAN interfaces, \code{eth0.1} on physical ports 2, 3 and 721 4. The interfaces \code{eth0.2}, \code{eth0.3} and \code{eth0.4} are three 698 722 different networks with VLAN ID 2--4. The physical port 1 needs to be connected 699 723 to a VLAN trunking port on a switch with knows the same VLAN IDs. … … 704 728 \item[port 0] this is typically the port labeled as WAN 705 729 \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. 710 735 \end{description} 711 736 … … 717 742 \item[netmask] the netmask --- required 718 743 \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) 720 746 \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) 722 749 \end{description} 723 750 … … 733 760 \subsection{Bridging} 734 761 735 This is mostly needed to combine LAN and WLAN to a homogeneous network. 736 Besure you have installed the package \app{bridge-utils}.762 This is mostly needed to combine LAN and WLAN to a homogeneous network. Be 763 sure you have installed the package \app{bridge-utils}. 737 764 738 765 \begin{Verbatim}[label=\file{/etc/network/interfaces}] … … 755 782 756 783 This 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 interface758 \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}.784 interface \code{eth0.0} (representing the LAN-ports 1--4) and the WLAN 785 interface \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 787 can not find the interfaces in \code{bridge-ifaces}. 761 788 762 789 \subsection{WLAN} 763 790 A router containing a WLAN interface has an additional ethernet device 764 791 representing 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} 793 which has a Madwifi WLAN chip, it is \code{ath0}, \code{ath1}, etc. You can use 794 these interfaces standalone or bridged with other devices, e.g. the internal 795 LAN. 768 796 769 797 \subsubsection{Basic Settings} … … 774 802 \strong{Option} & \strong{Parameter} & \strong{Description} \\ 775 803 \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. \\ 788 819 \hline 789 820 \end{tabular} … … 793 824 \strong{Option} & \strong{Parameter} & \strong{Description} \\ 794 825 \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 \\ 799 830 \hline 800 831 \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 \\ 826 857 \hline 827 858 \code{key} & & \strong{wep} \\ … … 829 860 \hline 830 861 \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. \\ 841 877 \hline 842 878 \code{\strong{radius-ipaddr}} & & \strong{8021x} \\ … … 844 880 \hline 845 881 \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 \\ 847 884 \hline 848 885 \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 \\ 850 888 \hline 851 889 \end{longtable} … … 856 894 \hline\hline 857 895 \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}"\\ 864 908 \end{tabular} 865 909 … … 868 912 \strong{Option} & \strong{Parameter} & \strong{Description} \\ 869 913 \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) \\ 881 934 \hline 882 935 \end{tabular} … … 886 939 \strong{Option} & \strong{Parameter} & \strong{Description} \\ 887 940 \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 \\ 891 944 \hline 892 945 % 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 \\ 920 981 \hline 921 982 \end{longtable} … … 973 1034 wireless-mac 00:01:02:03:04:05 06:07:08:09:0a:0b 974 1035 \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: 1036 this enables the filter and defines the list to contain addresses that should 1037 be allowed. 1038 1039 To enhance wireless performance, you can enable some flags like Broadcom's 1040 SpeedBooster. Normally, these flags are not dangerous: 978 1041 \begin{Verbatim}[label=\file{/etc/network/interfaces}] 979 1042 wireless-gmode performance … … 1063 1126 PPP comes in various flavours for different situations, the most commonly 1064 1127 needed 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 the1067 \code{interfaces} file. Be sure you have installed the packages 1068 \app{ kmod-ppp}, \app{ppp} and \app{ppp-mod-pppoe}. For providers1069 using PPTP for authentication,instead of PPPoE, you need to install \app{pptp}.1128 hook-script that evaluates a \code{use-template} option and generates a 1129 ppp-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, 1132 instead of PPPoE, you need to install \app{pptp}. 1070 1133 1071 1134 \subsubsection{DSL with PPPoE} … … 1080 1143 \end{Verbatim} 1081 1144 1082 Now your DSL connection will be started on boot (\code{auto ppp0}) 1083 and you canmanually shut it down with \command{ifdown ppp0} or start it up with1084 \command{ifup ppp0}. 1085 The template \code{dsl} will configure a typical PPPoEpeer for you.1145 Now your DSL connection will be started on boot (\code{auto ppp0}) and you can 1146 manually 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 1148 peer for you. 1086 1149 1087 1150 \subsubsection{DSL with PPTP} … … 1098 1161 \end{Verbatim} 1099 1162 1100 Now your DSL connection will be started on boot (\code{auto ppp0}) 1101 and you canmanually shut it down with \command{ifdown ppp0} or start it up with1102 \command{ifup ppp0}. 1103 The template \code{pptp} will configure a typical PPTPpeer for you.1163 Now your DSL connection will be started on boot (\code{auto ppp0}) and you can 1164 manually 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 1166 peer for you. 1104 1167 1105 1168 \subsubsection{UMTS} … … 1122 1185 give empty double quotes as value like \code{""}. 1123 1186 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. 1187 Note that you have to set the correct APN, username and password for your 1188 provider! 1189 1190 You may also remove the pin from your SIM-card and the configuration if you 1191 like. 1127 1192 1128 1193 For \term{Linksys WRT54G3G} a package called \app{broadcom-watchbutton} will be 1129 1194 installed, this is a small daemon that monitors the UMTS-button of the router 1130 1195 and 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. 1196 You have to set \code{watchbutton=YES} in /etc/rc.conf to have it start 1197 automatically. 1132 1198 1133 1199 This is totally independent from the \code{auto umts} setting. Even if you … … 1136 1202 \subsection{custom interface hooks} 1137 1203 \subsubsection{per interface} 1138 You can execute various commands on interface startup or shutdown with special option: 1204 You can execute various commands on interface startup or shutdown with special 1205 option: 1139 1206 \begin{Verbatim}[label=\file{/etc/network/interfaces}] 1140 1207 iface foobar inet static … … 1147 1214 \end{Verbatim} 1148 1215 1149 You can give each option multiple times and their commands will be executed in given order. 1216 You can give each option multiple times and their commands will be executed in 1217 given order. 1150 1218 \begin{description} 1151 1219 \item[pre-up] before the interface will be started … … 1156 1224 1157 1225 \subsubsection{general hooks} 1158 Additionally you can write scripts executed for each interface if you put them in 1226 Additionally you can write scripts executed for each interface if you put them 1227 in 1159 1228 \begin{itemize} 1160 1229 \item \texttt{/etc/network/if-pre-up.d} … … 1167 1236 \section{FWCF - FreeWRT Configuration Filesystem} 1168 1237 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.1238 FWCF is a separate flash partition for all changes made to the \file{/etc/} 1239 directory. There is a small tool named \app{fwcf}, which is used to setup the 1240 system or to commit changes to the fwcf partition. 1172 1241 1173 1242 On 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 committed1175 to the fwcf partition.1176 1177 If you change anything in \file{/etc/} and like to keep the change, it is required to1178 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 1244 changes committed to the fwcf partition. 1245 1246 If you change anything in \file{/etc/} and like to keep the change, it is 1247 required to execute \command{fwcf commit}. This will compress all changed or 1248 new files in \file{/etc/} and write the result into the fwcf partition. The 1249 fwcf partition is 128 Kb in size. This size is not changeable at the moment. 1181 1250 1182 1251 If 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 compression1188 plugins. Right now LZO plugin is default.1252 which can be found at 1253 \url{http://www.freewrt.org/trac/wiki/Documentation/Specs/FwCf} 1254 1255 If you want to remove all your changes and start your configuration from 1256 scratch, use \command{fwcf erase}. This is also required if you switch between 1257 compression plugins. Right now LZO plugin is default. 1189 1258 1190 1259 \section{IPKG - Packagemanagement} 1191 1260 1192 All software for FreeWRT is available as a IPKG package. IPKG is a package manager1193 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.1261 All software for FreeWRT is available as a IPKG package. IPKG is a package 1262 manager very similar to Debian's \app{dpkg/apt-get} utilities. It is specially 1263 designed for embedded systems and is widely used. The FreeWRT project use a 1264 special version, which is embedded to the busybox binary. Normally the command 1265 line tool \app{ipkg} is pre-installed. 1197 1266 1198 1267 IPKG 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.0repository for your board and kernel version.1268 contains a list of software repositories available via HTTP or FTP. The 1269 configuration file \file{/etc/ipkg.conf} contains the official FreeWRT 1.0 1270 repository for your board and kernel version. 1202 1271 1203 1272 To update the list of available packages execute following command as root: … … 1214 1283 \end{Verbatim} 1215 1284 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 asroot filesystem:1285 This will install the package \app{tcpdump} and all dependencies onto the 1286 flash. Where the data is saved depends on the root filesystem you decided to 1287 use while installing FreeWRT. If you use jffs2 as root filesystem, then the 1288 package is installed on the big linux partition. If you use squashfs-overlay, 1289 then the package is installed on the mini-fo overlay filesystem which writes 1290 its data to the jffs2 data partition. If you use a squashfs-symlinks 1291 filesystem, then the package data is directly install into the jffs2 data 1292 partition, containing symlinks to the read-only squashfs partition. 1293 1294 You can also remove packages, but this is only useful if you are using jffs2 as 1295 root filesystem: 1227 1296 \begin{Verbatim}[label=example removal of \app{tcpdump}] 1228 1297 # ipkg remove tcpdump … … 1230 1299 1231 1300 This 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}. Please1237 \strong{never ever} use \command{ipkg upgrade} to update your embedded system. This command1238 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 1302 filesystem you should never remove any essential packages like \app{busybox}, 1303 \app{fwcf} or \app{uclibc}, otherwise you make the embedded system unusable. 1304 1305 Nearly the same as for removing packages, counts for \command{ipkg upgrade}. 1306 Please \strong{never ever} use \command{ipkg upgrade} to update your embedded 1307 system. This command is only useful to upgrade single packages on a jffs2 1308 rootfilesystem or data partition. 1240 1309 1241 1310 \section{Startup scripts} … … 1243 1312 Some of the available packages containing software which start services at boot 1244 1313 time. 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: 1314 directory \file{/etc/init.d}. See following example for the package 1315 \app{dnsmasq}, a combined dns and dhcp server daemon: 1248 1316 1249 1317 \begin{Verbatim}[label=\file{/etc/init.d/S50dnsmasq}] … … 1275 1343 \end{Verbatim} 1276 1344 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. 1345 After installation the package postinst script will add all needed changes to 1346 the \file{/etc/} directory. For example packages can add new user and groups, 1347 add new variables to \file{/etc/rc.conf} or just add new values to existing 1348 files as \file{/etc/services}. It is FreeWRT policy not to start any services 1349 after installation or in case of a new boot. To start services on bootup you 1350 need to set \code{\$servicename=YES} in \file{/etc/rc.conf} and commit your 1351 changes via \command{fwcf commit}. For every policy exists an exception, we 1352 start all essential services by default, like ssh daemon, syslog and network 1353 initialisation. 1354 1355 For some services you can control the startup behaviour by modifying the 1356 \code{\$servicename\_flags} variable in \file{/etc/rc.conf}. 1357 1358 For example the variable \code{\$ssh\_opts} is provided as an argument to the 1359 dropbear ssh daemon to control its behaviour. 1291 1360 1292 1361 Having 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 system1294 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 a gain. As soon as your are ready with the firewall configuration and you decide1299 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 onbootup.1362 shooting yourself in the foot. For example if you try to realize a firewall 1363 system and trying to set the rules in \file{/etc/firewall.user}, which is read 1364 by \file{/etc/init.d/S45firewall}, if the iptables package is installed. You 1365 can just reload the changed ruleset via \code{/etc/init.d/S45firewall restart}. 1366 If you managed to kick you out of the system, you can just reboot the system 1367 and you gain access again. As soon as your are ready with the firewall 1368 configuration 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 1371 bootup. 1303 1372 1304 1373 … … 1307 1376 \section{Failsafe Mode} 1308 1377 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. 1378 Failsafe mode is very useful if you misconfigured your embedded system, so that 1379 you can not access it anymore. E.g. if you accidentially disabled secure shell 1380 or misconfigured the firewall, so that you can not login any more. 1313 1381 1314 1382 When in failsafe mode, the device won't interpret any networking setup files. … … 1316 1384 set up. It will just set the LAN interface up and give it the IP address 1317 1385 \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 1387 installed SSH daemon). 1319 1388 1320 1389 \subsection{How It Works} 1321 1390 1322 1391 To 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 isavailable 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 usefollowing command:1392 the failsafe utility. The failsafe utility is built inside our ADK and is 1393 available in the directory \file{bin/} after a successful build. 1394 1395 If you just want to compile the tool and not a complete firmware image, use 1396 following command: 1328 1397 1329 1398 \begin{Verbatim}[label=building the failsafe utility for the host system] … … 1341 1410 1342 1411 Connect 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. 1412 cable. Use the failsafe port (in most cases one of the LAN ports), see the 1413 device specific page for the exact network port. 1414 1415 Configure your network interface to the IP address \file{192.168.1.2} with 1416 network mask \file{255.255.255.0}. Now start the failsafe utility on your 1417 computer. 1348 1418 1349 1419 \begin{Verbatim} … … 1375 1445 \subsection{Repairing Your FreeWRT Configuration} 1376 1446 1377 If you want to repair your configuration, you first need to 1378 mount the rootfilesystem read--writeable. This is best done via:1447 If you want to repair your configuration, you first need to mount the root 1448 filesystem read--writeable. This is best done via: 1379 1449 1380 1450 \begin{Verbatim} … … 1395 1465 \end{Verbatim} 1396 1466 1397 If you want to start over with the default \file{/etc/} directory, just remove the fwcf1398 partition content with following command:1467 If you want to start over with the default \file{/etc/} directory, just remove 1468 the fwcf partition content with following command: 1399 1469 1400 1470 \begin{Verbatim} … … 1402 1472 \end{Verbatim} 1403 1473 1404 You can either use \command{reboot -f} or the option \command{-r} for \app{mtd} to reboot the system. 1474 You can either use \command{reboot -f} or the option \command{-r} for \app{mtd} 1475 to reboot the system. 1405 1476 1406 1477 %\section{Serial Console}
Note:
See TracChangeset
for help on using the changeset viewer.
