Forum Discussion
What is the best way to verify new IP address is not used on F5 ltm
Hi, Everyone:
I am trying to use Ansible to build a lot of VIPs, Is there a way to verify new IP addresses is not used on LTM, currently I am doing following (grep /config/bigip.conf, and grep /config/bigip_base.conf)
I tried to use bigip_facts(for selfip, virtualaddress, pool), it takes long time, is there any other ways?
Thanks
- jaikumar_f5
Noctilucent
A simple ping should tell you. By default, the icmp is enabled for all vips. If you dont get a response, then that VIP is free.
- MvdG
Cirrus
Hi,
You can use the Network Map in LTM. There is a search option in Network Map. Type in the IP-address and click on Update Map. The item found is highlighted.
Regards, Martijn.
- jaikumar_f5
Noctilucent
Hi Martijn,
Yes this is GUI way of finding and Yes its a great way to search a particular IP in VS,pools, irules etc. And results are handy too.
But I've had experience where the GUI takes lot of time in loading :) Sometimes the configuration utility time outs too. Nothing is better than a console, from my point of view.
- Martijn_144688
Cirrostratus
Hi,
You can use the Network Map in LTM. There is a search option in Network Map. Type in the IP-address and click on Update Map. The item found is highlighted.
Regards, Martijn.
- jaikumar_f5
Noctilucent
Hi Martijn,
Yes this is GUI way of finding and Yes its a great way to search a particular IP in VS,pools, irules etc. And results are handy too.
But I've had experience where the GUI takes lot of time in loading :) Sometimes the configuration utility time outs too. Nothing is better than a console, from my point of view.
- Stanislas_Piro2
Cumulonimbus
Hi,
Instead of using grep in config file, you can search in tmsh
tmsh cd / list recursive | grep 1.2.3.4
The goal of the recursive is to search in partitions
- Juraj
Cirrus
This will show you all self-IPs, float IPs, and all VS IPs:
( tmsh list /ltm virtual one-line ; tmsh list /net self one-line ) | egrep '^(ltm virtual|net self) ' | sed -e 's/^.* destination //g' -e 's/^net self //g' | cut -d' ' -f1 | cut -d: -f1 | sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 | uniq
You need to run it on F5
Or, remotely via SSH:
ssh YOUR-BIG-IP "( tmsh list /ltm virtual one-line ; tmsh list /net self one-line )" | egrep '^(ltm virtual|net self) ' | sed -e 's/^.* destination //g' -e 's/^net self //g' | cut -d' ' -f1 | cut -d: -f1 | sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 | uniq
Or, if you don't have a full shell, but tmsh cli only:
ssh YOUR-BIG-IP "list /ltm virtual one-line ; list /net self one-line" | egrep '^(ltm virtual|net self) ' | sed -e 's/^.* destination //g' -e 's/^net self //g' | cut -d' ' -f1 | cut -d: -f1 | sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 | uniq
I have written a wrapper script for it, which shows me all used and free F5 IPs in a specific subnet. I might just share it somewhere.
- Satoshi_Toyosa1Ret. Employee
iControl REST way.
for getting virtual addresses: e.g.,GET /mgmt/tm/ltm/virtual-address
curl -sku : https:///mgmt/tm/ltm/virtual-address
If you only want the addresses, pipe the output to
| python -c 'import sys,json; o=json.load(sys.stdin); oo = [vip["address"] for vip in o["items"]]; print("\n".join(oo))'
for getting the self IP addresses: e.g.,GET /mgmt/tm/net/self
curl -sku : https:///mgmt/tm/net/self
Pipe the output to the same python filter for getting the addresses.
I guess you don't need to get the management address since you have already used it in the above calls (
), however, to satisfy your curiousity, it is
.GET /mgmt/tm/sys/management-ip
Recent Discussions
Related Content
* 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