Skip to content

Commit

Permalink
Create openwrt/Readme.md
Browse files Browse the repository at this point in the history
Pull request #61.
  • Loading branch information
alex-eri authored and aabc committed Mar 10, 2017
1 parent c230a88 commit a005335
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions openwrt/Readme.md
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

```

0 comments on commit a005335

Please sign in to comment.