After deploying the NextGen Gateway as a virtual machine, it is strongly recommended to assign a unique hostname and configure the appropriate static IP address before proceeding with the K3s installation. This ensures reliable identification of the Gateway within your network and avoids potential hostname conflicts - especially in environments with multiple deployed nodes.
Note
Do not change the hostname and IP Address after K3s has been installed, as it may lead to issues with cluster services and communication between pods.Updating the Hostname
To set a new hostname, use the following command:
opsramp-collector-start setup updatehostname --hostName <hostname>Replace <new-hostname> with your desired hostname (e.g., opsramp-gateway).
Example Output:
opsramp-collector-start setup updatehostname gateway1This command updates the hostname both at the system level and in the /etc/hosts file, ensuring consistency across network and local name resolution.
Next Steps:
- Verify the hostname change using
hostnamectlor cat/etc/hostname.
Updating the IP Address
Note
If you plan to use a pre-defined static IP address for the Gateway, allow the gateway to bootstrap using DHCP initially, and then manually update the network configuration post-deployment to the approved static IP address.To change your NextGen Gateway’s network configuration from a dynamic (DHCP) IP address to a static IP address, follow these steps:
- Log in to the Gateway
Login to the NextGen Gateway using the gateway-admin user account. - Identify Network Interface
Run the following command to list network interfaces and identify the active interface name:ip addrNote
Note the interface name (e.g.,ens160,eth0) that you want to configure with a static IP. - Modify Netplan Configuration
Navigate to the Netplan configuration directory:
Open the existing Netplan YAML file (e.g.,cd /etc/netplan50-cloud-init.yaml) with a text editor such asviornano:sudo nano 50-cloud-init.yaml - Update Configuration File
Replace the existing content with the following template, updating placeholders with your network-specific details:
Replace the placeholders as follows:network: ethernets: <InterfaceName>: addresses: - <IpAddr>/<NetMask> nameservers: addresses: - <DNSserver1> - <DNSserver2> routes: - to: 0.0.0.0/0 via: <DefaultGateway> renderer: networkd version: 2<InterfaceName>: Your network interface name (e.g.,ens160)<IpAddr>: The static IP address to assign (e.g.,172.25.249.111)<NetMask>: The subnet mask in CIDR notation (e.g., 16 for255.255.0.0)<DefaultGateway>: Your network’s default gateway IP address (e.g.,172.25.0.1)<DNSserver1>,<DNSserver2>: One or more DNS server IP addresses (e.g.,172.25.1.51,8.8.8.8)
- Example Configuration
network: ethernets: ens160: addresses: - 172.25.249.111/16 nameservers: addresses: - 172.25.1.51 - 8.8.8.8 routes: - to: 0.0.0.0/0 via: 172.25.0.1 renderer: networkd version: 2 - Apply the Configuration
Save the changes and exit the editor. Then, apply the new network settings with:sudo netplan apply - Verify the Static IP
Confirm the static IP configuration by running:ip addr show <InterfaceName>
Replace<InterfaceName>with your actual interface name.