exit all
configure qos sap-ingress ${ingqos.id} create
exit all
configure qos sap-ingress ${ingqos.id} description "${ingqos.description}"
configure qos sap-ingress ${ingqos.id} queue 1 create
exit all
configure qos sap-ingress ${ingqos.id} queue 2 create
exit all
configure qos sap-ingress ${ingqos.id} queue 2 rate max cir ${ingqos.bandwidth?string.computer}000
configure qos sap-ingress ${ingqos.id} queue 11 multipoint create
exit all
configure qos sap-ingress ${ingqos.id} fc "ef" create
exit all
configure qos sap-ingress ${ingqos.id} fc "ef" queue 2
exit all
configure qos sap-ingress ${ingqos.id} default-fc ef
configure qos sap-ingress ${ingqos.id} default-priority high

exit all


<#if paths??>
# mpls path
<#list paths as path>
configure router mpls path "${path.name}" shutdown
<#list path.hops as hop>
configure router mpls path "${path.name}" hop ${hop.order} ${hop.address} strict
</#list>
configure router mpls path "${path.name}" no shutdown
</#list>
</#if>



<#if lsps??>
# mpls LSP
<#list lsps as lsp>
configure router mpls lsp "${lsp.name}" shutdown
configure router mpls lsp "${lsp.name}" from ${lsp.from} 
configure router mpls lsp "${lsp.name}" to ${lsp.to} 
configure router mpls lsp "${lsp.name}" primary "${lsp.path}" priority 4 4
configure router mpls lsp "${lsp.name}" no shutdown
</#list>
</#if>

<#if sdps??>
<#list sdps as sdp>
# service distribution point - forwards packets to the MPLS tunnel
configure service sdp ${sdp.id} mpls create
exit all
configure service sdp ${sdp.id} shutdown
configure service sdp ${sdp.id} description "${sdp.description}"
configure service sdp ${sdp.id} far-end ${sdp.far_end}
configure service sdp ${sdp.id} lsp "${sdp.lsp_name}"
configure service sdp ${sdp.id} keep-alive shutdown
configure service sdp ${sdp.id} no shutdown
exit all
</#list>
</#if>


# vpls service
configure service vpls ${vpls.id} customer 1 create
exit all
configure service vpls ${vpls.id} shutdown
configure service vpls ${vpls.id} description "${vpls.description}"
configure service vpls ${vpls.id} service-mtu 9114
configure service vpls ${vpls.id} fdb-table-size 4096
configure service vpls ${vpls.id} stp shutdown
exit all

# saps
<#list ifces as ifce>
configure service vpls ${vpls.id} sap ${ifce.name}:${ifce.vlan} create
exit all
configure service vpls ${vpls.id} sap ${ifce.name}:${ifce.vlan} shutdown
configure service vpls ${vpls.id} sap ${ifce.name}:${ifce.vlan} description "${vpls.description}"
configure service vpls ${vpls.id} sap ${ifce.name}:${ifce.vlan} ingress qos ${ingqos.id}
configure service vpls ${vpls.id} sap ${ifce.name}:${ifce.vlan} no shutdown
</#list>


<#if sdps??>
# vpls sdps
<#list sdps as sdp>
configure service vpls ${vpls.id} mesh-sdp ${sdp.id}:${vpls.id} vc-type vlan create
exit all
configure service vpls ${vpls.id} mesh-sdp ${sdp.id}:${vpls.id} no shutdown
exit all
</#list>
</#if>

configure service vpls ${vpls.id} no shutdown

admin rollback save
admin save
