BIG-IP Infrastructure OnboardingΒΆ

In this section you will configure basic network configurations like NTP, DNS, and interface IP addresses.

  1. Confirm BIG-IP is not configured with basic network configurations.

    • Explore BIG-IP GUI Network -> Self IPs and Network -> VLANs settings to validate they are not configured

    ../../_images/selfip0.png ../../_images/vlan0.png
  2. Create main.tf to use the [Terraform Provider for F5 BIG-IP]

    • Open client server vscode terminal

    • mkdir ~/projects/lab1

    • cd ~/projects/lab1

    • touch main.tf

    • use vscode to add the following code to main.tf

    terraform {
    required_providers {
      bigip = {
        source = "F5Networks/bigip"
        version = "1.3.1"
      }
    }
    }
    
    provider "bigip" {
      address = "10.1.1.6"
      username = "admin"
      password = "F5d3vops$"
    }
    
    resource "bigip_command" "showversion" {
      commands   = ["show sys version"]
    }
    
    output "showversion" {
      value = "${bigip_command.showversion.command_result}"
    }
    
    ../../_images/maintf.png
  3. Test terraform connectivity to bigip

    • terraform  init

    ../../_images/tinit.png

    Note

    The terraform init command is used to initialize a working directory containing Terraform configuration files. This is the first command that should be run after writing a new Terraform configuration or cloning an existing one from version control. It is safe to run this command multiple times.

    • terraform plan

    ../../_images/tplan.png

    Note

    The terraform plan command is used to create an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files.

    • terraform apply

    ../../_images/tapply.png
    • Type yes to approve action when prompted

    Note

    The terraform apply command is used to apply the changes required to reach the desired state of the configuration, or the pre-determined set of actions generated by a terraform plan execution plan. In addition terraform.tfstate file is created by Terraform to map real world resources to your configuration, keep track of metadata, and to improve performance for large infrastructures.

  4. Create f5base.tf to configure base bigip network (NTP, DNS, VLANS and SELFIPs)

    • touch f5base.tf

    • use vscode to add the following code to f5base.tf

    resource "bigip_sys_ntp" "ntp1" {
      description = "/Common/NTP1"
      servers = ["time.google.com"]
      timezone = "America/Los_Angeles"
    }
    
    resource "bigip_sys_dns" "dns1" {
      description = "/Common/DNS1"
      name_servers = ["8.8.8.8"]
      number_of_dots = 2
      search = ["f5.com"]
    }
    
    resource "bigip_net_vlan" "vlan1" {
      name = "/Common/internal"
      interfaces {
        vlanport = 1.1
        tagged = false
      }
    }
    
    resource "bigip_net_vlan" "vlan2" {
      name = "/Common/external"
      interfaces {
        vlanport = 1.2
        tagged = false
      }
    }
    
    resource "bigip_net_selfip" "selfip1" {
       name = "/Common/internalselfIP"
       ip = "10.1.10.6/24"
       vlan = "/Common/internal"
       depends_on = [bigip_net_vlan.vlan1]
    }
    
    resource "bigip_net_selfip" "selfip2" {
       name = "/Common/externalselfIP"
       ip = "10.1.20.6/24"
       vlan = "/Common/external"
       depends_on = [bigip_net_vlan.vlan2]
    }
    
    • terraform plan

    • terraform apply

    ../../_images/f5base.png

    Note

    The bigip terraform provider contains native resources to help facilitate provisioning services on BIG-IPs. For example bigip_sys_ntp resource is helpful when configuring NTP server on the BIG-IP.

  5. Confirm BIG-IP is now configured

    • Refresh firefox browser and explore BIG-IP GUI Network -> Self IPs and Network -> VLANs to validate network settings are now configured

    ../../_images/selfip.png ../../_images/vlan.png