0

The setup I'm trying to achieve is as follows. We need to be able to access a VBox VM from our public IP. We currently have a really crappy linksys router, but I set it up to forward the external port 8181 to internal port 192.168.1.230:8080 (Linux). 192.168.1.230 is my guest VM that is currently running on host 192.168.1.6 (Linux).

When I point my browser, or wget from the internal network at 192.168.1.230:8080, to the guest VM, it works perfectly. I see the webpage or the wget request come back.

When I point to public_ip:8181, it does not work. It loads for ever and wget hangs with no error response. A tcpdump on the guest shows no packet incoming. Yet, if I change the port range forwarding address from the guest to the host, it works (I did a quick netcat server on host).

Both host and guest iptables are set to accept all on all chains. So I'm wondering if the fact that the packets are coming from the router is being denied somehow. Any advice or help would be greatly appreciated. Vagrant config below.

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "odlVM" do |odlVM|
     odlVM.vm.box = "ubuntu/trusty64"
     config.vm.provider "virtualbox" do |v|
       v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
       v.customize ["modifyvm", :id, "--memory", "2048"]
     end
     odlVM.vm.hostname = "odl-vm"
     odlVM.vm.network "public_network", bridge: "enp5s0f1"
     odlVM.vm.provision :shell, inline: $bootstrap_ubuntu
     odlVM.vm.provision :shell, inline: $install_java
     odlVM.vm.provision :shell, inline: $download_odl
    end
end
0

So I figured it out. I feel kinda dumb for not thinking about it, but the VM setup the default gateway to point to the bridge adapter and not the router. Once I changed that, I was able to access the VM from the external network.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.