Change VM from DHCP to Static IP

Steps to change DHCP configuration to a static IP, if the VM was originally configured using DHCP. I’ve had to look this up a few times so I’m documenting it here.

Edit the network adapter

  • Edit the following file as root user



And save the file

Edit the hosts file

  • Also edit the host file in etc as root user.


Do not edit these two lines which is given as default localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

Add this at the end of the file aapum

Restart the network services

  • Restart the network using this command.
service network restart


0 thoughts on “Change VM from DHCP to Static IP

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see