Monday 14 June 2021

Virtualbox: two network interfaces

 I had to add the following lines in Debian virtual machine's /etc/network/interfaces file:

allow-hotplug eth1
iface eth1 inet dhcp

The second line instructs the interface to obtain an IP via DHCP. The first line loads the interface at boot time.

To apply the changes to a running system, invoke:

ifup eth1

The name for the eth1 interface may vary, use ifconfig -a to list all available interfaces.

EDIT: full /etc/network/interfaces:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug eth1
iface eth1 inet dhcp

How to update snap-store