2 # $Id: README 4396 2009-12-09 21:52:46Z luigi $
5 This directory contains a port of ipfw and dummynet to Linux and OpenWrt
6 (including PlanetLab). A Windows version is in the works but not ready yet.
7 Building the code produces:
9 a kernel module, ipfw_mod.ko
10 a userland program, /sbin/ipfw
12 The source code here comes straight from FreeBSD (roughly the
13 version in RELENG_7 and HEAD as of December 2009), plus some glue code
14 and headers written from scratch.
15 Unless specified otherwise, all the code here is under a BSD license.
17 =================== BUILD INSTRUCTIONS ==========================
19 ***** Linux 2.6.x ******
21 make KERNELPATH=/path/to/linux USRDIR=/path/to/usr
23 where the two variables are optional an point to the linux kernel
24 sources and the /usr directory. Defaults are USRDIR=/usr and
25 KERNELPATH=/lib/modules/`uname -r`/build --- XXX check ?
27 NOTE: make sure CONFIG_NETFILTER is enabled in the kernel
28 configuration file. You can enable it by doing
30 "(cd ${KERNELPATH}; make menuconfig)"
32 and enabling the option listed below:
35 Networking options --->
36 [*] Network packet filtering framework (Netfilter)
39 ***** Linux 2.4.x *****
41 Almost as above, with an additional VER=2.4
43 make VER=2.4 KERNELPATH=...
45 You need to follow the same instruction for the 2.6 kernel, enabling
46 netfilter in the kernel options:
48 Networking options --->
49 [*] Network packet filtering (replaces ipchains)
51 ***** Openwrt package *****
53 (Tested with kamikaze_8.09.1 and Linux 2.4)
55 + Download and extract the OpenWrt package, e.g.
57 wget http://downloads.openwrt.org/kamikaze/8.09.1/kamikaze_8.09.1_source.tar.bz2
58 tar xvjf kamikaze_8.09.1_source.tar.bz2
60 + "cd" to the directory with the OpenWrt sources (the one that
61 contains Config.in, rules.mk ...)
65 + Optional: to be sure that the tools are working, make a first
66 compilation as follows:
68 - run "make menuconfig" and set the correct target device,
70 - run "make" to do the build
72 + Add ipfw2 to the openwrt package, as follows:
74 - fetch and extract the code e.g.
77 wget http://info.iet.unipi.it/~luigi/dummynet/ipfw_linux-20090724.tgz;\
78 tar xvzf ipfw_linux-20090724.tgz; mv ipfw_linux-20090724 ipfw_mod;)
80 (but you should have done it already)
82 - run the following commands:
84 cp ../ipfw_linux/Makefile.openwrt package/ipfw2/Makefile)
86 to create the package/ipfw2 directory in the OpenWrt source
87 directory, and copy Makefile.openwrt to package/ipfw2/Makefile:
89 - if necessary, edit package/ipfw2/Makefile and set IPFW_DIR to point to
90 the directory with the ipfw sources (the directory
91 which contains this README, dummynet/ ipfw/ and so on);
93 - run "make menuconfig" and select ipfw2 as a module <M> in
94 Kernel Modules -> Other modules -> ipfw2
96 - run "make" to build the package, "make V=99" for verbose build.
98 The resulting package is located in bin/packages/mipsel/kmod-ipfw2*,
99 upload the file and install on the target system, as follows:
101 opkg install kmod-ipfw2_2.4.35.4-brcm-2.4-1_mipsel.ipk #install
102 ls -l ls -l /lib/modules/2.4.35.4/ipfw* # check
103 insmod /lib/modules/2.4.35.4/ipfw_mod.o # load the module
104 /lib/modules/2.4.35.4/ipfw show # launch the userspace tool
105 rmmod ipfw_mod.o # remove the module
107 ***** PLANETLAB BUILD *****
109 -----------------------------------------------------------------------------