I have 2 CentOS 7 guests running in VirtualBox on a Ubuntu host.I want to be able to:Connect using ssh from host to guestDownload/install packages from the Internet on the guest.I currently have following two virtual network interfacesHost Only, mapped as 'enp0s3' on guestNAT, mapped as 'enp0s8' on guestMy current configuration:$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s3TYPE=EthernetBOOTPROTO=noneDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=noNAME=enp0s3UUID=fcd0aa44-9ab7-42e6-a637-52c429727195ONBOOT=yesHWADDR=08:00:27:BE:DB:11IPADDR=192.168.56.102PREFIX=32GATEWAY=192.168.56.1and$ cat /etc/sysconfig/network-scripts/ifcfg-enp0s8HWADDR=08:00:27:A2:03:29TYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noNAME=enp0s8UUID=09acefe7-d513-48f6-b820-0988ac495e5eONBOOT=yesCurrent route info:$ routeKernel IP routing tableDestination     Gateway         Genmask         Flags Metric Ref    Use Ifacedefault         192.168.56.1    0.0.0.0         UG    1024   0        0 enp0s310.0.3.0        0.0.0.0         255.255.255.0   U     0      0        0 enp0s8192.168.56.1    0.0.0.0         255.255.255.255 UH    1024   0        0 enp0s3At this point I can ssh from my Ubuntu host to my CentOS guest but Icannot successfully connect to the Internet:$ wget https://github.com/antirez/redis/archive/3.0.0-rc6.tar.gzResolving github.com (github.com)... 192.30.252.130Connecting to github.com (github.com)|192.30.252.130|:443...Lot of other posts and samples suggested that I remove the default gateway from 'enp0s3'.If I remove the default gateway from 'enp0s3', I cannot ssh from the Ubuntu host to the CentOS guest.How can I make this work?
Enable ssh host to guest & guest Internet on CentOS 7 guest with VirtualBox
centos;ssh;virtualbox;internet;nat
So I finally got it to workI was missing netmask value in the configurationHost only NIC enp0s3TYPE=EthernetBOOTPROTO=staticNAME=enp0s3UUID=71d4200e-199d-4d03-935d-6d2e88c41956DEVICE=enp0s3ONBOOT=yesIPADDR=192.168.56.101NETMASK=255.255.255.0NAT NIC enp0s8HWADDR=08:00:27:49:5A:6CTYPE=EthernetBOOTPROTO=dhcpDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_PEERDNS=yesIPV6_PEERROUTES=yesIPV6_FAILURE_FATAL=noNAME=enp0s8UUID=56cc4f81-d7a4-465a-badb-0b6120a0d62eONBOOT=yesWith above values it works the way I need itssh from host to guestInternet access from guestDB access from host to guest