Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two network adapters on Virtual Box for Ubuntu Server.

  • Adapter 1: internal network called intent
  • Adapter 2: NAT

I want to configure them as follows:

  • Static IP for the internal network adapter, netmask
  • DHCP IP for the NAT adapter

How can I do this?

share|improve this question

Log in to the virtual box with your normal account and use su to get an admin account.

Then open /etc/network/interfaces in an editor.

To set up a static IP use

iface eth0 inet static

Sadly I am not sure what you mean with DHCP IP for the NAT adapter

To setting up a simply DHCP IP for eth1 use add

auto eth1
iface eth1 inet dhcp

to the file you just edited.

If you want this line to connect to the outside world with and actually do NATting then you will need to enable IP forwarding, load the MASQ module and set up some routing. If that is you goal then please clarify your post.

share|improve this answer

To do so you will need to enter the following code and create a password (you will be prompted to enter it twice):

sudo passwd root

This will allow you to become the root user. Then enter:


Then use the vi editor with the following:

vi /etc/network/interfaces

This will let you change the desired settings, just hit i to edit. When finished, hit Esc, then type :x to save the changes.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.