Forum Discussion
Jason_40769
Nimbostratus
Nov 14, 2014Editing Virtual server IPs via script
Hey guys! I have a BIG-IP LTM running version 11.6. I need to create a one time script that I can change all the IP addresses of my Virtual servers quickly. We are changing our IP Block and want t...
RiverFish
Altostratus
Dec 30, 2014I'm having trouble with this one. Maybe it's because I'm running version 11.5.1. Here's what I did:
- Created a file named bash.sh in the /shared folder.
- Ran the following command: chmod 755 /shared/bash.sh
- Ran the following command: bash /shared/bash.sh
The output looked correct, the desired octet was changed:
modify ltm virtual vs-name { destination 10.10.207.x:80 }
But, the actual VS destinations were not changed. Below is the contents of the bash.sh file:
!/bin/bash
tmsh list ltm virtual destination | tr '\n' ' ' \
| sed 's/ \+/ /g;s/ltm virtual/\nmodify ltm virtual/g;s/nation 10\.10\.206/nation 10.10.207/g';echo
shaggy
Nimbostratus
Dec 30, 2014the command is meant to generate the commands that can then either be put into a script or run manually. the following should generate a bash script with 'tmsh modify ltm virtual...' commands:
echo '!/bin/bash' > /shared/bash2.sh; tmsh list ltm virtual destination | tr '\n' ' ' | sed 's/ \+/ /g;s/ltm virtual/\ntmsh modify ltm virtual/g;s/nation 10\.10\.206/nation 10.10.207/g' >> /shared/bash2.sh; chmod 755 /shared/bash2.sh
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects