Advanced: Pre-boot static IP configuration (VMware only)¶
Learn how to configure a static IP address before first boot using cloud-init for VMware ESXi deployments.
Overview¶
Use this method when a Dynamic Host Configuration Protocol (DHCP) server is not available in your management network and you must assign a static IP before the virtual machine (VM) boots for the first time.
Important
This method works only with VMware OVA deployments. The network interface name must be ens192.
For other platforms, deploy the VM first and use f5insight-netconfig from the console.
Before you start¶
Prerequisites:
- VMware vSphere 6.7 or later.
- Access to the vSphere client with permissions to edit VM settings.
- A Linux or macOS workstation with
base64andgenisoimageinstalled (for Option B).
Required network values:
Collect the following values from your network team:
- Static Internet Protocol version 4 (IPv4) address and prefix length (for example,
192.0.2.54/24). - Default gateway (for example,
192.0.2.1). - One or more Domain Name System (DNS) servers (for example,
203.0.113.53).
Option A: VMware guestinfo properties (recommended)¶
This method lets you configure a static IP by setting VM properties directly in vSphere without creating a disc image (ISO).
1. Create configuration files¶
Create a file named network-config:
network:
version: 2
ethernets:
ens192:
addresses:
- 192.0.2.54/24
routes:
- to: default
via: 192.0.2.1
nameservers:
addresses:
- 203.0.113.53
Create a file named meta-data:
instance-id: f5insight-01
local-hostname: f5insight-01
- Encode files to Base64
METADATA_B64=$(base64 -w0 meta-data)
NETWORK_CONFIG_B64=$(base64 -w0 network-config)
Note
The -w0 flag disables line wrapping and is specific to GNU base64 (Linux). On macOS, use base64 -b 0 instead.
- Set VM properties in vSphere
Right-click the VM → Edit Settings.
Go to VM Options → Advanced → Configuration Parameters.
Click Edit Configuration.
Add the following parameters:
Name Value guestinfo.metadataPaste your METADATA_B64valueguestinfo.metadata.encodingbase64guestinfo.network-configPaste your NETWORK_CONFIG_B64valueguestinfo.network-config.encodingbase64
- Click OK and power on the VM.
Option B: Cloud-init ISO¶
This option creates a bootable ISO that contains the network configuration.
- Create configuration files
Create a working directory:
mkdir cloud-init-config && cd cloud-init-config
Create three files in this directory:
meta-data
instance-id: f5insight-01
user-data
#cloud-config
network-config
network:
version: 2
ethernets:
ens192:
addresses:
- 192.0.2.54/24
routes:
- to: default
via: 192.0.2.1
nameservers:
addresses:
- 203.0.113.53
Replace the example values with your actual network settings.
- Generate the Cloud-Init ISO
genisoimage -output f5insight-seed.iso -volid cidata -joliet -rock \
user-data meta-data network-config
Note
If genisoimage is not installed, install it with your package manager. For example: sudo apt install genisoimage (Debian/Ubuntu) or sudo dnf install genisoimage (RHEL/Fedora).
- Deploy the VM
- Upload the F5 Insight OVA to vSphere.
- Before you power on the VM, edit the VM settings. Attach
f5insight-seed.isoto the CD/DVD drive. - Power on the VM.
- After boot completes, detach the ISO.
Verify the configuration¶
Connect to the VM and confirm that the static IP was applied:
sudo f5insight-netconfig show
Sample output:
Current network configuration:
IPv4: 192.0.2.54/24
IPv4 Gateway: 192.0.2.1
IPv6: none
DNS: 203.0.113.53
Dual-stack example (IPv4 and IPv6)¶
network:
version: 2
ethernets:
ens192:
addresses:
- 192.0.2.54/24
- 2001:db8::54/64
routes:
- to: default
via: 192.0.2.1
- to: default
via: 2001:db8::1
nameservers:
addresses:
- 203.0.113.53
- 2001:db8::53
Troubleshooting¶
| Issue | Cause | Solution |
|---|---|---|
| VM boots with no network | ISO not attached before first boot | Redeploy the VM with the ISO attached before you power on. |
| VM boots with no network | Incorrect interface name | Verify ens192 is used in network-config. |
| VM boots with no network | Guestinfo properties not set | Verify configuration parameters are set before first boot. |
| YAML parse error | Invalid YAML syntax | Validate YAML. Use spaces, not tabs, for indentation. |
| Base64 encoding error | Incorrect encoding | Ensure base64 -w0 is used on Linux (no line wrapping). On macOS, use base64 -b 0. |
| Cannot reach gateway | Wrong gateway address | Verify the gateway is correct for your subnet. |
| DNS resolution fails | Incorrect DNS servers | Verify DNS addresses and confirm your firewall allows port 53. |
Notes¶
- The OVA sets the interface name to
ens192. If you remove and re-add the VM network adapter in vSphere, the interface name may change. If that happens, usef5insight-netconfigafter boot instead. - Cloud-init configuration is applied only on first boot.
- To modify network settings after deployment, use
f5insight-netconfig. - Keep a copy of your configuration files for future redeployments.