You can configure a network adapter of a machine to use a static IP address. To configure static IP address in Ubuntu, you need to edit the  /etc/network/interfaces file

Open the file with Sudo Option

Assuming that the eth1 is the adapter for which static IP address is to be configured.

NOTE: If you set Host only adapter in “Adapter 2” in Oracle VirtualBox then eth1 will be mentioned. Similarly if you set Host only adapter in “Adapter 3” in Oracle VirtualBox then eth2 will be mentioned and so on…

Add / Edit Configuration for eth0 Adapter

Save the file 

If you are using nano editor, press ctrl+x and then Y and Enter to save the changes.

Restart Machine’s Network 

To restart the network in Ubuntu, execute the following command:

NOTE: If you have configured Host only adapter in any other adapter except ‘Adapter 2’ in Oracle VirtualBox then mention your respective Ethernet name in above command.


Now check your IP using below command:

Above command will show you static IP address.
Share this:

One thought on “Configure Static IP Address in Ubuntu

Leave a Reply

Your email address will not be published.