Community discussions

 
User avatar
lapsio
Member
Member
Topic Author
Posts: 472
Joined: Wed Feb 24, 2016 5:19 pm

swap 2 interfaces in whole config

Mon Jan 09, 2017 7:46 pm

Hi I'm using RB2011 as terminal router and I made terrible mistake of using gigabit interface for WAN even though it's only 60/6 DSL. All other 4 gigabit ports are used for machines capable of producing gigabit traffic. Now one gigabit socket got physically damaged and doesn't work so I need 1 more free gigabit interface. Obvious solution would be to just swap ether1 with lets say ether9 as it shouldn't be bottleneck anyways but router has pretty beefy config (1400 lines compact export) so I can't just manually change all interfaces in all places as it'd be extremely prone to some mistake potentially resulting in catastrophic security vulnerability.

How can I swap interfaces programmatically? I thought about just using sed on config export and then re-import it back but maybe there's better option.
MTCNA, MTCRE, MTCINE
 
pe1chl
Forum Guru
Forum Guru
Posts: 5832
Joined: Mon Jun 08, 2015 12:09 pm

Re: swap 2 interfaces in whole config

Mon Jan 09, 2017 8:19 pm

I think your option of exporting the config, editing it using sed or another global substitute and then resetting the router
and importing this config is the fastest and best way. You can rename ports but it will just drag the entire config behind it.
(when you would not have the option of using powerful editing tools you could change the name near the head of the
config export but you would still need to re-import it to get it applied to all the references below)

Who is online

Users browsing this forum: No registered users and 9 guests