[libvirt-users] How to configure the container's NIC automatically with an assigned IP address

WANG Cheng D Cheng.d.Wang at alcatel-sbell.com.cn
Sun Sep 28 08:52:05 UTC 2014


Dear Gene,

Thank you for your response.

I want to assign a static IP address to my container, I wonder if I can achieve this by editing the container's /etc/sysconfig/network-scripts/ifcfg-eth0. I tried this, but failed, and eth0 is always not assigned an IP address automatically (my host and guest are fedora19).

Am I missing something? I don't know much about the booting procedure of a container, and how the network NIC is configured during the booting.

The content of container's /etc/sysconfig/network-scripts/ifcfg-eth0 is as follows:

BOOTPROTO="static"

DEVICE="eth0"

TYPE="Ethernet"

ONBOOT="yes"

IPADDR=192.168.128.15

PREFIX=24

GATEWAY=192.168.128.254



With my warmest regards,

Cheng







> Dear all,

>

> I want to run a TCP/IP application automatically after I start the

> container using "virsh -c lxc:/// start mycontainer". Does anybody

> know how to configure the NIC automatically with an assigned IP

> address? I couldn't find useful information from domain XML format

> spec and it only talks how to set the mac address

> (http://libvirt.org/formatdomain.html) .

>

> Your response will be highly appreciated.

>

> Cheng

>

>

Take a look at: http://sandbox.libvirt.org/networking/



Note: Specifying dhcp does not currently work.  I have created a patch to fix that.  See:

https://bugzilla.redhat.com/show_bug.cgi?id=1133686



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20140928/98f7cd14/attachment.htm>


More information about the libvirt-users mailing list