Assiging Static IP to RHEL9 VM

Assiging Static IP to RHEL9 VM

·

1 min read

My Setup:

  • RHEL 9 spinning on Vbox with a wireless home router

Steps to Assign Static IP:

  1. Note the IP address that your home router has provided using this command: nmcli or ip a.

  2. You can view more information from the output of the command below: nmcli connection show enp0s8

    Note IP4.ADDRESS and IP4.GATEWAY assigned.

  3. Update static IP [IP4.ADDRESS noted in step 2] using the command below:

    nmcli con mod enp0s8 ipv4.method manual ipv4.addr "192.168.0.108/24"

  1. Check updated setting in below file under ipv4 section:

    /etc/NetworkManager/system-connections/enp0s8.nmconnection

  2. Restart network services:

    nmcli con down enp0s8

    nmcli con up enp0s8

  1. Now check status with command nmcli:

  2. Try to ssh from mobaxterm or putty:

    Voilà!

Revert to Dynamic ip configuration:

Run the following commands:

nmcli con mod enp0s8 ipv4.method auto

nmcli con mod enp0s8 ipv4.address ""

Restart Network Services:

nmcli con down enp0s8

nmcli con up enp0s8

Done!

Examine the ipv4 section of the config file now.

/etc/NetworkManager/system-connections/enp0s8.nmconnection

I hope you found this useful!