The default IP address of Vagrant VM is 10.0.2.15. So you can't connect to a host with IP in range "10.0.2.*". If you do want, you must change the IP address of NAT NIC (network interface card) via the modifyvm command of VBoxManage:
VBoxManage modifyvm <vm-name> --natnet1 "10.3/16"
The
In vagrant we can achieve this by adding "config.customize ["modifyvm", :id, "--natnet1",
config.vm.define "bs" do |bvtserver|
bvtserver.vm.hostname = "bvt-server"
bvtserver.vm.network "private_network", ip: "192.168.50.3",
virtualbox__intnet: "gcptest-network"
bvtserver.vm.provider :virtualbox do |vbox|
vbox.customize ["modifyvm", :id, "--natnet1", "10.3/16"]
end
end