What's new

Port mirroring question

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Fredster

New Around Here
Hi,

I am trying to mirror the traffic sent from my weatherstation (on router 1) to a website (Weather Underground), to a Raspberry PI (On router 2).

I found a website that shows how to mirror ALL traffic from router 1 to the IP of the Raspberry PI , using the following commands (Executed on Router 1):

iptables -I PREROUTING -t mangle -j ROUTE --gw 192.168.1.4 --tee
iptables -I POSTROUTING -t mangle -j ROUTE --gw 192.168.1.4 --tee

Unfortunately too much traffic gets sent to the Raspi's IP 192.168.1.4, flooding it an making it unreachable (Forcing me to stop the mirroring).

My question:

How can I modify the commands so that ONLY the outgoing traffic from the weather station to Weather Underground website gets forwarded to my PI (On router 2)

Any help is greatly appreciated!

Fredster
 
You don't give any details on "router 1" or "router 2", but try something like this:
Code:
iptables -t mangle -A PREROUTING  -s 192.168.1.99 -j ROUTE --tee --gw 192.168.1.4
iptables -t mangle -A POSTROUTING -d 192.168.1.99 -j ROUTE --tee --gw 192.168.1.4
Where 192.168.1.99 is the IP address of your weather station.
 
You don't give any details on "router 1" or "router 2", but try something like this:
Code:
iptables -t mangle -A PREROUTING  -s 192.168.1.99 -j ROUTE --tee --gw 192.168.1.4
iptables -t mangle -A POSTROUTING -d 192.168.1.99 -j ROUTE --tee --gw 192.168.1.4
Where 192.168.1.99 is the IP address of your weather station.

Hi Colin!

Works like a charm! The PI is reachable again using these lines instead!

Thank you very much for your quick answer!

Fredster
 
You don't give any details on "router 1" or "router 2", but try something like this:
Code:
iptables -t mangle -A PREROUTING  -s 192.168.1.99 -j ROUTE --tee --gw 192.168.1.4
iptables -t mangle -A POSTROUTING -d 192.168.1.99 -j ROUTE --tee --gw 192.168.1.4
Where 192.168.1.99 is the IP address of your weather station.

Nice - not really port mirroring, but it gets the job done... and probably a better approach.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top