[ovs-discuss] How to configure port mirroring with RSPAN

Ben Pfaff blp at nicira.com
Fri Jul 27 05:27:50 UTC 2012


On Fri, Jul 27, 2012 at 11:00:35AM +0800, Kris zhang wrote:
> Hi
> 
> I have a question about RSPAN, so i only find the following descriptin in
> vsctl manual page:
> 
> *Port Mirroring*
> *Mirror all packets received o r sent on eth0 or eth1 onto eth2, assuming
> that all of those ports exist on*
> *bridge br0 (as a side-effect this causes any packets received on eth2 to
> be ignored):*
> *ovs-vsctl -- set Bridge br0 mirrors=@m \*
> *-- --id=@eth0 get Port eth0 \*
> *-- --id=@eth1 get Port eth1 \*
> *-- --id=@eth2 get Port eth2 \*
> *-- --id=@m create Mirror name=mymirror select-dst-port=@eth0, at eth1
> select-srcport=@eth0, at eth1 output-port=@eth2*
> 
> there is no any vlan in above command, and in ovs-vswitchd.conf.db.5, there
> is an *output_vlan* in mirror table, but i still confuse how to setup
> RSPAN, so could u please give me a simple example?

Q: How do I configure a VLAN as an RSPAN VLAN, that is, enable
   mirroring of all traffic to that VLAN?
       
A: The following commands configure br0 with eth0 as a trunk port and
   tap0 as an access port for VLAN 10.  All traffic coming in or going
   out on tap0, as well as traffic coming in or going out on eth0 in
   VLAN 10, is also mirrored to VLAN 15 on eth0:

       ovs-vsctl add-br br0
       ovs-vsctl add-port br0 eth0
       ovs-vsctl add-port br0 tap0 tag=10
       ovs-vsctl \
           -- --id=@m create mirror name=m0 select-vlan=10 output-vlan=15 \
           -- set bridge br0 mirrors=@m

   (If you omit select-vlan=10, then all traffic on any VLAN, except
   VLAN 15, will be mirrored to VLAN 15.  This is possibly confusing
   because the packets' original VLANs cannot be determined.)

   To later disable mirroring, run:

       ovs-vsctl clear bridge br0 mirrors

   Mirroring to a VLAN can disrupt a network that contains unmanaged
   switches.  See ovs-vswitchd.conf.db(5) for details.  Mirroring to a
   GRE tunnel has fewer caveats than mirroring to a VLAN and should
   generally be preferred.



More information about the discuss mailing list