netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: thomas yang <lampsu@gmail.com>
To: hadi@cyberus.ca
Cc: netdev@vger.kernel.org
Subject: Re: [iproute2] tc action mirred question
Date: Tue, 8 Sep 2009 21:50:29 +0800	[thread overview]
Message-ID: <f4f837ab0909080650t343efbmeb2f121def40bd9f@mail.gmail.com> (raw)
In-Reply-To: <1252376168.5244.11.camel@dogo.mojatatu.com>

2009/9/8 jamal <hadi@cyberus.ca>:
> On Mon, 2009-09-07 at 09:05 -0700, Xiaofei Wu wrote:
>
>> (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?
>
> Yes, you can achieve it with pedit;
>
>
>> (or use other tools to modify the dst MAC, please give me more information)
>>
>
> it is as usable as u32 is - you have to know your offsets
> example, here's something done on an incoming packet:
> =-=
> #Note:
> #dst MAC starts at -14
> #src MAC at -8
> #ethertype at -2
> #
> tc filter add dev eth1 parent ffff: protocol ip prio 10 u32 \
> match ip src 192.168.2.11/32 flowid 1:2 \
> action pedit munge offset -14 u16 set 0x0000 \
> munge offset -12 u32 set 0x00000200 \
> munge offset -8 u32 set 0x0aaf0100 \
> munge offset -4 u32 set 0x0008eb06 pipe \
> action mirred egress redirect dev eth0


He want to route the mirroring packets.

" - Mirror takes a copy of the packet and sends it to specified
 dev ("port" in ethernet switch/bridging terminology)
 - redirect
 steals the packet and redirects to specified destination dev. "

So,'mirror' is different from 'redirect'.  Change the line 'action
mirred egress redirect dev eth0' to 'action mirred egress mirror dev
eth0' .
Both 'mirror' and 'redirect'  can transmit the packets to otner node,
but mirror make a copy, then transmit it;  redirect steals the packet,
right  ?


--
regards,
thomas

  reply	other threads:[~2009-09-08 13:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4f837ab0909080650t343efbmeb2f121def40bd9f@mail.gmail.com \
    --to=lampsu@gmail.com \
    --cc=hadi@cyberus.ca \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).