I'm running Android within Virtual Box and I'm trying to configure NAT in the host machine (Ubuntu Linux) so that the VM has access to the Internet.
In the Android guest I did:
ifconfig eth0 192.168.99.100
ip route add default via 192.168.99.1
Below is the current configuration taken from a screenshot:
As you can see, when I try to ping 8.8.8.8 I get the error "connect: Network is unreachable". However, there is a default gateway set and the IP address is the proper one: in the host machine, the vboxnet0 interface is 192.168.99.1 (which in this case I will make act as a router).
Here is a screenshot with the VirtualBox network configuration:
I know I have to deal with iptables to make one net reach the other through the host machine, but I can't get there until I fix the issue described above (network unreachable).