can sniffed packets be forwarded to a different network?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
can sniffed packets be forwarded to a different network?
Hi,
I'm using madwifi linux driver (ath1) in monitor mode to capture some wireless traffic.
I can see that all wireless traffic is coming well through the wireless interface (checked using TCPDUMP).
What I want to know is how I can forward the captured wireless packets to a different Ethernet interface (e.g. eth2) in the same machine to send those captured packet out to a different computer.
I set 1 for /proc/sys/net/ipv4/ip_forward
for iptables, I tried this rule: iptables -A FORWARD -i ath1 -o eth2 -j ACCEPT
However, I coudn't read any packet from eth2 via TCPDUMP.
I think I'm missing some important things to do this.
Could you please give me a direction? It would be really appreciated.
corp769;
Thanks for your comment. But I don't understand your comment because I'm new on iptables.
Did you mean that I need to use NAT? and could you let me know why prerouting is needed before forwarding?
To make my problem simple, I tested this simple case with iptables.
There are three nodes: a wireless node, an AP and a server.
client ---------(wireless)--------- AP -------(Ethernet)--------- server
Using iperf, client send udp or tcp packets to a server via an AP.
I run another iperf server on AP and I try to intercept the udp iperf traffic by setting the rule of iptables with "iptables -t nat -A PREROUTING -p udp -d server_IP -j DNAT --to AP_IP".
This works fine.
However, here is my problem.
I added one sniffer which has a wireless interface with monitor mode.
client ---------(wireless)--------- AP -------(Ethernet)--------- server
|
|
(wireless)
|
|
sniffer
If Iperf on client send udp traffic to the server, I can see that UDP traffic is captured in the wireless interface on the sniffer (using TCPDUMP).
And I also tried same thing as what I did on the AP in the first case.
By setting the iptables rule with "iptables -t nat -A PREROUTING -p udp -d server_IP -j DNAT --to SNIFFER_IP", I ran iperf on the sniffer, the Iperf on sniffer couldn't receive any packets.
Do I need to do extra work for iptables or something else?
I set the wireless interface of the sniffer with monitor mode. And I checked packets are captured.
Is there any flag or bit setting that let other protocol layers know that this packet was not originally for this node so that the packets are dropped before iptables rule is applied?
I set the wireless interface of the sniffer with monitor mode. And I checked packets are captured.
Is there any flag or bit setting that let other protocol layers know that this packet was not originally for this node so that the packets are dropped before iptables rule is applied?
Thanks,
JK
As far as what? Being in monitor mode, you can sniff the packets for security testing using a program like wireshark, etc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.