Using the App¶
This document describes common use-cases and scenarios for this App.
F5 Simple Load Balancing Use Case¶
This document describes a straightforward example of configuring load balancing using the Nautobot Load Balancer App for an F5 environment. This use case illustrates the creation of basic Virtual Servers, Load Balancer Pools, and Pool Members.
Scenario Overview¶
In this example, we configure:
- A single Virtual Server.
- One Load Balancer Pool.
- One Pool Member.
Step-by-Step Configuration¶
1. IPAM Configuration¶
Ensure the following IP Addresses exist in Nautobot's IPAM:
- Virtual IP (VIP):
192.0.2.1
- Pool Member IP:
10.0.0.1
2. Configuring Load Balancer Pool¶
- Navigate to Load Balancer > Pools.
- Click Add Load Balancer Pool.
- Name:
pool1
- Load Balancing Algorithm:
Round Robin
- Name:
3. Adding a Load Balancer Pool Member¶
- Navigate to Load Balancer > Pool Members.
- Click Add Load Balancer Pool Member.
- IP Address:
10.0.0.1
- Load Balancer Pool:
pool1
- Status: Active
- Port:
80
- IP Address:
4. Creating the Virtual Server¶
In the Nautobot UI:
- Navigate to Load Balancer > Virtual Servers.
- Click Add Virtual Server.
- Name:
virtual1
- IP Address (VIP):
192.0.2.1
- Port:
80
- Protocol:
TCP
- Load Balancer Pool:
pool1
- Name:
5. Validation and Configuration Snippet¶
Now that you have successfully inputted the data for a basic Load Balancer data model, you can use GraphQL to extract the values needed. Here is a sample GraphQL query for our example:
{
virtual_servers(name: "virtual1") {
name
port
protocol
vip {
address
}
load_balancer_pool {
name
load_balancer_pool_members {
port
ip_address {
address
}
}
}
}
}
A sample JSON response for that query would look like:
{
"data": {
"virtual_servers": [
{
"name": "virtual1",
"port": 80,
"protocol": "TCP",
"vip": {
"address": "192.0.2.1/32"
},
"load_balancer_pool": {
"name": "pool1",
"load_balancer_pool_members": [
{
"port": 80,
"ip_address": {
"address": "10.0.0.1/32"
}
}
]
}
}
]
}
}
Using that JSON response, you can then build a Jinja2 template following the data model:
{% for virtual_server in data.virtual_servers %}
ltm virtual-address /Common/{{ virtual_server.vip.address.split('/')[0] }} {
address {{ virtual_server.vip.address.split('/')[0] }}
arp enabled
mask 255.255.255.255
route-advertisement selective
}
ltm virtual /Common/{{ virtual_server.name }} {
destination /Common/{{ virtual_server.vip.address.split('/')[0] }}:{{ virtual_server.port }}
ip-protocol {{ virtual_server.protocol | lower }}
mask 255.255.255.255
pool /Common/{{ virtual_server.load_balancer_pool.name }}
source 0.0.0.0/0
translate-address enabled
translate-port enabled
}
ltm pool /Common/{{ virtual_server.load_balancer_pool.name }} {
members {
{% for member in virtual_server.load_balancer_pool.load_balancer_pool_members %}
/Common/{{ member.ip_address.address.split('/')[0] }}:{{ member.port }} {
address {{ member.ip_address.address.split('/')[0] }}
}
{% endfor %}
}
}
{% for member in virtual_server.load_balancer_pool.load_balancer_pool_members %}
ltm node /Common/{{ member.ip_address.address.split('/')[0] }} {
address {{ member.ip_address.address.split('/')[0] }}
}
{% endfor %}
{% endfor %}
Sample output from the template (you can use the Jinja Renderer linked at the bottom of Nautobot):
ltm virtual-address /Common/192.0.2.1 {
address 192.0.2.1
arp enabled
mask 255.255.255.255
route-advertisement selective
}
ltm virtual /Common/virtual1 {
destination /Common/192.0.2.1:80
ip-protocol tcp
mask 255.255.255.255
pool /Common/pool1
source 0.0.0.0/0
translate-address enabled
translate-port enabled
}
ltm pool /Common/pool1 {
members {
/Common/10.0.0.1:80 {
address 10.0.0.1
}
}
}
ltm node /Common/10.0.0.1 {
address 10.0.0.1
}
Next Steps¶
To further explore advanced scenarios, such as SSL Profiles or advanced vendor-specific settings, refer to the advanced use cases.