0

I have installed a CLI Debian 3.16.7 as guest inside VirtualBox 5.0.24 on a Ubuntu-Gnome 16.04 Host. I set up the network to bridged network named wlp4s0 on the vm preferences because I want to have have an interconnection between several virtual machines later and a connection to the internet.
Additionally every vm shall have an own static IP. So changed /etc/network/interfaces on the guest to

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

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
auto eth0
iface eth0 inet static
   address 192.168.1.10
   netmask 255.255.255.0

Pinging and building up ssh-connections through the network is successful (Guest->Host, Host->Guest, Guest->other Computer). But pinging to the internet fails. The internet was reachable with the NAT vm network set up before modifying /etc/network/interfaces.

What could be the reason for it?


Edit regarding @MarkoPolo:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

Try to reach a website:

~$ wget http://www.flugzeuginfo.net/acimages/dh104_kp.jpg
--2016-08-20 17:09:06--  http://www.flugzeuginfo.net/acimages/dh104_kp.jpg
Resolving www.flugzeuginfo.net (www.flugzeuginfo.net)... failed: Name or service not known.
wget: unable to resolve host address ‘www.flugzeuginfo.net’

ifconfig -a
[sudo] password for ros: 
eth0      Link encap:Ethernet  HWaddr xxxxx
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: xxxxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:577 errors:0 dropped:0 overruns:0 frame:0
          TX packets:332 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:67163 (65.5 KiB)  TX bytes:39453 (38.5 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
8
  • You have not specified a default gateway in your /etc/network/interfaces file. Commented Aug 20, 2016 at 14:21
  • @MarkoPolo I add gateway 192.168.1.1 below netmask but it still be the same.
    – Alex44
    Commented Aug 20, 2016 at 14:52
  • Can you edit your original post to include the output of 'route -n'. Commented Aug 20, 2016 at 14:55
  • That all looks correct. Is it just pings that are failing? Can you wget or curl a website from your guest? Commented Aug 20, 2016 at 15:04
  • @MarkoPolo done - it doesn't work. Is it possible that a Firewall blocks the guest?
    – Alex44
    Commented Aug 20, 2016 at 15:11

1 Answer 1

1

The resolution for this issue was to ensure /etc/network/interfaces was populated correctly. In particular, the gateway and dns-nameservers attributes needed to be set. The final result was:

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

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
auto eth0
iface eth0 inet static
   address 192.168.1.10
   netmask 255.255.255.0
   gateway 192.168.1.1
   dns-nameservers 8.8.8.8
1
  • and as you say: The DNS-nameserver-address in /etc/resolv.conf shall be the same.
    – Alex44
    Commented Aug 20, 2016 at 18:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .