I'm using Ubuntu 18.04.1 LTS in a VirtualBox VM instance. I am building an internal network in accordance with an article on setting up a non-internet accessible, isolated virtual network environment for the purpose of analyzing malware. I require internet on this VM instance to download programs to it for use with my setup. NAT mode is enabled for the VM instance in question, and I was expecting DHCP internet access upon boot up of the instance but no website is reachable.
I defined interfaces in /etc/network/interfaces for the local host and the network gateway(this VM instance). I've also defined a DHCP interface for use with NAT networking: (I've commented out the static enp0s3 interface because it was defined for use with the internal network.)
Contents of /etc/network/interfaces:
auto lo iface lo inet loopback #Internal Network #auto enp0s3 #iface enp0s3 inet static #address 10.0.0.1 #netmask 255.255.255.0 auto eth0 iface eth0 inet dhcp
I defined eth0 as a DHCP interface for use with NAT. This is assuming I needed to do this. I then entered command
sudo ifup eth0 in bash as I did when I defined static interface enp0s3 for use with the internal network, but I received an error stating that interface eth0 cannot be found.
I then checked the connection that was enabled under Network Settings. The connection is defined with a routable IPv4 address: 10.x.x.x. It has DNS resolver set to Google DNS. The Hardware address is filled out. And 'Connect Automatically' is checked. MAC address is defined as enp0s8(I haven't defined this in the interfaces file). DHCP is also set to automatic under the IPv4 settings of the network connection.
I ran command
sudo service network-manager restart, after
sudo service networking restart was giving me an error, but I still can't reach the internet.
ifconfig in bash to check interfaces recognized by the system and eth0 was not among them even though I've defined it in the network configuration file. enp0s8 was however recognized.
After checking the network interfaces recognized by the system using
ip link, I have changed the defined interface name to enp0s8. Brought enp0s8 down with
sudo ifdown enp0s8 and brought it back up with
sudo ifup enp0s8. I noticed the end line of the multi-line output I received:
grep: /etc/resolv.conf: No such file or directory. I checked the enp0s8 interface with
ip link and it read as status UP. I then restarted the network service with
sudo service networking restart and also
sudo service network-manager restart. There is no network connection defined as there was in the Network Settings prior before. Only VPN option.