<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;">
<p>Hi all,</p>
<p><br>
</p>
<p>I was trying to create a network of two debian stretch hosts using vagrant. Please find the Vagrantfile at the end of this mail.<br>
</p>
<p><br>
</p>
<p>Vagrant does not come up properly and only one of the boxes comes up properly.
<br>
</p>
<p>After some analysis found both boxes are getting same IP address due to the Client Identifier(DHCP Option 61) used.</p>
<p><br>
</p>
<p>Systemd DHCP uses DUID as vendor type and using /etc/machineid as key for generating ClientId.</p>
<p>Since two vagrant boxes are created from same base box, both boxes contains same machineid and hence the same Clientid.<br>
</p>
<p><br>
</p>
<p>The solution is to add the following in <i>"/etc/systemd/network/99-dhcp.network"</i><br>
</p>
<div>
<blockquote><i>[DHCP]<br>
ClientIdentifier=mac</i><br>
</blockquote>
The above changes causes systemd to use the mac address as the client identifier instead of the DUID which solves the problem for me.<br>
<p><a href="https://www.freedesktop.org/software/systemd/man/systemd.network.html#ClientIdentifier=" class="OWAAutoLink" id="LPlnk156449" previewremoved="true"><br>
</a></p>
<p>Debian vagrant boxes uses vmdebootstrap script to generate base-box and --enable-dhcp option adds the above configuration.<br>
</p>
<p>Hence mailing to this list. <br>
</p>
<p><br>
</p>
<p>Can you please share your views on this ? <br>
</p>
<p>If this changes are fine, can you please merge this or point me on how to create a patch and submit?<br>
</p>
</div>
<p></p>
<p></p>
<div><br>
<p>Thanks</p>
Mari</div>
<br>
<p></p>
<p><b><u>Reference:</u></b></p>
<p>Systemd uses machineid to generate DUID<u><b></b></u><br>
</p>
<p><a href="https://www.freedesktop.org/software/systemd/man/networkd.conf.html#vendor%20" class="OWAAutoLink" id="LPlnk909489" previewremoved="true">https://www.freedesktop.org/software/systemd/man/networkd.conf.html#vendor%20</a></p>
<p><a href="https://www.freedesktop.org/software/systemd/man/systemd.network.html#ClientIdentifier=" class="OWAAutoLink" id="LPlnk156449" previewremoved="true">https://www.freedesktop.org/software/systemd/man/systemd.network.html#ClientIdentifier=</a></p>
<p><br>
</p>
<p><u><b>Vagrantfile:</b></u></p>
<div><u></u>Vagrant.configure(2) do |config|<br>
<br>
  config.vm.define "stretch1" do |stretch1|<br>
    stretch1.vm.box = "debian/stretch64"<br>
    stretch1.vm.hostname = "stretch1"<br>
<br>
    stretch1.vm.network "private_network",<br>
        :libvirt__tunnel_type => 'udp',<br>
        :libvirt__tunnel_port => '11111',<br>
        :libvirt__tunnel_local_port => '11121',<br>
        :libvirt__iface_name => 'swp1'<br>
  end<br>
<br>
  config.vm.define "stretch2" do |stretch2|<br>
    stretch2.vm.box = "debian/stretch64"<br>
    stretch2.vm.hostname = "stretch2"<br>
<br>
    stretch2.vm.network "private_network",<br>
        :libvirt__tunnel_type => 'udp',<br>
        :libvirt__tunnel_port => '11121',<br>
        :libvirt__tunnel_local_port => '11111',<br>
        :libvirt__iface_name => 'swp1'<br>
  end<br>
end<br>
</div>
<br>
<p><br>
</p>
</div>
</body>
</html>