Hi All,

 

I am a newbie to libvirt.

I am trying to set up a Lxc container using a nat based network.

I am able to create the container and log into it. But I don’t see any interface created by default in the container.

In other words my ifconfig inside the container does not show up any interfaces even if I run ‘ifconfig lo up’ for a loop back interface.

Also I don’t have any dhcp configured in my machine.  

I am not sure why this is happening...

 

These are my network and domain configurations. Any help will be highly appreciated.

 

<network>

   <name>mynetwork</name>

   <forward mode="nat" dev="em2"/>

   <bridge name="virbr1" />

   <ip address="192.168.123.1" netmask="255.255.255.0">

     <dhcp>

        <range start="192.168.123.2" end="192.168.123.10" />

        <host mac="18:03:73:F8:8A:75" name="vm100" ip="192.168.123.3"/>

     </dhcp>

   </ip>

</network>

 

Domain xml:

<domain type='lxc'>

  <name>helloworld</name>

  <memory>102400</memory>

  <os>

      <type>exe</type>

      <init>/bin/sh</init>

  </os>

  <devices>

      <console type='pty'/>

  </devices>

  <interface type='network'>

      <source network='mynetwork'/>

      <mac address="18:03:73:F8:8A:75"/>

     <target dev='vm100'/>

  </interface>

</domain>

 

Regards,

Anita