F5
From Christoph's Personal Wiki
This article will cover various topics related to F5 BIG-IP load balancers (mainly for the Virtual Edition).
NOTE: Unless otherwise specified, all commands listed herein were tested on BIGIP-15.0.1-0.0.11-vmware.
Miscellaneous commands
- List VIPs and pools:
$ tmsh list ltm virtual $ tmsh list ltm pool
- Set various routes:
[root@AnthosF5:Active:Standalone] config # tmsh create /sys management-route OpenVPN network 10.1.100.45/32 gateway 10.39.56.1
[root@AnthosF5:Active:Standalone] config # tmsh create /sys management-route Default-Mgmt network 0.0.0.0/0 gateway 10.39.56.1
[root@AnthosF5:Active:Standalone] config # tmsh list /sys management-route
sys management-route Default-Mgmt {
gateway 10.39.56.1
network default
}
sys management-route OpenVPN {
gateway 10.39.56.1
network 10.1.100.45/32
}
[root@AnthosF5:Active:Standalone] config # tmsh list net route
net route external_default_gateway {
gw 10.31.0.1
network default
}
API calls
- Authenticate to receive temporary token:
$ F5_IP=10.39.56.74
$ F5_ADMIN_PASSWD={redacted}
$ TOKEN=$(curl -skXPOST https://${F5_IP}/mgmt/shared/authn/login \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"${F5_ADMIN_PASSWD}","loginProviderName":"tmos"}' |\
python -c 'import sys,json;data=json.loads(sys.stdin.read());print data["token"]["token"]')
- Use token to make an API call (here, get information on the partition named "
admin_control_plane"):
$ curl -skH "X-F5-Auth-Token: ${TOKEN}" \
https://${F5_IP}/mgmt/tm/auth/partition/admin_control_plane |\
python -mjson.tool
{
"defaultRouteDomain": 0,
"fullPath": "admin_control_plane",
"generation": 306,
"kind": "tm:auth:partition:partitionstate",
"name": "admin_control_plane",
"selfLink": "https://localhost/mgmt/tm/auth/partition/admin_control_plane?ver=15.0.1"
}