netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [iproute2] tc action mirred    question
@ 2009-09-07 16:05 Xiaofei Wu
  2009-09-08  2:16 ` jamal
  0 siblings, 1 reply; 21+ messages in thread
From: Xiaofei Wu @ 2009-09-07 16:05 UTC (permalink / raw)
  To: hadi; +Cc: linux netdev


I am a newbie for 'traffic control' and Linux networking. So I ask some experts here  to help me.
Maybe my questions are stupid. But I hope I can get your reply. Thank you!


>> I just want to know:
>> 1) Could I forward the mirroring packets to another node ,and then route it to the destination(if I use 
>> iproute2 (ip, tc ...)  )?  I described my purpose in my last email.

>Yes, you can mirror to another node(B/D). To route on that node(B/D),
>your dst MAC address has to be correct for that destination node(B/D) to
>accept it. You could try to run  the destination node in promisc mode
>and you may be able to get away without changing dst mac.

(1) Could I use  pedit action to modify the dst MAC, so the destination node D will accept it, then forward it to 
node C?  (or use other tools to modify the dst MAC, please give me more information)

(2) If I use 'ifconfig wlan0 promisc ... ' on node D, would it route the mirroring packets (the dst MAC is incorrect)
to node C?


>> 2)  After I mirrored the packets, I should use 'ip route' , 'ip rule' to modify route tables.  Is this right?
>> 

>Assuming you are talking about B/D, yes you can do routing there if the
>node accepts it..


Regards,
Wu



      

^ permalink raw reply	[flat|nested] 21+ messages in thread
* [iproute2] tc action mirred    question
@ 2009-09-06 17:13 Xiaofei Wu
  2009-09-06 18:13 ` jamal
  0 siblings, 1 reply; 21+ messages in thread
From: Xiaofei Wu @ 2009-09-06 17:13 UTC (permalink / raw)
  To: linux netdev; +Cc: hadi

Hi,

I have something to ask.

I construct a network like this:

/A\
B   D
\C/

All of the nodes(A, B, C, D) have two wireless cards (wlan0, wlan1).  A-B, B-C, A-D, D-C are wireless links.

Node A wnats to transmit packets with node C. Because the wireless links are not very reliable, I want to forward the same packet through A-B-C and A-D-C simultaneously. 
How to achieve my purpose?


Stephen Hemminger  said,
>Not sure what the best solution would be, but you could investigate
>using the 'tc filter mirred' action. Essentially, the traffic control
>command allows putting filters on output (or input) that can be used
>to do things like mirror packets.
>

On node A,
wlan0, IP address 192.168.1.1/24 ; wlan1, IP address 192.168.2.1/24
I use command 'tc filter add dev wlan0 ... match ip src 192.168.1.0/24 ...
action mirred egress mirror dev wlan1' to mirror packets.
When I use 'tcpdump -i wlan1', I can 'see' the packets  'A(wlan0)->B' (node B will forward them to C). How to forward the mirroring packets 'A(wlan1)' to D (then, node D forwards them to C) ?




Regards,
Wu



      

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-09-20 13:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-07 16:05 [iproute2] tc action mirred question Xiaofei Wu
2009-09-08  2:16 ` jamal
2009-09-08 13:50   ` thomas yang
2009-09-08 14:10     ` jamal
2009-09-08 14:35       ` thomas yang
2009-09-09 13:12   ` Xiaofei Wu
2009-09-09 22:11     ` jamal
2009-09-10  6:06       ` Xiaofei Wu
2009-09-11 12:25         ` jamal
2009-09-11 18:45           ` Xiaofei Wu
2009-09-11 21:28             ` jamal
2009-09-12 16:01               ` Xiaofei Wu
2009-09-12 21:49                 ` jamal
2009-09-14 13:44               ` Xiaofei Wu
2009-09-16 12:28                 ` jamal
2009-09-20  9:58                   ` Xiaofei Wu
2009-09-20 13:33                     ` jamal
  -- strict thread matches above, loose matches on Subject: below --
2009-09-06 17:13 Xiaofei Wu
2009-09-06 18:13 ` jamal
2009-09-07 12:38   ` Xiaofei Wu
2009-09-07 12:54     ` jamal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).