November 24, 2015

Openwrt iptables add NFQUEUE support

opkg install kmod-nfnetlink_3.10.49-1_ar71xx.ipk
opkg install kmod-nfnetlink-queue_3.10.49-1_ar71xx.ipk
opkg install kmod-ipt-nfqueue_3.10.49-1_ar71xx.ipk
opkg install iptables-mod-nfqueue_1.4.21-1_ar71xx.ipk
modprobe xt_NFQUEUE

modprobe nfnetlink_queue
(the last command automatically loads nfnetlink module)

Application program will need the following libraries:

libmnl_1.0.3-1_ar71xx.ipk
libnfnetlink_1.0.1-1_ar71xx.ipk

libnetfilter_queue.so.1 (libnetfilter_queue in openwrt 14.07 seems to be in the "old" package directory. You can build your own).



Then you can direct desired traffic to the user space's queue application using iptables:

 iptables -A OUTPUT -p TCP --dport 54321 -j NFQUEUE

Queue application has to be running. Otherwise, packet will stop flowing.

No comments:

Post a Comment