OcNOS-SP : Ansible Guide : Ansible User Guide : VPWS Configuration
VPWS Configuration
Template File for VPWS
ocnos_vpws.j2
{% if VPWS.pseudowire is defined %}
{% for vpws in VPWS.pseudowire -%}
mpls l2-circuit {{ vpws.vc_name }} {{ vpws.vc_id }} {{ vpws.peer }}
{% endfor %}
{% for template in VPWS.service_template -%}
service-template {{ template.name}}
{% if template.vlan is defined %}
match outer-vlan {{ template.vlan }}
{% endif %}
{% if template.operation is defined %}
{% if template.operation == "pop" %}
rewrite ingress {{ template.operation }} outgoing-tpid {{ template.tpid }}
{% endif %}
{% if template.operation == "translate" %}
rewrite ingress {{ template.operation }} {{ template.translate_vlan }} outgoing-tpid {{template.tpid }}
{% endif %}
{% endif %}
!
{% endfor %}
{% for interface in VPWS.interfaces -%}
interface {{ interface.name }}
switchport
{% for binding in interface.vpws_binding -%}
mpls-l2-circuit {{ binding.instance}} service-template {{binding.service_template}}
{% endfor %}
!
{% endfor %}
{% endif %}
 
Sample Parameter File for VPWS
sw2.yml
 
VPWS:
VPWS configurations
pseudowire:
Pseudowire(PW) instance configuration
- vc_name: vpws
Configures the name of PW as vpws
vc_id: 1
Configures the PW id as 1
peer: 36.0.0.8
Configures PW peer id as 36.0.0.8
- vc_name: vpws-2
Configures the name of PW as vpws-2
vc_id: 2
Configures the PW id as 2
peer: 10.0.1.14
Configures PW peer id as 10.0.1.14
service_template:
Service-template configuration
- name: vpws
Configure service-template name as vpws
vlan: 555
Configure match-outer vlan as vlan-id 555 under service-template vpws
operation: pop
Configure rewrite ingress operation as pop under service-template vpws
tpid: dot1.q
Configure outgoing tpid as dot1.q under service-template vpws
- name: vpws-2
Configure service-template name as vpws-2
vlan: 600
Configure match-outer vlan as vlan-id 600 under service-template vpws
interfaces:
Interface configuration
- name: xe20
Configure interface xe20 command
vpws_binding:
Configuration to bing vpws instance with service -template
- instance: vpws
Configure the binding of instance name vpws
service_template: vpws
Configure the vpws binding with service-template vpws under interface
- instance: vpws-2
Configure the binding of instance name vpws-2
service_template: vpws-2
Configure the vpws binding with service-template vpws -2 under interface
Last modified date: 06/08/2023