openwrt using iptables with tee seems broken

1

I've been trying to set up port mirroring on openwrt version 14.07 following this guide:

however the command:

$iptables -t mangle -A POSTROUTING  -o br-lan ! -s 192.168.0.0/16 -j TEE --gateway 192.168.1.254

produces the following error:

$iptables: No chain/target/match by that name.

Doe's anyone have any idea how to solve this?

Thanks

GelosSnake

Posted 2015-07-05T19:54:00.180

Reputation: 111

Answers

1

To me the above command seems perfectly fine, except for the position of the NOT (=!) operator:

 $iptables -t mangle -A POSTROUTING  -o br-lan -s ! 192.168.0.0/16 -j TEE --gateway 192.168.1.254

EDIT:

If it still does not work, that's because you are missing some of the iptables modules. You can find them here, it is imposisble for me to know which one you are missing, you may wish to try them out. You will surely need

    insmod ipt_route 

for the above iptables command to work, plus, like I said, perhaps more.

Should this all fail, this Googl Code page presents an easy alternative to doing it with iptables.

MariusMatutiae

Posted 2015-07-05T19:54:00.180

Reputation: 41 321

typing the like yours i get: '$ Bad argument `192.168.0.0/16'' – GelosSnake – 2015-07-05T21:02:57.747

@SnakeByte Please see my edit. – MariusMatutiae – 2015-07-05T21:33:00.973

sadly even went so far as install of iptables packages. still can't run 'code' insmod ipt_route : $Failed to find ipt_route. Maybe it is a built in module ? – GelosSnake – 2015-07-05T21:46:55.973

I did try running port-mirroring before coming here, it was not very successful: $port-mirroring: can't load library 'libpcap.so.1.1' libpcap is installed properly though – GelosSnake – 2015-07-05T21:50:26.613