Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Vincent_Bacher
Advisor
Advisor

rename bunch of interfaces

Hello mates,

i will have to modify network interfaces on a gateway from single interfaces to bonds.
Gaia step with clish command is easy. Just remove all VLAN interfaces, create bonds and creating all VLANs on the bonds again.
Prepared text-file and copy&paste to ssh and this task is done within seconds.

Now i am playing around with management CLI on SmartConsole to rename the interfaces as well and have no idea how it works.

Examples
old                       new

"eth1.100"         "bond1.100"

"eth1.123"         "bond1.123"

In the mgmt api reference there is mentioned parameter name "new-name" for an interface but no clue how to use it.
Don't even have a clue what interface id to use.

When running "show simple-gateway name "test" " i get

> show simple-gateway name "test"

...
name: "test"
type: "simple-gateway"
....
interfaces:
- name: "eth1.111"
ipv4-address: "1.1.1.1"
ipv4-network-mask: "255.255.255.0"
ipv4-mask-length: 24
ipv6-address: ""
comments: ""
color: "black"
icon: "NetworkObjects/network"
topology: "automatic"
topology-automatic-calculation: "internal"
topology-settings:
ip-address-behind-this-interface: "network defined by the interface ip and net mask"
interface-leads-to-dmz: false
anti-spoofing: true
anti-spoofing-settings:
action: "prevent"
security-zone: false
....
and so on.
No ID for that interface.

I am rather at a loss now. I could do this using Topology and edit all interfaces but using api would be much better for dozens of VLAN interfaces 🙂

Ahy hints would be appreciated.

Cheers
Vincent

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
8 Replies
_Val_
Admin
Admin

Several questions:

1. How many interfaces do you want to modify?

2. GW or cluster?

3. Management API version?


That said, you do not need UID for an interface. You can use "set simple-gateway name <GWname> remove interface <NICname>" and then "...add interface..."

 

0 Kudos
Vincent_Bacher
Advisor
Advisor

Hi Val,

ok sorry for forgetting this details.

1. round about 35
2. Cluster (yes, here it's not "simple-gateway" but "simple-cluster" and apparently more complex)
3. 1.6 (R80.40)

Cheers
Vincent

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
MiB85
Explorer

Hi @Vincent_Bacher 

did you ever found a solution via CLI or API?
We have to do the same sooon, but with about 70 VLAN interfaces 🙈

0 Kudos
Vincent_Bacher
Advisor
Advisor

Hi @MiB85 ,

i cannot really remember, i am sorry.
I think i found no real cool solution so i think i did it manually, what is a pain in the ass 😉

cheers
Vince

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
_Val_
Admin
Admin

I assume you have the physical bond configured, right?

So the process would be the following:

  • Delete vlan interface
  • add new vlan bond interface 
  • set up IP address on it
  • save config

Use clish commands for each operation for a single VLAN. copy/paste them into a text file and use as a template, changing the VLAN names. Should be some amount copy/paste and find/replace to cover all changes.

Take the result text and paste to clish, boom, it's all done

 

 

0 Kudos
Vincent_Bacher
Advisor
Advisor

This is what i meant by "manually". OK i wrote a three-liner creating the clish commands because i am to lazy to enter all by hand.

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
_Val_
Admin
Admin

@Vincent_Bacher fair enough. One could write a shell script with three commands, where VLAN name is a variable, but it is I do not really see the point  of doing that 🙂

0 Kudos
Vincent_Bacher
Advisor
Advisor

I see the point. It's not as stupid work as doing copy&paste crap dozens of times 😉

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events