G
G
groznov2016-04-12 11:42:18
SSH
groznov, 2016-04-12 11:42:18

Vagrant port tunnel from host machine to guest machine?

There is a question how to forward a port from the host machine to the guest machine, namely
at the moment I am using:
vagrant ssh -- -R 3307:localhost:3306
- the problem is that there are timeouts
- each time you need to keep the terminal open
- a limited number of ports are forwarded
- the host machine is Ubuntu 14
- the guest machine is Centos 7
I see that there is a need
- in connecting from the guest machine to the host machine as transparently and easily
as possible - the ability to use the host machine as an ssh jump host
- ;it is advisable not to hardcode IPs strictly
- the initiator should be the guest machine to forward the port to itself
Tell me where to look and what mechanisms are there for this.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vlad Chernik, 2016-04-28
@vladchernik

Port forwarding must be configured in the Vagrantfile.
For example, config.vm.network "forwarded_port", guest: 3000, host: 3000
Don't forget to vagrant reload after making changes
More -- https://www.vagrantup.com/docs/getting-started/net...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question