[c-nsp] Mass-renaming interfaces

James Bensley jwbensley+cisco-nsp at gmail.com
Mon Sep 28 06:12:55 EDT 2020


On Mon, 28 Sep 2020 at 07:35, Eugene Grosbein <eugen at grosbein.net> wrote:
>
> Hi!
>
> One of my 7201 routers has four GigabitEthernet interfaces but uses only two,
> one for IP uplink and another as client-sided downlink with multiple
> sub-interfaces named like GigabitEthernet0/1.10 (encapsulation dot1Q).
>
> It need reconfiguration to use 2x1G port-channles. I already did such reconfiguration
> for same 7201 router with small number of sub-interfaces and know this is doable
> changing sub-interfaces from GigabitEthernet0/1.N to Port-channel1.N
>
> This time the router has about 800 sub-interfaces. I can do some scripting
> to prepare incremental configuration removing/re-creating sub-interfaces,
> but I presume high CPU load for router while reconfiguring, long procedure time
> and notable service degradation or even interruption.
>
> Is there same another, more lightweight way to mass-rename sub-interfaces
> while switching from single parent interface to Port-channel?

Hi Eugene,

If you don't want to do this over a series of incremental changes then
you can make one "big bang" change by taking a copy of the running
configuration, making all the changes to that, and uploading it to the
router as a replacement start-up config file, then just reboot the
router to apply the config in one action. However, this approach is
risky, you need to test that new full configuration file (confirm that
the change only relate to the interface renaming, and that there are
no mistakes, typos, wrong VLAN numbers etc.), which is quite tricky.

If you've ever wanted a pet project to get you into some network
automation and programming stuff this sounds like an ideal project to
me. You can definitely do this with Python tools like NAPALM and
Nornir. Then you can automate the changes and automate the testing of
the changes, and the rollback if required, in either multiple stages
or as one giant change; whatever suits your circumstances best.

Cheers,
James.


More information about the cisco-nsp mailing list