Conectando uma VM do Ubuntu 18.04 a uma rede virtual da Box Nat

1

Estou tentando configurar uma rede de máquinas virtuais usando uma Rede Nat do VirtualBox. Alguns vms, especificamente um cluster de caixas coreos e metasploitable, conectam muito bem. Outros, especificamente qualquer Ubuntu vm que eu mesmo configurei, não.

A rede nat é configurada da seguinte forma

$ VBoxManage natnetwork list fabian
NAT Networks:

Name:        fabian
Network:     172.17.8.0/24
Gateway:     172.17.8.1
IPv6:        No
Enabled:     Yes

O que eu tentei é editar o arquivo Ubuntu vms /etc/network/interfaces para ler como tal

# interface(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# network interface
auto enp0s3
iface enp0s3 inet dhcp

(isso é baseado em parte no arquivo /etc/network/interfaces do metasploitable, que é um vm baseado no ubuntu que parece se conectar à rede)

No entanto, quando tento executar $ sudo systemctl restart networking , ele é interrompido e expira. Eu incluí a saída de $ journalctl -xe abaixo. Há entradas de antes do que eu incluí, mas elas parecem ser a mesma mensagem com intervalos diferentes.

Há algo que me falta ao conectar a configuração da interface de rede?

Oct 23 10:22:49 burp-vm systemd-resolved[290]: Using degraded feature set (UDP) for DNS server 8.8.8.8.
Oct 23 10:22:52 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 20 (xid=0x6914771e)
Oct 23 10:22:52 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 20 (xid=0x6914771e)
Oct 23 10:22:54 burp-vm systemd-resolved[290]: Using degraded feature set (UDP) for DNS server 8.8.4.4.
Oct 23 10:23:12 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 9 (xid=0x6914771e)
Oct 23 10:23:12 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 9 (xid=0x6914771e)
Oct 23 10:23:21 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 9 (xid=0x6914771e)
Oct 23 10:23:21 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 9 (xid=0x6914771e)
Oct 23 10:23:30 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:23:30 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:23:42 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:23:42 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:23:54 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 11 (xid=0x6914771e)
Oct 23 10:23:54 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 11 (xid=0x6914771e)
Oct 23 10:24:05 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 15 (xid=0x6914771e)
Oct 23 10:24:05 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 15 (xid=0x6914771e)
Oct 23 10:24:20 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 21 (xid=0x6914771e)
Oct 23 10:24:20 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 21 (xid=0x6914771e)
Oct 23 10:24:39 burp-vm systemd-resolved[290]: Using degraded feature set (TCP) for DNS server 8.8.8.8.
Oct 23 10:24:39 burp-vm systemd-resolved[290]: Using degraded feature set (TCP) for DNS server 8.8.4.4.
Oct 23 10:24:41 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7 (xid=0x6914771e)
Oct 23 10:24:41 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 7 (xid=0x6914771e)
Oct 23 10:24:48 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:24:48 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:25:00 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 10 (xid=0x6914771e)
Oct 23 10:25:00 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 10 (xid=0x6914771e)
Oct 23 10:25:10 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:25:10 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 12 (xid=0x6914771e)
Oct 23 10:25:22 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 11 (xid=0x6914771e)
Oct 23 10:25:22 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 11 (xid=0x6914771e)
Oct 23 10:25:33 burp-vm dhclient[1889]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3 (xid=0x6914771e)
Oct 23 10:25:33 burp-vm ifup[1867]: DHCPDISCOVER on enp0s3 to 255.255.255.255 port 67 interval 3 (xid=0x6914771e)
Oct 23 10:25:35 burp-vm systemd[1]: networking.service: Start operation timed out. Terminating.
Oct 23 10:25:35 burp-vm systemd[1]: networking.service: Main process exited, code=killed, status=15/TERM
Oct 23 10:25:35 burp-vm systemd[1]: networking.service: Failed with result 'timeout'.
Oct 23 10:25:35 burp-vm systemd[1]: Failed to start Raise network interfaces.
    
por Elliot 23.10.2018 / 16:44

1 resposta

0

A partir do Ubuntu 17.10, o ifupdown é considerado uma ferramenta desprovida e substituído por netplan . Para usar o pacote /etc/network/interfaces the ifupdown deve ser instalado.

No seu caso, você deve configurar a rede usando a ferramenta netplan :

O arquivo de configuração pode ser encontrado em /etc/netplan/ . Crie / edite o arquivo *.yaml da seguinte forma:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: true

Se você tiver o Network-Manager instalado, poderá substituir renderer: networkd por renderer: NetworkManager

Em seguida, execute:

sudo netplan generate
sudo netplan apply

Exemplos de configuração do Netplan

MigratingToNetplan

    
por 24.10.2018 / 18:05