How to Change the IP Address of a Virtual Machine in AlmaLinux

cloudinfrastructurelinux

  1. Edit the ip of a connection
nmcli con modify <connection_name> ipv4.addresses <ip_address>
  1. Edit the gateway of a connection
nmcli con modify <connection_name> ipv4.gateway <gateway_address>
  1. Edit the DNS of the connection
nmcli con modify <connection_name> ipv4.dns <dns_address>
  1. Edit the DNS ip asignation method to manual
nmcli con modify <connection_name> ipv4.method manual
  1. Reboot the connection
nmcli con down <connection_name> && nmcli con up <connection_name>
  1. Reboot the system
systemctl reboot