cancel
Showing results for 
Search instead for 
Did you mean: 

Script to change management IP

Script to change management IP

bfaltys
Contributor II
I am working on upgrading a bunch of devices from 8.1.5.0. to 8.4.2.1. Currently they are using a CLIP/loopback as the management IP. I am setting the migrate-to-mgmt flag to maintain access to the devices. I would like to figure out if there is a way to run a few commands from a script like you can with the ERS switches so that I can remotely change the management addresses to our new IP scheme without cutting myself off since I must delete the old IP before I can configure the new one.
4 REPLIES 4

bfaltys
Contributor II
I didn't figure out the script, but was able to accomplish the end state by adding a mgmt vlan IP, the logging into that IP to change the CLIP/loopback. Then login to the new CLIP/loopback and remove the temporary mgmt vlan.

vlan create 699 name "MGMT-TEMP" type port 0
vlan i-sid 699 10699
#Create temporary mgmt vlan and a static route. I only added a route for the subnet I was accessing the VSP from.
mgmt vlan 699
  ip address 10.99.99.250 255.255.255.0
  ip route 192.168.10.0/24 next-hop 10.99.99.251
  enable
  exit
#NOW SSH TO THE NEW, TEMP MGMT IP AND CHANGE THE CLIP/LOOPBACK IP
mgmt clip
 no ip address 10.1.1.28
 ip address 172.31.1.36/32
 exit
#NOW SSH TO THE NEW MGMT CLIP/LOOPBACK IP
no mgmt vlan

Hi bfaltys,

On VOSS device, you can execute script (cli commands) with the command "source". 
You can copy your script file on intflash and run it. 
Source myscript.txt debug syntaxe (check syntaxe error but don't apply it)
Source my script.txt debug (run file and display execution)
Source myscript.txt (run file without any display) 

Regards,
Théo

bfaltys
Contributor II
Awesome. This could be useful for other tasks. Just tried it out for some changes that required me to disable IS-IS and then re-enable it.

On those lines, there is an XIQ-SE python script which does something similar on Gihub:
https://github.com/extremenetworks/ExtremeScripting/tree/master/XMC_XIQ-SE/oneview_CLI_scripts
The one called "Move to Clip Mgmt IP". It is designed to go into a switch, give it a new mgmt clip IP, then delete the existing one (clip IP or mgmt vlan IP) and re-add the device to XIQ-SE using the new IP.
It uses the same approach of packing the necessary CLI commands in a text file, then making the switch get that text file by tftp and sourcing it locally.
You can extract the variuos functions from it.
GTM-P2G8KFN