LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to copy packet to another network card? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-copy-packet-to-another-network-card-747776/)

farkeu 08-15-2009 11:52 AM

How to copy packet to another network card?
 
Hi!

Is there any way that can copy packets from a network card to another network card in a PC? Don't tell me use a hub, I need to this in software way in a PC!

For example, when wlan0 received a packet, how to copy that packet to wlan1, pretends it's wlan1 received that packet???

I already wrote a TARGET module for iptables to change IP destination.
For example, if wlan0 is 192.168.0.1, wlan1 is 192.168.1.1, I change every packets' (arrive at wlan0) IP destination to 192.168.1.1, but it's not working!! wlan1 didn't receive anything(checksum is correct). I check /proc/sys/net/ipv4/ip_forward is 1.

Could someone give me a hand? Thanks!:hattip:

jschiwal 08-16-2009 09:51 PM

Do you have two or more computers, one with wireless, and want to give the others wireless access by routing the traffic on the first computer?
Could you please give a more general description on what you are trying to accomplish.

farkeu 08-17-2009 02:09 AM

Thanks for your respond :)

What I doing is: I split a video stream into 2 path(load sharing), 1st path end at wlan0, 2nd end at wlan1, wlan0 and wlan1 are in the same PC. But I can't combine these 2 stream together, because the video looks not smooth.

So, I try to copy wlan1's packet to wlan0, is there any way can do that?

Thank for help!

jschiwal 08-18-2009 07:34 AM

Look up bonding on Google. Both ends need to be configured for it and any switches & routers in between. You would be better off using gigabit NICs & switch. The CPU playing the stream may simply not be able to handle the video, in which case, bonding won't help.

I don't know if a bonded interface would split the traffic for a single connection or equalize different connections.

farkeu 08-20-2009 04:39 AM

Hey! You inspire me! Thanks to you all! :hattip:
I find out iptables extensions ROUTE target patch can do this job!
Now everything works perfect now!
Thanks~ :)

jschiwal 08-20-2009 04:47 AM

Thank you for the feedback.


All times are GMT -5. The time now is 05:45 PM.