LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   iptables Command (https://www.linuxquestions.org/questions/linux-newbie-8/iptables-command-4175635306/)

Squidbillies 07-30-2018 08:36 PM

iptables Command
 
I'm trying to duplicate packets from that are going to one IP on my network and send them to another IP. I have an ASUS router and I can terminal into it using Putty. I run the following commands and I receive error "iptables: No chain/target/match by that name." I've double-checked the IP addresses and they are correct. From what I've been able to gather, this should duplicate all packets from 192.168.128.40 and send them to 192.168.128.143.
Code:

iptables -t mangle -A PREROUTING -d 192.168.128.40 -j TEE --gateway 192.168.128.143
iptables -t mangle -A PREROUTING -s 192.168.128.40 -j TEE --gateway 192.168.128.143


berndbausch 07-30-2018 10:00 PM

The error indicates that you don't have the TEE extension.

On my Fedora 28:
Code:

$ modinfo xt_TEE
filename:      /lib/modules/3.10.107-190/kernel/net/netfilter/xt_TEE.ko
alias:          ip6t_TEE
...

I guess that's missing on your box.

Squidbillies 07-31-2018 06:09 AM

It appears that the commands below work for some reason. I don't understand Linux or this command enough to know why. I just dug around the internet and finally was able to put these together.

Code:

iptables -t mangle -I PREROUTING -s 192.168.128.40 -j ROUTE --gw 192.168.128.143 --tee
iptables -t mangle -I POSTROUTING -d 192.168.128.40 -j ROUTE --gw 192.168.128.143 --tee



All times are GMT -5. The time now is 08:23 AM.