|
| 1 | +Cross-compiling and packages for openwrt |
| 2 | +=== |
| 3 | + |
| 4 | +Place Makefile in `packages/network/ipt-netflow` directory in OpenWRT bouldroot. |
| 5 | +Run `make menuconfig` and select package in Network/Netflow menu. Configure args partially supported. |
| 6 | + |
| 7 | +Run `make` to build full firmware or `make package/network/ipt-netflow/{clean,prepare,configure,compile,install}` to rebuild packages. |
| 8 | + |
| 9 | +To make git version uncomment two lines in Makefile. |
| 10 | + |
| 11 | +Tested to work on Chaos Calmer and Designated Driver with Atheros AR7xxx/AR9xxx target. |
| 12 | + |
| 13 | +For ipt-netflow 2.2 patches are needed, drop it for next version or git master to build. |
| 14 | + |
| 15 | +Making and installilng |
| 16 | +=== |
| 17 | + |
| 18 | +```shell |
| 19 | +mkdir debian-toolchain |
| 20 | +sudo debootstrap jessie debian-toolchain |
| 21 | +sudo chroot debian-toolchain |
| 22 | + |
| 23 | +. /etc/profile |
| 24 | +apt update |
| 25 | +apt install git ssh-client build-essential mercurial subversion \ |
| 26 | + binutils flex bzip2 asciidoc ncurses-dev libssl-dev gawk zlib1g-dev fastjar |
| 27 | + |
| 28 | +adduser user |
| 29 | +su user |
| 30 | +. /etc/profile |
| 31 | +cd ~ |
| 32 | + |
| 33 | +git clone https://github.com/openwrt/openwrt.git openwrt-trunk |
| 34 | +git clone https://github.com/aabc/ipt-netflow.git |
| 35 | + |
| 36 | +cd openwrt-trunk |
| 37 | +./scripts/feeds update -a |
| 38 | +ln -s ~/ipt-netflow/openwrt/ package/network/ipt-netflow |
| 39 | + |
| 40 | + |
| 41 | +make menuconfig |
| 42 | + #select target and device |
| 43 | + #go to network/netflow and check both |
| 44 | + |
| 45 | +make |
| 46 | + #and go for dinner or a walk ;) |
| 47 | + #after five hours |
| 48 | + |
| 49 | +scp bin/ar71xx/packages/kernel/kmod-ipt-netflow_4.4.14+2.2-2_ar71xx.ipk \ |
| 50 | + root@192.168.236.79:/tmp/ |
| 51 | +scp bin/ar71xx/packages/base/iptables-mod-netflow_2.2-2_ar71xx.ipk \ |
| 52 | + root@192.168.236.79:/tmp/ |
| 53 | +scp bin/ar71xx/packages/base/kernel_4.4.14-1-abf9cc6feb410252d667326556dae184_ar71xx.ipk \ |
| 54 | + root@192.168.236.79:/tmp/ |
| 55 | + |
| 56 | + #goto router |
| 57 | +ssh root@192.168.236.79 |
| 58 | + |
| 59 | +opkg install /tmp/*.ipk |
| 60 | + |
| 61 | +insmod /lib/modules/4.4.14/ipt_NETFLOW.ko |
| 62 | +sysctl -w net.netflow.protocol=5 |
| 63 | +sysctl -w net.netflow.destination=192.168.236.34:2055 |
| 64 | + |
| 65 | +iptables -I FORWARD -j NETFLOW |
| 66 | +iptables -I INPUT -j NETFLOW |
| 67 | +iptables -I OUTPUT -j NETFLOW |
| 68 | + |
| 69 | +``` |
0 commit comments