[英]allow a range of vlans NSO CISCO
I'm trying to build L2VPN service in which we need to allow a range of vlans in the customer side.我正在尝试构建 L2VPN 服务,其中我们需要在客户端允许一系列 vlan。 The configuration is as follow:配置如下:
device {
name ME0
data interface GigabitEthernet0/2
no switchport
service instance 2 ethernet
encapsulation dot1q 2-10,60
bridge-domain 2
exit
no shutdown
exit
}
The xml template is as follow:
result-xml <devices xmlns="http://tail-f.com/ns/ncs">
<device>
<name>ME0</name>
<config>
<interface xmlns="urn:ios">
<GigabitEthernet>
<name>0/2</name>
<service>
<instance>
<id>2</id>
<ethernet/>
<encapsulation>
<dot1q>
<id>2</id>
<id>3</id>
<id>4</id>
<id>5</id>
<id>6</id>
<id>7</id>
<id>8</id>
<id>9</id>
<id>10</id>
<id>60</id>
</dot1q>
</encapsulation>
<bridge-domain>
<bridge-id>2</bridge-id>
</bridge-domain>
</instance>
</service>
</GigabitEthernet>
</interface>
</config>
</device>
</devices>
The question is how to orchestrate this range of vlans and how to translate the output of vlan range from yang model into xml file.问题是如何编排这个范围的vlan,以及如何将来自yang模型的vlan范围的输出转换为xml文件。
Note that in this service, the customer will enter the first and the last vlan and NSO will configure this range under the interface.注意在这个服务中,客户会进入第一个和最后一个vlan,NSO会在接口下配置这个范围。
Thank you.谢谢你。
As we know to control and apply any logic in Cisco NSO we have to use Python or Java.众所周知,要控制和应用 Cisco NSO 中的任何逻辑,我们必须使用 Python 或 Java。 With XML and YANG, this is not easy to apply.对于 XML 和 YANG,这并不容易应用。
I will suggest using python or java based Service Package and taking input range from the user and applying as per logic using python or java code.我会建议使用基于 python 或 java 的服务包,并从用户那里获取输入范围,并使用 python 或 java 代码按照逻辑应用。
Or still, you want to handle this on XML template you can try this:或者,你仍然想在 XML 模板上处理这个,你可以试试这个:
<dot1q>
<from>1</from>
<to>2</to>
</dot1q>
But, might be create issue here, Practically I haven't tried till now .但是,可能会在这里产生问题,实际上我直到现在还没有尝试过。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.