0

I'm duplicating my question from superuser, but I want to know why it doesn't work. Let me explain, I have a server on Ubuntu 22 where I have MongoDB running. In this server I created a vagrant vm where Ubuntu run with nginx and a python program. I set the VM like this

Vagrant.configure("2") do |config|

    config.vm.hostname = "nginx"

    config.vm.box = "ubuntu/focal64"

    config.vm.network "public_network", ip:"192.168.1.252",
    bridge: "eno1"
  config.vm.provision "shell",
    run: "always",
    inline: "route add default gw 192.168.1.1"
  config.vm.provision "shell",
    run: "always",
    inline: "ip route del default via 10.0.2.2 || true"


         config.vm.define "nginx-box"

    config.vm.provider "virtualbox" do |vb|
      vb.memory = "1024"
    end

end

When vagrant up everything's work, I can access my database on port 27017 and use it. But after, I will say, 20 min, I got connection refused 111. I try to telnet the port to see if it works, it gave me : Unable to connect to remote host: Connection refused But from my computer per example, I can do it and didn't get refused. Do you have any idea?

Felix
  • 1

0 Answers0