[ovs-discuss] Is it possible to terminate ERSPAN in OVS?
Gregory Rose
gvrose8192 at gmail.com
Tue Nov 5 17:21:32 UTC 2019
On 11/1/2019 4:04 PM, William Tu wrote:
> On Thu, Oct 31, 2019 at 9:44 AM Ben Pfaff <blp at ovn.org> wrote:
>> On Thu, Oct 31, 2019 at 04:34:14PM +0000, Bryan T. Richardson wrote:
>>> On Thu, Oct 31, 2019 at 09:27:19AM -0700, Ben Pfaff wrote:
>>>> On Wed, Oct 30, 2019 at 11:23:37PM +0000, Bryan T. Richardson wrote:
>>>>> From the documentation located at
>>>>> http://docs.openvswitch.org/en/latest/faq/configuration/ it's obvious
>>>>> that, based on the example the answer to the question "Does Open vSwitch
>>>>> support ERSPAN?", OVS can create an ERSPAN connection to another switch
>>>>> and mirror packets over the connection. However, what's not clear is
>>>>> whether or not OVS can act as the receiver switch, ie. terminate the
>>>>> ERSPAN GRE tunnel, decapsulate the packets, and mirror them to a local
>>>>> OVS port.
>>>> Yes, use a port of type "erspan". ovs-vswitchd.conf.db(5) describes the
>>>> available options, and ovs-fields(7) describes the fields. This support
>>>> was added in version 2.10.
>>> Great, thanks Ben! I'll start digging into the docs you suggested to see
>>> if I can figure it out. Any chance you could provide a simple
>>> configuration example here?
>> I think a minimal configuration would just include the remote IP
>> address, like other OVS tunnels. You can find some examples in the
>> TUNNEL FIELDS section of ovs-fields(7).
> Hi Bryan,
>
> There is also an doc here section 3.2.
> http://vger.kernel.org/lpc_net2018_talks/erspan-linux.pdf
>
> William
> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
Here is a script I use for ERSPAN type I:
if [ "$#" -ne 4 ]; then
echo "Usage: add-erspan-type1 <name> <remote_ip> <key> <erspan_idx>"
exit 1
fi
ovs-vsctl add-port br0 $1 -- set int $1 \
type=erspan options:remote_ip=$2 \
options:key=$3 \
options:erspan_ver=1 options:erspan_idx=$4
And here is a script I use for ERSPAN type II:
if [ "$#" -ne 5 ]; then
echo "Usage: add-erspan-type2 <name> <remote_ip> <key> <dir> <hwid>"
exit 1
fi
ovs-vsctl add-port br0 $1 -- set int $1 type=erspan \
options:remote_ip=$2 options:key=$3 \
options:erspan_dir=$4 options:erspan_hwid=$5 \
options:erspan_ver=2 options:tos=inherit
Hope that helps.
- Greg
More information about the discuss
mailing list