Com afegir una adreça IP estàtica a una distribució de Linux com Debian s'executa com un VPS a VirtualBox

Assegureu-vos que la màquina virtual està apagat

  1. Configure the Network

    Settings -> Network
     

  2. Ensure Adapter 1 està unit a NAT i l'adaptador 2 is attached to Host-only Adapter

     

  3. Ensure your host’s IP is set similar to the following

    network properties
     

  4. Get the names of your network interfaces, make a note of them

    ip addr
     

  5. Open the interface file in Nano

    su
    cd /etc/network
    nano interfaces
     

  6. Ensure the interfaces are configured as the following. Use your own interface names e.g in the following the interface names are enp0s3 and enp0s8.

        source /etc/network/interfaces.d/*
    
        # La interfície de xarxa de bucle de retrocés
        el automàtica
        del iface ho inet loopback
    
        # adaptador 1
        allow-hotplug enp0s3
        iface de enp0s3 inet dhcp
    
        # adaptador 2
        enp0s8 automàtic
        iface de enp0s8 inet static
        adreça 192.168.56.102
        màscara de xarxa 255.255.255.0
        entrada 192.168.56.1
        servidor de noms 8.8.8.8
      

     

  7. Reboot Debian

    reboot