summaryrefslogtreecommitdiff
path: root/devdocs/vagrant/networking%2Fbasic_usage.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/vagrant/networking%2Fbasic_usage.html
new repository
Diffstat (limited to 'devdocs/vagrant/networking%2Fbasic_usage.html')
-rw-r--r--devdocs/vagrant/networking%2Fbasic_usage.html11
1 files changed, 11 insertions, 0 deletions
diff --git a/devdocs/vagrant/networking%2Fbasic_usage.html b/devdocs/vagrant/networking%2Fbasic_usage.html
new file mode 100644
index 00000000..1b24e0f6
--- /dev/null
+++ b/devdocs/vagrant/networking%2Fbasic_usage.html
@@ -0,0 +1,11 @@
+<h1 id="basic-usage-of-networking"> Basic Usage of Networking </h1> <p>Vagrant offers multiple options for how you are able to connect your guest machines to the network, but there is a standard usage pattern as well as some points common to all network configurations that are important to know.</p> <h2 id="configuration"> Configuration </h2> <p>All networks are configured within your <a href="../vagrantfile/index">Vagrantfile</a> using the <code>config.vm.network</code> method call. For example, the Vagrantfile below defines some port forwarding:</p> <div class="highlight"><pre class="highlight ruby" data-language="ruby">Vagrant.configure("2") do |config|
+ # ...
+ config.vm.network "forwarded_port", guest: 80, host: 8080
+end
+</pre></div>
+<p>Every network type has an identifier such as <code>"forwarded_port"</code> in the above example. Following this is a set of configuration arguments that can differ for each network type. In the case of forwarded ports, two numeric arguments are expected: the port on the guest followed by the port on the host that the guest port can be accessed by.</p> <h2 id="multiple-networks"> Multiple Networks </h2> <p>Multiple networks can be defined by having multiple <code>config.vm.network</code> calls within the Vagrantfile. The exact meaning of this can differ for each <a href="../providers/index">provider</a>, but in general the order specifies the order in which the networks are enabled.</p> <h2 id="enabling-networks"> Enabling Networks </h2> <p>Networks are automatically configured and enabled after they've been defined in the Vagrantfile as part of the <code>vagrant up</code> or <code>vagrant reload</code> process.</p><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; 2010&ndash;2018 Mitchell Hashimoto<br>Licensed under the MPL 2.0 License.<br>
+ <a href="https://www.vagrantup.com/docs/networking/basic_usage.html" class="_attribution-link">https://www.vagrantup.com/docs/networking/basic_usage.html</a>
+ </p>
+</div>