- I have 3 Ubuntu Server VMs on VirtualBox with static IPs on eth1 interface:
192.168.56.2
192.168.56.3
192.168.56.4
I have chosen Adapter 1 as NAT and Adapter 2 as Host Only for all VMs
Now to enable Internet on VMs from Host, I made Adapter1 NAT and on one VM I added line in /etc/networks/interfaces to assign static IP as:
auto eth1 iface eth1 inet static address 192.168.56.2 netmask 255.255.255.0
After adding this for one VM internet works fine.
- But now to enable Internet along with internal network on other VMs I added following on other 2 VMs.
For 192.168.56.3 --->
auto eth1
iface eth1 inet static
address 192.168.56.3
netmask 255.255.255.0
gateway 192.168.56.2
For 192.168.56.4 --->
auto eth1
iface eth1 inet static
address 192.168.56.4
netmask 255.255.255.0
gateway 192.168.56.2
Becuase of above two entries I am able to ping all of the VMs to each other, as I have added 192.168.56.2 as a gateway for other two VMs.
But internet is only accessible from 192.168.56.2 VM, And other 2 VMs are not able to talk to internet.
I do not know what i am missing here, kindly help.
Thanks in Advance !!