This blog post has a template iptables rule to forward traffic, to and from the router to another ip address.
iptables -t mangle -A POSTROUTING \
-d [IP to spy on] \
-j ROUTE –tee –gw [IP of wireshark]
iptables -t mangle -A PREROUTING \
-s [IP to spy on] \
-j ROUTE –tee –gw [IP of wireshark]
I have not tested the command since I have no one specific ip that I want to spy on.
I have however attempted the following which seems to be have a syntax issue:
iptables -t mangle -A POSTROUTING \
-j ROUTE –tee –gw [IP of wireshark]
iptables -t mangle -A PREROUTING \
-j ROUTE –tee –gw [IP of wireshark]
With the error:
Try `iptables -h' or 'iptables --help' for more information.
Bad argument `–tee'
Try `iptables -h' or 'iptables --help' for more information.
Bad argument `–tee'
I then found the following post which had no effect: Mirror Port via iptables
End goal, duplicate all traffic, incoming and outgoing, from all sources and all destinations to a specific ip.