On 2018-10-26 7:26 p.m., Fred Licht via discuss wrote:
I am not able to find a basic document or instruction on how to best configure 
VLAN translation with OVS.  I would be using the LTS OVS 2.5.5.  Can someone 
point me to some good examples or provide one.
It comes down to these two lines for cli'ing the forward and reverse directions (should be relatively easy to decipher the important bits):

ovs-ofctl add-flow {{ bridge.name }} priority=100,in_port=${VLANA},dl_vlan={{ mapping.a.vlan }},actions=mod_vlan_vid:{{ mapping.z.vlan }},output:${VLANZ} ovs-ofctl add-flow {{ bridge.name }} priority=100,in_port=${VLANZ},dl_vlan={{ mapping.z.vlan }},actions=mod_vlan_vid:{{ mapping.a.vlan }},output:${VLANA}


In the bigger context, these lines are pulled from one of my repositories, it is a SaltStack templated bash script (use with caution):

#!/bin/bash
{% set mapvlans = salt['pillar.get']( 'mapvlans' ) %}
{% if mapvlans is defined %}{% if mapvlans.one2one is defined %}
{% set bridges = mapvlans.one2one %}
{% for bridge in bridges %}
ovs-ofctl del-flows {{ bridge.name }}
{% set mappings = bridge.mappings %}{% for mapping in mappings %}
VLANA=$(ovs-vsctl get Interface {{ mapping.a.port }} ofport)
VLANZ=$(ovs-vsctl get Interface {{ mapping.z.port }} ofport)
ovs-ofctl add-flow {{ bridge.name }} priority=100,in_port=${VLANA},dl_vlan={{ mapping.a.vlan }},actions=mod_vlan_vid:{{ mapping.z.vlan }},output:${VLANZ} ovs-ofctl add-flow {{ bridge.name }} priority=100,in_port=${VLANZ},dl_vlan={{ mapping.z.vlan }},actions=mod_vlan_vid:{{ mapping.a.vlan }},output:${VLANA}
{% endfor %}{# mapping #}
ovs-ofctl add-flow {{ bridge.name }} priority=0,actions=NORMAL
{% endfor %}{# bridges #}
{% endif %}{# one2one #}{% endif %}{# mapvlans #}
exit 0

Raymond Burkholder
https://blog.raymond.burkholder.net





_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to