[Lxc-users] Running LXC on a pxelinux machine

Gus Power gus at energizedwork.com
Wed May 4 08:12:12 UTC 2011


Hi Daniel,

> Do you want to run containers on your diskless host ?

Yes exactly. The lxc containers on the diskless host come up fine and
can be reached from other hosts on the network. The issue I have is that
the host itself cannot ping the containers that it is running.

Some details:
> ifconfig
br0       Link encap:Ethernet  HWaddr 00:18:37:04:c1:88
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:456233 errors:0 dropped:22914 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:23925950 (22.8 MiB)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:18:37:04:c1:88
          inet addr:192.168.1.213  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1405956 errors:0 dropped:40 overruns:0 frame:0
          TX packets:541241 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1078882115 (1.0 GiB)  TX bytes:64571866 (61.5 MiB)
          Interrupt:42 Base address:0xa000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:3200 (3.1 KiB)  TX bytes:3200 (3.1 KiB)

vethNFweO Link encap:Ethernet  HWaddr 96:73:0c:d0:71:f5
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:45090 errors:0 dropped:0 overruns:0 frame:0
          TX packets:548911 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3814374 (3.6 MiB)  TX bytes:163615712 (156.0 MiB)

vethU0zyY Link encap:Ethernet  HWaddr 92:61:42:84:ec:5a
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:339069 errors:0 dropped:0 overruns:0 frame:0
          TX packets:686545 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:43984153 (41.9 MiB)  TX bytes:648025709 (618.0 MiB)

> brctl show
bridge name	bridge id		STP enabled	interfaces
br0		8000.00183704c188	no		eth0
							vethNFweOZ
							vethU0zyYA
> iptables --list
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

> ebtables list
Bridge table: filter

Bridge chain: INPUT, entries: 0, policy: ACCEPT

Bridge chain: FORWARD, entries: 0, policy: ACCEPT

Bridge chain: OUTPUT, entries: 0, policy: ACCEPT

The two containers (veth interfaces vethNFweOZ and vethU0zyYA) have IP
addresses of 192.168.1.138 and 192.168.1.198 respectively and can be
reached by other machines on the network. When I try to ping either of
these containers from the host I get 'Destination Host Unreachable' and
the dropped RX packet count goes up on the 'br0' interface. Some advice
about how to correctly configure the routing would be great!

Thanks for your help,

Gus.


On 05/04/11 16:13, Daniel Lezcano wrote:
> On 04/05/2011 09:49 AM, Gus Power wrote:
>> Hi,
>>
>> I've got a pxelinux boot configuration with a remote NFS root filesystem
>> and was wondering if anyone out there has tried running lxc on such a
>> configuration. I'm having difficulty getting the host machine to talk
>> with the running lxc containers.
>>
>> I managed to get a local bridge interface up and running without hanging
>> the host machine using the following:
>>
>> #Copy to /tmp tmpfs to avoid NFS hang
>> cp /sbin/brctl /tmp
>> cp /sbin/ifconfig /tmp
>>
>> /tmp/brctl
>> /tmp/ifconfig
>> /tmp/brctl addbr br0
>> /tmp/ifconfig br0 up
>> /tmp/brctl setfd br0 0
>> /tmp/brctl stp br0 off
>> /tmp/brctl addif br0 eth0
>> /tmp/ifconfig eth0 192.168.1.68 netmask 255.255.255.0
>> /tmp/brctl show
>>
>> > From there I can create lxc container instances; other machines on the
>> network can talk to them but the host machine is unable to do so. I
>> suspect I need to update the bridge tables (using ebtables) in some way.
>>
>> Any help greatly appreciated!
> 
> Hi Gus,
> 
> I am not sure to understand the use case. Can you elaborate ?
> 
> Do you want to run containers on your diskless host ?
> or
> Do you want to have your diskless host to run inside a container ?
> 
> I did recently a configuration with a tftp server running inside a
> container and a pxe host to boot inside it.
> It was working like a charm. Maybe it is what you are looking for ?




More information about the lxc-users mailing list