Vagrant port forwarding problem

M312, when starting vargrant (vagrant up) got error on port forwarding:

==> m312: Clearing any previously set forwarded ports…
Vagrant cannot forward the specified ports on this VM, since they
would collide with some other application that is already listening
on these ports. The forwarded port to 30000 is already in use
on the host machine.

Looks like error is about this forwarding:

config.vm.network “forwarded_port”, guest: 30000, host: 30000

netstat -an says nothing about listening ports 30000, 30001,30002.
I believe, reason is i’m using vagrant on corporate machine, so security policy forbid me from creating listening sockets on outside interfaces.
Thus, adding host_ip: “localhost” allows me to start VM.

Question is - are listening ports 30000, 30001,30002 really necessary of every interface?
Are connections from outside to these ports supposed to be used during this cource?

Hi @Vladislav_93456,

You can specify other ports instead of 30000, 30001, 30002. You can change this configuration in Vagrantfile. These ports act as common interface between your vagrant box and local machine. Please refer to the following post:

Please let me know, if you have any questions.

Thanks,
Sonali

Thank You, Sonali!
So, port forwarding only to local interface is sufficient. It is good.