08-01-2021 12:07 PM
The NSO service we're developing allows user to configure subinterface in L2 or L3 mode. We use IOS-XR NED to communicate with routers. What we want to accomplish is transparent change between modes. We want our service to create the same subinterface ID for L2 and L3 mode. However, IOS-XR router does not allow you to change subinterface from
interface GigabitEthernet0/0/0/0.10
to
interface GigabitEthernet0/0/0/0.10 l2transport
without first removing the first subinterface. My question is, how can we mimic this behavior in NSO model, using IOS-XR NED? What happens now is when you add 'l2transport' element under the interface in XML template, NSO calculates that it only needs to add keyword 'l2transport' to the existing subinterface. For example, this is an existing subinterface config:
interface GigabitEthernet0/0/0/0.10 description I am L3 ip address 10.10.10.1 /24
mtu 1555
If you now change interface mode to 'l2transport' in XML Template, and perhaps change 'description', NSO calculates the following configuration difference (no change in 'mtu):
interface GigabitEthernet0/0/0/0.10 l2transport description I am L2 no ip address
Router does not accept such change. It expects you to remove the existing subinterface, and add new one with keyword 'l2transport'. What NSO should calculate as configuration delta is something like:
no interface GigabitEthernet0/0/0/0.10 interface GigabitEthernet0/0/0/0.10 l2transport description I am L2 no ip address mtu 1555
I.e., NSO has to remove the existing subinterface and then configure the new subinterface with appropriate commands from model/template (in this case, it needs to figure out that command 'mtu 1555' is missing from the newly created 'l2transport' interface, and should be added).
As far as I can see, currently Fastmap considers both instances ('interface GigabitEthernet0/0/0/0.10' and 'interface GigabitEthernet0/0/0/0.10 l2transport') as the same object and calculates delta without considering that the router expects the old subinterface to be removed before the new one is created.
Solved! Go to Solution.
08-01-2021 12:47 PM
08-01-2021 12:47 PM
08-04-2021 12:12 AM
Thanks for the quick reply. I discovered a potential workaround. In a nutshell:
I did a quick test on Huawei NED, and it works exactly as expected. Left to see is if 'replacer' behavior can be ported to XR NED :-).
08-04-2021 08:54 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide