0

I have a Virtual Box machine with 2 net adapters, first is an "internal net" and the second a "bridge adapter". How could I config both for have an static ip for the internal network and a dynamic ip for bridge?

I tried modifying /etc/network/interfaces:

#localhost
auto lo
iface lo inet loopback

iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
dns-search lcl

iface eth1 inet dhcp

But when I restart the machine I get:

lo        Link encap:Bucle local  
          Direc. inet:127.0.0.1  Másc:255.0.0.0
          Dirección inet6: ::1/128 Alcance:Anfitrión
          ACTIVO BUCLE FUNCIONANDO  MTU:16436  Métrica:1
          Paquetes RX:124 errores:0 perdidos:0 overruns:0 frame:0
          Paquetes TX:124 errores:0 perdidos:0 overruns:0 carrier:0
          colisiones:0 long.colaTX:0 
          Bytes RX:10400 (10.4 KB)  TX bytes:10400 (10.4 KB)
tato469
  • 103
  • 3

2 Answers2

0

My guess is that your network interfaces are not UP.

To bring them up automatically at startup you have to define the auto directive for each interface :

auto eth0
iface eth0 inet static
....
....

auto eth1
iface eth1 inet dhcp

Add these directives and then restart your network : service networking restart

From now, you could also start them manually by typing the following from the terminal :

# ifup eth0
# ifup eth1
krisFR
  • 13,280
  • 4
  • 36
  • 42
0

To have the intenral network IP "activated" on your server, you need to start at least on VirtualBox machine (not sure if it's required for that machine to use Intenral network).

The bridge will be dinamically assigned if you have a DHCP on your network.

The IP range for internal IP if defined in VirtualBox server settings (File...Settings...Network...Host only). For you host using intenral network, you can define a static IP, but this IP must be in the range defined for internal network.

enter image description here

Cedric Simon
  • 151
  • 1
  • 4