0

Following this link, I configured 2 network interfaces using VirtualBox for a Debian 9 Guest.

  1. Host-Only-Adapter without DHCP to give the VM a static IP Address.

    In /etc/network/interfaces configured like this:

    auto enp0s3 
    iface enp0s3 inet static
    address: 192.168.57.5
    network: 192.168.57.0
    netmask: 255.255.255.0
    gateway: 192.168.57.1
    

    I can access the VM using SSH from the Host using this IP Address. This interface seems to work as intended.

  2. NAT Adapter

    In /etc/network/interfaces configured like this:

    auto enp0s8
    iface enp0s8 inet dhcp
    

    I expected to be able to access the Internet from the Host using this interface. It is not working.

Here is the output of ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:64:4a:3b brd ff:ff:ff:ff:ff:ff
    inet 192.168.57.5/24 brd 192.168.57.255 scope global enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe64:4a3b/64 scope link 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:41:71:e2 brd ff:ff:ff:ff:ff:ff
    inet 10.0.3.15/24 brd 10.0.3.255 scope global enp0s8
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe41:71e2/64 scope link 
       valid_lft forever preferred_lft forever
Anton
  • 3
  • 3

1 Answers1

0

You have a problem with two gateways. Remove gateway from enp0s3

Yakim
  • 162
  • 2