<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>PHP, the universe and all the rest - Vagrant</title>
    <link>http://www.php-groupies.de/blogs/</link>
    <description>PHP Groupie since 1999 </description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.0.3 - http://www.s9y.org/</generator>
    <pubDate>Sat, 17 Sep 2011 06:35:29 GMT</pubDate>

    <image>
        <url>http://www.php-groupies.de/blogs/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: PHP, the universe and all the rest - Vagrant - PHP Groupie since 1999 </title>
        <link>http://www.php-groupies.de/blogs/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Multiple network adapters in Vagrant VMs</title>
    <link>http://www.php-groupies.de/blogs/archives/39-Multiple-network-adapters-in-Vagrant-VMs.html</link>
            <category>Vagrant</category>
    
    <comments>http://www.php-groupies.de/blogs/archives/39-Multiple-network-adapters-in-Vagrant-VMs.html#comments</comments>
    <wfw:comment>http://www.php-groupies.de/blogs/wfwcomment.php?cid=39</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://www.php-groupies.de/blogs/rss.php?version=2.0&amp;type=comments&amp;cid=39</wfw:commentRss>
    

    <author>nospam@example.com (Hartmut Holzgraefe)</author>
    <content:encoded>
    &lt;p&gt;For testing some stuff related to MySQL Cluster, port binding and having two network interfaces on the same subnet i needed a bit more than my usual &amp;quot;all nodes on localhost&amp;quot; setup. Looking for a reusable solution i this time did not just simply plug several of my old laptops into the same hup but tried to create a &lt;a href=&quot;http://vagrantup.com/&quot; onclick=&quot;window.open(this.href, &#039;_blank&#039;); return false;&quot;&gt;Vagrant&lt;/a&gt; setup for this.&lt;/p&gt;

&lt;p&gt;This quickly lead to the question how to define multiple network adapters per Vagrant VM. The manual is not too clear about this yet, and the key piece of information is not yet to be seen in the network section but is hiding in the section on port forwarding: the &lt;b&gt;:adapter&lt;/b&gt; option.&lt;/p&gt;

&lt;p&gt;So to define multiple adapters you need to add &lt;b&gt;:adapter =&amp;gt; $value&lt;/b&gt; options on each of the &lt;b&gt;vm.network&lt;/b&gt; lines, with &lt;b&gt;$value&lt;/b&gt; counting up from one, e.g.:&lt;/p&gt;

&lt;p&gt;config.vm.network(&amp;quot;33.33.33.10&amp;quot;, :adapter =&amp;gt; 1);&lt;br /&gt;
    config.vm.network(&amp;quot;33.33.33.20&amp;quot;, :adapter =&amp;gt; 2);&lt;/p&gt;

&lt;p&gt;In my case i need both adapters to be on the same IP subnet. Vagrant (or VirtualBox?) is not clever enough for this yet and will create two distinct host-only networks for this, routing and binding works as expected though as the kernels inside the VMs do not care about (and are not even aware of) this.&lt;/p&gt;

 
    </content:encoded>

    <pubDate>Sat, 17 Sep 2011 08:35:29 +0200</pubDate>
    <guid isPermaLink="false">http://www.php-groupies.de/blogs/archives/39-guid.html</guid>
    
</item>

</channel>
</rss>