Add documentation for port command
This commit is contained in:
parent
050f8d4d71
commit
b4371725af
|
@ -104,6 +104,7 @@
|
|||
<li<%= sidebar_current("cli-login") %>><a href="/v2/cli/login.html">login</a></li>
|
||||
<li<%= sidebar_current("cli-package") %>><a href="/v2/cli/package.html">package</a></li>
|
||||
<li<%= sidebar_current("cli-plugin") %>><a href="/v2/cli/plugin.html">plugin</a></li>
|
||||
<li<%= sidebar_current("cli-port") %>><a href="/v2/cli/port.html">port</a></li>
|
||||
<li<%= sidebar_current("cli-powershell") %>><a href="/v2/cli/powershell.html">powershell</a></li>
|
||||
<li<%= sidebar_current("cli-provision") %>><a href="/v2/cli/provision.html">provision</a></li>
|
||||
<li<%= sidebar_current("cli-rdp") %>><a href="/v2/cli/rdp.html">rdp</a></li>
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
page_title: "vagrant port - Command-Line Interface"
|
||||
sidebar_current: "cli-port"
|
||||
---
|
||||
|
||||
# Port
|
||||
|
||||
**Command: `vagrant port`**
|
||||
|
||||
The port command displays the full list of guest ports mapped to the host
|
||||
machine ports:
|
||||
|
||||
```
|
||||
$ vagrant port
|
||||
22 (guest) => 2222 (host)
|
||||
80 (guest) => 8080 (host)
|
||||
```
|
||||
|
||||
In a multi-machine Vagrantfile, the name of the machine must be specified:
|
||||
|
||||
```
|
||||
$ vagrant port my-machine
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
* `--guest PORT` - This displays just the host port that corresponds to the
|
||||
given guest port. If the guest is not forwarding that port, an error is
|
||||
returned. This is useful for quick scripting, for example:
|
||||
|
||||
$ ssh -p $(vagrant port --guest 22)
|
||||
|
||||
* `--machine-readable` - This tells Vagrant to display machine-readable output
|
||||
instead of the human-friendly output. More information is available in the
|
||||
[machine-readable output](/v2/cli/machine-readable.html) documentation.
|
Loading…
Reference in New Issue