<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>
<div style="font-family: Calibri,sans-serif; font-size: 11pt;"><br>
<br>
Sent from my Windows Phone</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">From:
</span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:stevekadams@outlook.com">Steve Adams</a></span><br>
<span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Sent:
</span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">‎4/‎29/‎2016 12:21 PM</span><br>
<span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">To:
</span><span style="font-family: Calibri,sans-serif; font-size: 11pt;"><a href="mailto:mark.haney@vifprogram.com">Mark Haney</a></span><br>
<span style="font-family: Calibri,sans-serif; font-size: 11pt; font-weight: bold;">Subject:
</span><span style="font-family: Calibri,sans-serif; font-size: 11pt;">RE:Macvlan setup issues</span><br>
<br>
</div>
<div>
<div>
<div style="font-family:Calibri,sans-serif; font-size:11pt">The simplest way that I have found to accomplish this is with a simple bridge. I am assuming that you are using Ubuntu and have an Ethernet connection on the host. The bridge can easily be setup in
 /etc/network/ interfaces (there is tons of documentation). The resulting br0, or whatever you chose to call it, would then be used as the bridge device in containers config. You can than set up in the containers /etc/network/interfaces to have IP assigned
 by the router DHCP  or assign your own static IP in the same subnet.<br>
Keep in mind that I have only done this with nested containers as I use a laptop primarily and wifi adds a level of complexity that I have not felt the need to deal with. But it did work perfectly in assigning IPs to the nested containers in the same subnet
 as the host container.<br>
<br>
Sent from my Windows Phone</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">From:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:mark.haney@vifprogram.com">Mark Haney</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Sent:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt">‎4/‎28/‎2016 10:02 AM</span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">To:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Subject:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt">[lxc-users] Macvlan setup issues</span><br>
<br>
</div>
<div dir="ltr"><span style="font-size:12.8px">Hi all.  I'm really new to LXC/LXD as well as with macvlan setup, so bear with me.  I'm having all kinds of trouble getting the macvlan setup to work on my Ubuntu 16.04 VM.  The documentation isn't terribly clear,
 or at least it seems to be missing something that is keeping my containers from being accessible inside my office network directly.  I'm hoping it's something simple, but as I've run out of good Google searches, I'm not sure what else to try.  Here's my problem
 (and setup):</span>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">I've been able to get containers of various distros running file with bridging, but I'd like to be able to access them as part of my LAN directly. </div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><br>
The IP of the 16.04 host:  10.42.204.50 (gw 10.42.204.1)<br>
</div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px">Now, I went through the docs to setup macvlans as this appeared to be the simplest (best?) method of setting up the containers to access my LAN.  So, I ran dpkg-reconfigure lxd and removed the bridging.  Then set the macvlan according
 to the <a href="https://www.stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/" target="_blank">docs</a>: </div>
<div style="font-size:12.8px"><br>
</div>
<div style="font-size:12.8px"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">lxc profile device set default eth0 nictype macvlan</span><br>
</span></div>
<div style="font-size:12.8px"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">lxc profile device set default eth0 parent ens160</span><br>
</span></div>
<div style="font-size:12.8px"><span style="font-family:monospace"><span style="color:rgb(0,0,0)"><br>
</span></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">The second command might not be correct, as the documentation doesn't specify precisely what the 'parent' is, though I believe it's the host interface name
 (in my case ens160). </font><font face="monospace"> </font><font face="arial, helvetica, sans-serif">Regardless, this seems to have worked, at least partly because, when I launched an image of Ubuntu 15.10, the eth0 interface was correctly given a DHCP address
 from my LAN (10.42.204.153) and a default gateway (10.42.204.1).  </font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">However, I cannot ping anything on my network from the container with a 'Destination Host Unreachable' message.  IP forwarding is enabled, but I don't think
 I need that for this setup.  The problem is, none of the docs say I need to do anything else to get macvlans working, which is why this is so frustrating.  Is this just a case of I'm missing something the docs assume I have knowledge of?  Or an actual problem.
  </font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">I'm no Linux slouch, I've been using them since the RH3 days, but macvlans are new to me, so is LXD.  </font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">Any ideas?  </font></span></div>
<div style="font-size:12.8px"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br>
</font></span></div>
<div><br>
</div>
-- <br>
<div class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<p><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt">Mark Haney ::: Senior Systems Engineer</span></p>
<b><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt">VIF</span></b><span><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt"> </span><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt"><b>International Education</b></span></span><br>
<span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt">P.O. Box 3566 ::: Chapel Hill, N.C. 27515 ::: USA</span>
<div><span style="font-size:10pt"><a><span style="color:rgb(17,85,204); font-family:Arial">919-265-5006</span></a></span><span><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt"> </span></span><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt">office</span></div>
<div><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt"><br>
</span><span style="color:rgb(51,51,51); font-family:Arial; font-size:10pt; background-color:white">Global learning for all.</span><br>
<a href="http://www.viflearn.com" target="_blank" style="font-family:Arial; font-size:10pt">www.viflearn.com</a>
<div><span style="background:white; font-family:Arial; font-size:10pt">Find VIF on<span> </span></span><span style="font-family:Arial; font-size:10pt"><a href="http://facebook.com/VIFInternationalEducation" target="_blank"><span style="background:white; color:rgb(17,85,204)">Facebook</span></a></span><span><span style="background:white; color:rgb(34,34,34); font-family:Arial; font-size:10pt"> </span></span><span style="background:white; color:rgb(34,34,34); font-family:Arial; font-size:10pt">|<span> </span></span><span><span style="background:white; color:rgb(17,85,204); font-family:Arial; font-size:10pt"><a href="https://twitter.com/vifglobaled" target="_blank">Twitter</a> </span></span><span style="background:white; font-family:Arial; font-size:10pt">|<span> </span></span><span style="font-family:Arial; font-size:10pt"><span style="background:white; color:rgb(17,85,204)"><a href="http://www.linkedin.com/company/vif-international-education" target="_blank">LinkedIn</a></span></span>
<p><span style="color:black; font-family:Arial; font-size:10pt">Recognized as a<span> </span><a href="http://bestfortheworld.bcorporation.net/" target="_blank"><span style="color:rgb(17,85,204)">‘Best for the World’</span></a><span> </span>B Corp!</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>