cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
852
Views
0
Helpful
3
Replies

Remove IOS-XR subinterface before changing it to 'l2transport' mode

drazen.kedmenec
Level 1
Level 1

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.

 

1 Accepted Solution

Accepted Solutions

vleijon
Cisco Employee
Cisco Employee
This is the kind of thing that is handled in the NED. I don’t know the details of this use-case, but I would try raising a ticket to have someone look into it.

View solution in original post

3 Replies 3

vleijon
Cisco Employee
Cisco Employee
This is the kind of thing that is handled in the NED. I don’t know the details of this use-case, but I would try raising a ticket to have someone look into it.

Thanks for the quick reply. I discovered a potential workaround. In a nutshell:

 

  • Huawei NED supports "VrpReplacer.java" class, which can replace any string with any other string when sending/receiving commands to/from router. It is used to fix small idiosyncrasies with Huawei CLI behavior. This can be ported to XR NED.
  • I can create additional interface type called 'GigabitEthernetL2Mode' in XR NED. Then I would use default 'GigabitEthernet' for regular L3 subinterfaces and 'GigabitEthernetL2Mode' for L2 subinterfaces in my XML Templates. Therefore, FastMap would see 'GigabitEthernet0/0/0/0.10' and 'GigabitEthernetL2Mode0/0/0/0.10' as two different configuration instances, and would have no problem calculating removal of one before it adds another. This is the behavior I am looking for.
  • Use 'replacer' Java class to fix interface name when sending commands to router and performing 'sync-from'.

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 :-).

You probably don’t need to go quite that far, this can probably be solved by an annotation in the yang file. I do recommend writing a ticket.

But there is already something called inject-command in the ned-settings for xr that you can probably use as a workaround.