-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request #61.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
Cross-compiling and packages for openwrt | ||
=== | ||
|
||
Place Makefile in `packages/network/ipt-netflow` directory in OpenWRT bouldroot. | ||
Run `make menuconfig` and select package in Network/Netflow menu. Configure args partially supported. | ||
|
||
Run `make` to build full firmware or `make package/network/ipt-netflow/{clean,prepare,configure,compile,install}` to rebuild packages. | ||
|
||
To make git version uncomment two lines in Makefile. | ||
|
||
Tested to work on Chaos Calmer and Designated Driver with Atheros AR7xxx/AR9xxx target. | ||
|
||
For ipt-netflow 2.2 patches are needed, drop it for next version or git master to build. | ||
|
||
Making and installilng | ||
=== | ||
|
||
```shell | ||
mkdir debian-toolchain | ||
sudo debootstrap jessie debian-toolchain | ||
sudo chroot debian-toolchain | ||
|
||
. /etc/profile | ||
apt update | ||
apt install git ssh-client build-essential mercurial subversion \ | ||
binutils flex bzip2 asciidoc ncurses-dev libssl-dev gawk zlib1g-dev fastjar | ||
|
||
adduser user | ||
su user | ||
. /etc/profile | ||
cd ~ | ||
|
||
git clone https://github.com/openwrt/openwrt.git openwrt-trunk | ||
git clone https://github.com/aabc/ipt-netflow.git | ||
|
||
cd openwrt-trunk | ||
./scripts/feeds update -a | ||
ln -s ~/ipt-netflow/openwrt/ package/network/ipt-netflow | ||
|
||
|
||
make menuconfig | ||
#select target and device | ||
#go to network/netflow and check both | ||
|
||
make | ||
#and go for dinner or a walk ;) | ||
#after five hours | ||
|
||
scp bin/ar71xx/packages/kernel/kmod-ipt-netflow_4.4.14+2.2-2_ar71xx.ipk \ | ||
[email protected]:/tmp/ | ||
scp bin/ar71xx/packages/base/iptables-mod-netflow_2.2-2_ar71xx.ipk \ | ||
[email protected]:/tmp/ | ||
scp bin/ar71xx/packages/base/kernel_4.4.14-1-abf9cc6feb410252d667326556dae184_ar71xx.ipk \ | ||
[email protected]:/tmp/ | ||
|
||
#goto router | ||
ssh [email protected] | ||
|
||
opkg install /tmp/*.ipk | ||
|
||
insmod /lib/modules/4.4.14/ipt_NETFLOW.ko | ||
sysctl -w net.netflow.protocol=5 | ||
sysctl -w net.netflow.destination=192.168.236.34:2055 | ||
|
||
iptables -I FORWARD -j NETFLOW | ||
iptables -I INPUT -j NETFLOW | ||
iptables -I OUTPUT -j NETFLOW | ||
|
||
``` |