Setting Static IP of NAT network interface in VirtualBox

Posted by admin on Feb 9, 2012 in Unix |

In NAT mode, the guest network interface is assigned to the IPv4 range 10.0.x.0/24 by default
where x corresponds to the instance of the NAT interface +2.
So x is 2 when there is only one NAT instance active.
In that case the guest is assigned to the address 10.0.2.15, the gateway is set to 10.0.2.2
and the name server can be found at 10.0.2.3.

This means that for Ubuntu, the /etc/network/interfaces entry for the network card settings are something as below:

iface inet static
address (e.g. 10.0.2.7)
netmask 255.255.255.0
network 10.0.2.0
broadcast 10.0.2.255
gateway 10.0.2.2

Also, add the following nameserver entry to /etc/resolv.conf

nameserver 10.0.2.3

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Copyright © 2008-2018 Brinsmead Data Services All rights reserved.