03-03-2020 11:05 AM
Hi everyone,
I'm new to NSO and am working through the getting started guide and examples. Specifically the one found in the following folder on version 5.3:
~/nso-5.3/examples.ncs/service-provider/mpls-vpn/
I'm reaching the point whereby I check the dry-run config but I'm getting a strange exception insisting a value not be null:
admin@ncs(config)# show configuration vpn l3vpn volvo route-distinguisher 100 endpoint branch-office1 ce-device ce1 ce-interface GigabitEthernet0/11 ip-network 10.7.7.0/24 bandwidth 6000000 ! endpoint branch-office2 ce-device ce4 ce-interface GigabitEthernet0/18 ip-network 10.8.8.0/24 bandwidth 300000 ! endpoint main-office ce-device ce0 ce-interface GigabitEthernet0/11 ip-network 10.10.1.0/24 bandwidth 12000000 ! ! admin@ncs(config)# commit dry-run outformat native Aborted: Exception in callback: Neither the key nor the value can be null
admin@ncs(config)#
I'm not sure what is causing this. I'm guessing there is a policy necessitating an unseen value not be null but I'm unsure not sure how to find it.
Thanks in advance.
Solved! Go to Solution.
03-03-2020 11:18 AM
Managed to solve my own problem. Turns out the AS number was required.
admin@ncs(config)# vpn l3vpn volvo admin@ncs(config-l3vpn-volvo)# admin@ncs(config-l3vpn-volvo)# endpoint branch-office1 admin@ncs(config-endpoint-branch-office1)# as-number 65101 admin@ncs(config-endpoint-branch-office1)# exit admin@ncs(config-l3vpn-volvo)# endpoint branch-office2 admin@ncs(config-endpoint-branch-office2)# as-number 65101 admin@ncs(config-endpoint-branch-office2)# exit admin@ncs(config-l3vpn-volvo)# endpoint main-office admin@ncs(config-endpoint-main-office)# as-number 65101 admin@ncs(config-endpoint-main-office)# top admin@ncs(config)# show config vpn l3vpn volvo route-distinguisher 100 endpoint branch-office1 ce-device ce1 ce-interface GigabitEthernet0/11 ip-network 10.7.7.0/24 bandwidth 6000000 as-number 65101 ! endpoint branch-office2 ce-device ce4 ce-interface GigabitEthernet0/18 ip-network 10.8.8.0/24 bandwidth 300000 as-number 65101 ! endpoint main-office ce-device ce0 ce-interface GigabitEthernet0/11 ip-network 10.10.1.0/24 bandwidth 12000000 as-number 65101 ! ! admin@ncs(config)# commit dry-run outformat native native { device { name ce0 data policy-map volvo class class-default shape average 12000000 ! ! interface GigabitEthernet0/11 description volvo local network ip address 10.10.1.1 255.255.255.0 <output omitted for brevity>
But out of interest, can anyone advise where I'd find the statement or policy necessitating an ASN? Looking at the native output it is clearly configuring BGP sessions which obviously require ASNs but I'm looking find where exact syntax and details were specified.
For example:
router bgp 65101 neighbor 192.168.1.2 remote-as 100 << where is ASN 100 set? neighbor 192.168.1.2 activate address-family ipv4 unicast neighbor 192.168.1.2 activate network 10.10.1.0 mask 255.255.255.0 exit-address-family
Is this all templated into a yang model somewhere? I'll keep hunting but if anyone can help me track it down, that'd be awesome. I'm getting close to understanding the actual application of all this high level language, and nailing it down would be amazing helpful.
03-03-2020 11:18 AM
Managed to solve my own problem. Turns out the AS number was required.
admin@ncs(config)# vpn l3vpn volvo admin@ncs(config-l3vpn-volvo)# admin@ncs(config-l3vpn-volvo)# endpoint branch-office1 admin@ncs(config-endpoint-branch-office1)# as-number 65101 admin@ncs(config-endpoint-branch-office1)# exit admin@ncs(config-l3vpn-volvo)# endpoint branch-office2 admin@ncs(config-endpoint-branch-office2)# as-number 65101 admin@ncs(config-endpoint-branch-office2)# exit admin@ncs(config-l3vpn-volvo)# endpoint main-office admin@ncs(config-endpoint-main-office)# as-number 65101 admin@ncs(config-endpoint-main-office)# top admin@ncs(config)# show config vpn l3vpn volvo route-distinguisher 100 endpoint branch-office1 ce-device ce1 ce-interface GigabitEthernet0/11 ip-network 10.7.7.0/24 bandwidth 6000000 as-number 65101 ! endpoint branch-office2 ce-device ce4 ce-interface GigabitEthernet0/18 ip-network 10.8.8.0/24 bandwidth 300000 as-number 65101 ! endpoint main-office ce-device ce0 ce-interface GigabitEthernet0/11 ip-network 10.10.1.0/24 bandwidth 12000000 as-number 65101 ! ! admin@ncs(config)# commit dry-run outformat native native { device { name ce0 data policy-map volvo class class-default shape average 12000000 ! ! interface GigabitEthernet0/11 description volvo local network ip address 10.10.1.1 255.255.255.0 <output omitted for brevity>
But out of interest, can anyone advise where I'd find the statement or policy necessitating an ASN? Looking at the native output it is clearly configuring BGP sessions which obviously require ASNs but I'm looking find where exact syntax and details were specified.
For example:
router bgp 65101 neighbor 192.168.1.2 remote-as 100 << where is ASN 100 set? neighbor 192.168.1.2 activate address-family ipv4 unicast neighbor 192.168.1.2 activate network 10.10.1.0 mask 255.255.255.0 exit-address-family
Is this all templated into a yang model somewhere? I'll keep hunting but if anyone can help me track it down, that'd be awesome. I'm getting close to understanding the actual application of all this high level language, and nailing it down would be amazing helpful.
03-03-2020 11:34 PM
Hello,
You can have a look at the templates in the l3vpn package in the example - for example for a ce device (l3vpn-ce.xml) the remote-as is hardcoded to be 100 for the PE neighbor.
<router xmlns="urn:ios"> <bgp> <as-no>{$CE_AS_NUM}</as-no> <neighbor> <id>{$LINK_PE_ADR}</id> <remote-as>100</remote-as> <activate/> </neighbor> <address-family> <ipv4> <af>unicast</af> <neighbor> <id>{$LINK_PE_ADR}</id> <activate/> </neighbor> <network> <number>{$LOCAL_CE_NET}</number> <mask>{$CE_MASK}</mask> </network> </ipv4> </address-family> </bgp>
03-04-2020 02:15 AM
Assuming this example is similar to the version in NSO 5.2, you should be able to find the YANG model for it at examples.ncs/service-provider/mpls-vpn/packages/l3vpn/src/yang/l3vpn.yang. However, at least in the NSO 5.2 version, the as-number leaf is not mandatory in the YANG model. If it were, I would also expect to see a different error (if you fail to provide data that the YANG model states is mandatory, I would expect to see a YANG validation failure message before it even attempts the service callback).
Instead, I think that error is being triggered by the java code that converts the data from the YANG model into variables to be inserted in the XML templates. You should be able to find the java source at examples.ncs/service-provider/mpls-vpn/packages/l3vpn/src/java/src/com/example/l3vpn/l3vpnRFS.java
While I don't really speak java, it looks to me like the code assumes that every CE will have an AS number, and will throw an exception if they don't.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: