Problem description
While adding or updating a static IP to Nutanix Backup Proxy we get an error
“yaml: line x: did not find expected alphabetic or numeric character”
Cause
Incorrect file permissions.
The system cannot correctly read the network configuration file.
The configuration file may contain a deprecated `Gateway4` parameter.
Traceback
Error Traceback:
yaml: line 2: did not find expected alphabetic or numeric character
Resolution
1. Adjust File Permissions:
Change the permissions for the /etc/netplan/00-installer-config.yaml file to allow proper access. Open a terminal on the Nutanix backup proxy and execute the following command:
sudo chmod 600 /etc/netplan/*
This command sets read and write permissions only for the owner of the file, which is typically sufficient for system processes.
2. Update Netplan Configuration:
The existing Netplan configuration might contain deprecated parameters (e.g., Gateway4). Update the /etc/netplan/00-installer-config.yaml file with the correct and supported syntax. Ensure the via parameter is used for defining the gateway instead of Gateway4.
Here is an example of a corrected configuration that has been verified to work:
network:
ethernets: any: dhcp4: true ens3: dhcp4: false routes: - to: default via: xx.xx.xx.xx # Replace with your actual gateway IP nameservers: addresses: [xx.xx.xx.xx, xx.xx.xx.xx] # Replace with your actual DNS server IPs addresses: - xx.xx.xx.xx/2x # Replace with your actual IP address and subnet mask version: 2
Note: Replace xx.xx.xx.xx with your actual IP addresses and 2x with the correct subnet mask (e.g., 24).
3. Apply Netplan Configuration:
After saving the changes to the 00-installer-config.yaml file, apply the new network configuration using the netplan apply command:
sudo netplan apply