[Lxc-users] Lxc-users Digest, Vol 24, Issue 2
nishant mungse
nishantmungse at gmail.com
Mon Dec 5 06:07:55 UTC 2011
On Mon, Dec 5, 2011 at 11:36 AM, nishant mungse <nishantmungse at gmail.com>wrote:
>
>
> On Mon, Dec 5, 2011 at 11:06 AM, <lxc-users-request at lists.sourceforge.net>wrote:
>
>> Send Lxc-users mailing list submissions to
>> lxc-users at lists.sourceforge.net
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> https://lists.sourceforge.net/lists/listinfo/lxc-users
>> or, via email, send a message with subject or body 'help' to
>> lxc-users-request at lists.sourceforge.net
>>
>> You can reach the person managing the list at
>> lxc-users-owner at lists.sourceforge.net
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Lxc-users digest..."
>>
>>
>> Today's Topics:
>>
>> 1. Re: LXC Container: Network Configuration
>> (Patrick Kevin McCaffrey)
>> 2. Re: LXC Container: Network Configuration (Gordon Henderson)
>> 3. How assign the IP address of containers sequentially.
>> (nishant mungse)
>> 4. Re: How assign the IP address of containers sequentially.
>> (Gordon Henderson)
>> 5. Re: How assign the IP address of containers sequentially.
>> (J?kel)
>> 6. Problems on ArchLinix (John)
>> 7. how to make changes in conf file (nishant mungse)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Thu, 1 Dec 2011 11:33:57 -0600 (CST)
>> From: Patrick Kevin McCaffrey <pkm at uwm.edu>
>> Subject: Re: [Lxc-users] LXC Container: Network Configuration
>> To: Gordon Henderson <gordon at drogon.net>
>> Cc: Linux Containers List <lxc-users at lists.sourceforge.net>
>> Message-ID:
>> <
>> 2074438346.600771.1322760837314.JavaMail.root at mail18.pantherlink.uwm.edu>
>>
>> Content-Type: text/plain; charset=utf-8
>>
>>
>>
>> ----- Original Message -----
>> From: "Gordon Henderson" <gordon at drogon.net>
>> To: "Linux Containers List" <lxc-users at lists.sourceforge.net>
>> Sent: Thursday, December 1, 2011 7:49:04 AM
>> Subject: Re: [Lxc-users] LXC Container: Network Configuration
>>
>> On Tue, 29 Nov 2011, Patrick Kevin McCaffrey wrote:
>>
>> > Alright, I've been struggling with LXC for several days now. I can't
>> > seem to get a container configured properly. I originally was trying to
>> > set up a few Ubuntu Oneiric containers, but am now just trying to get a
>> > Debian template container set up using the lxc-debian script that comes
>> > with lxc.
>> >
>> > The container runs, and I can log in to it via SSH from the host
>> > machine.
>> >
>> > The host machine also runs as my router, as it has a 4 port ethernet
>> > card (four subnets, DHCP running on each). However, I cannot SSH into
>> > my container from another computer on the local network -- it is only
>> > accessible via the host machine. If I try to SSH from another machine,
>> > it says "no route to host." Additionally, the container does not have
>> > internet access. If I try to ping, use wget or apt, I get connection
>> > errors. I'm assuming these two problems are related.
>> >
>> > I've got my local network set up using Shorewall, and it works
>> > reasonably well for everything else (the entire local network is on the
>> > "local" zone, which is completely open). The host's
>> > etc/network/interfaces file sets up the five ethernet interfaces
>> > (eth0-eth3 with static IPs and eth4 with DHCP from the cable modem) as
>> > well as the bridge for lxc. The following is my bridge entry:
>> >
>> > #bridge for LXC iface br0 inet static
>> > address 192.168.80.1
>> > netmask 255.255.255.0
>> > broadcast 192.168.80.255
>> > network 192.168.80.0
>> > bridge_ports eth1
>> >
>> > I had some other options designated, but have been playing with my
>> > configurations to see if I can get a better result.
>> >
>> > Also, what is the correct method to bring up my bridge? It seems like
>> > when I run /etc/init.d/netwokring restart, it will come up as it should
>> > sometimes, but sometimes gives me problems, like "eth1 is not a slave of
>> > br0."
>> >
>> > The container appears to run as it should, but I really need it to have
>> > proper networking to fulfil my needs. Any ideas?
>>
>> I've read the other comments so-far - just one question (and I may have
>> missed it in the other emails):
>>
>> Does the container actually have a default route setup?
>>
>> However I also have a similar setup - 5-port Linux box acting as a router
>> and LXC host, althouh I run PPPoE via an ADSL modem to the ISP. It runs
>> Debian which has very similar config files to what you're presenting -
>> maybe shorewall is based on Debian? (I've no idea - never looked at it)
>>
>> In the host, my /etc/network/interfaces for the bridge unit:
>>
>> auto eth1
>> iface eth1 inet manual
>>
>> auto br0
>> iface br0 inet static
>> bridge_ports eth1
>> bridge_stp off
>> bridge_fd 0
>> bridge_maxwait 0
>> address 81.31.100.110
>> network 81.31.100.104
>> broadcast 81.31.100.111
>> netmask 255.255.255.248
>>
>> My eth1 is currently connected to a single PC (81.31.100.107 but that's
>> not really relevant here)
>>
>> I don't need to do any brctl stuff as Debians network scripts does all
>> that for me, however it does sometimes get confused if I bring the
>> interface down & up again. (or manually fiddle without using ifup/ifdown)
>>
>> My contaners config file looks like:
>>
>> lxc.utsname = bell
>> lxc.network.type = veth
>> lxc.network.flags = up
>> lxc.network.link = br0
>> lxc.network.hwaddr = 00:00:fc:00:00:01
>> lxc.network.ipv4 = 81.31.100.108/29
>> lxc.network.name = eth0
>>
>> etc.
>>
>>
>> and in the startup script of the contaner (/etc/init.d/rcS) I have:
>>
>> route add default gw 81.31.100.105
>>
>> and that's it. Just works...
>>
>> So the only thing I've not seen from you is your container having a
>> default route...
>>
>> What does
>>
>> netstat -rn (or route -n, but old habits die hard)
>>
>> in the container show?
>>
>>
>> Gordon
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>>
>> ----- Original Message -----
>> From: "Gordon Henderson" <gordon at drogon.net>
>> To: "Linux Containers List" <lxc-users at lists.sourceforge.net>
>> Sent: Thursday, December 1, 2011 7:49:04 AM
>> Subject: Re: [Lxc-users] LXC Container: Network Configuration
>>
>> On Tue, 29 Nov 2011, Patrick Kevin McCaffrey wrote:
>>
>> > Alright, I've been struggling with LXC for several days now. I can't
>> > seem to get a container configured properly. I originally was trying to
>> > set up a few Ubuntu Oneiric containers, but am now just trying to get a
>> > Debian template container set up using the lxc-debian script that comes
>> > with lxc.
>> >
>> > The container runs, and I can log in to it via SSH from the host
>> > machine.
>> >
>> > The host machine also runs as my router, as it has a 4 port ethernet
>> > card (four subnets, DHCP running on each). However, I cannot SSH into
>> > my container from another computer on the local network -- it is only
>> > accessible via the host machine. If I try to SSH from another machine,
>> > it says "no route to host." Additionally, the container does not have
>> > internet access. If I try to ping, use wget or apt, I get connection
>> > errors. I'm assuming these two problems are related.
>> >
>> > I've got my local network set up using Shorewall, and it works
>> > reasonably well for everything else (the entire local network is on the
>> > "local" zone, which is completely open). The host's
>> > etc/network/interfaces file sets up the five ethernet interfaces
>> > (eth0-eth3 with static IPs and eth4 with DHCP from the cable modem) as
>> > well as the bridge for lxc. The following is my bridge entry:
>> >
>> > #bridge for LXC iface br0 inet static
>> > address 192.168.80.1
>> > netmask 255.255.255.0
>> > broadcast 192.168.80.255
>> > network 192.168.80.0
>> > bridge_ports eth1
>> >
>> > I had some other options designated, but have been playing with my
>> > configurations to see if I can get a better result.
>> >
>> > Also, what is the correct method to bring up my bridge? It seems like
>> > when I run /etc/init.d/netwokring restart, it will come up as it should
>> > sometimes, but sometimes gives me problems, like "eth1 is not a slave of
>> > br0."
>> >
>> > The container appears to run as it should, but I really need it to have
>> > proper networking to fulfil my needs. Any ideas?
>>
>> I've read the other comments so-far - just one question (and I may have
>> missed it in the other emails):
>>
>> Does the container actually have a default route setup?
>>
>> However I also have a similar setup - 5-port Linux box acting as a router
>> and LXC host, althouh I run PPPoE via an ADSL modem to the ISP. It runs
>> Debian which has very similar config files to what you're presenting -
>> maybe shorewall is based on Debian? (I've no idea - never looked at it)
>>
>> In the host, my /etc/network/interfaces for the bridge unit:
>>
>> auto eth1
>> iface eth1 inet manual
>>
>> auto br0
>> iface br0 inet static
>> bridge_ports eth1
>> bridge_stp off
>> bridge_fd 0
>> bridge_maxwait 0
>> address 81.31.100.110
>> network 81.31.100.104
>> broadcast 81.31.100.111
>> netmask 255.255.255.248
>>
>> My eth1 is currently connected to a single PC (81.31.100.107 but that's
>> not really relevant here)
>>
>> I don't need to do any brctl stuff as Debians network scripts does all
>> that for me, however it does sometimes get confused if I bring the
>> interface down & up again. (or manually fiddle without using ifup/ifdown)
>>
>> My contaners config file looks like:
>>
>> lxc.utsname = bell
>> lxc.network.type = veth
>> lxc.network.flags = up
>> lxc.network.link = br0
>> lxc.network.hwaddr = 00:00:fc:00:00:01
>> lxc.network.ipv4 = 81.31.100.108/29
>> lxc.network.name = eth0
>>
>> etc.
>>
>>
>> and in the startup script of the contaner (/etc/init.d/rcS) I have:
>>
>> route add default gw 81.31.100.105
>>
>> and that's it. Just works...
>>
>> So the only thing I've not seen from you is your container having a
>> default route...
>>
>> What does
>>
>> netstat -rn (or route -n, but old habits die hard)
>>
>> in the container show?
>>
>>
>> Gordon
>>
>>
>> ------------------------------------------------------------------------------
>>
>>
>>
>> Thanks a bunch, Gordon. I ran route -n inside the container, as saw
>> there was no gateway. Assigning 192.168.80.1 (the address of br0) as the
>> default gateway inside the container works beautifully. I can now apt-get
>> from the container, and ping it from another subnet too. I had been
>> playing with the "gateway" setting in /etc/network/interfaces on the host
>> machine, but it seems like everything worked (as far as the machine acting
>> as my router, and each subnet having access to the Internet and each other)
>> without defining a default gateway, so it totally slipped my mind to try
>> assigning one inside the container.
>>
>> Again, thank a lot. This mailing list has proved to be extremely helpful
>> over the last few days.
>>
>> Pat
>>
>>
>>
>> ------------------------------
>>
>> Message: 2
>> Date: Thu, 1 Dec 2011 18:14:06 +0000 (GMT)
>> From: Gordon Henderson <gordon at drogon.net>
>> Subject: Re: [Lxc-users] LXC Container: Network Configuration
>> To: Linux Containers List <lxc-users at lists.sourceforge.net>
>> Message-ID: <alpine.DEB.2.00.1112011807030.8154 at unicorn.drogon.net>
>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>>
>> On Thu, 1 Dec 2011, Patrick Kevin McCaffrey wrote:
>>
>> > Thanks a bunch, Gordon. I ran route -n inside the container, as saw
>> > there was no gateway. Assigning 192.168.80.1 (the address of br0) as
>> > the default gateway inside the container works beautifully.
>>
>> I think sometimes we overlook the obvious! Glad its going now.
>>
>> > I can now
>> > apt-get from the container, and ping it from another subnet too. I had
>> > been playing with the "gateway" setting in /etc/network/interfaces on
>> > the host machine, but it seems like everything worked (as far as the
>> > machine acting as my router, and each subnet having access to the
>> > Internet and each other) without defining a default gateway, so it
>> > totally slipped my mind to try assigning one inside the container.
>>
>> My containers don't look at /etc/network/* at all during startup - the
>> networing is setup in /etc/init.d/rcS.
>>
>> I'm actually switching to using file-rc in my containers because what the
>> need to do to "boot" is really very minimal and I can then trivially
>> disable things by editing them out of one config file (/etc/runlevel.conf)
>>
>> One other thing you might want to check is the NAT on the host - if you're
>> not careful to exclude each LAN (or bridged vlan) subnet, you can end up
>> sending data through the NAT tables. It may be that smoothwall does this
>> for you, but it's always handy to check.
>>
>> Cheers,
>>
>> Gordon
>>
>>
>>
>> ------------------------------
>>
>> Message: 3
>> Date: Fri, 2 Dec 2011 13:40:34 +0530
>> From: nishant mungse <nishantmungse at gmail.com>
>> Subject: [Lxc-users] How assign the IP address of containers
>> sequentially.
>> To: lxc-users at lists.sourceforge.net,
>> containers at lists.linux-foundation.org
>> Message-ID:
>> <
>> CAHnfO6xrseZjVUfHmCBePCnnRsDxxyKVOSChJyi0cGXvif7BOQ at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Hi,
>>
>> I want the ip address to be assigned in order as the containers are
>> started
>> and not assigned by DHCP. For example :: container1::
>> 193.163.195.01,container2:: 193.163.195.02 like wise if there is
>> container30 :: 193.163.195.30, this should be its ip address.
>>
>> What are changes that are to done in *conf file of lxc* so as to get this
>> kind of address?
>>
>> Plz help me ASAP.
>>
>> Regards,
>> Nishant Mungse
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>>
>> ------------------------------
>>
>> Message: 4
>> Date: Fri, 2 Dec 2011 08:23:27 +0000 (GMT)
>> From: Gordon Henderson <gordon at drogon.net>
>> Subject: Re: [Lxc-users] How assign the IP address of containers
>> sequentially.
>> To: Linux Containers List <lxc-users at lists.sourceforge.net>
>> Message-ID: <alpine.DEB.2.00.1112020821120.8154 at unicorn.drogon.net>
>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>>
>> On Fri, 2 Dec 2011, nishant mungse wrote:
>>
>> > Hi,
>> >
>> > I want the ip address to be assigned in order as the containers are
>> started
>> > and not assigned by DHCP. For example :: container1::
>> > 193.163.195.01,container2:: 193.163.195.02 like wise if there is
>> > container30 :: 193.163.195.30, this should be its ip address.
>> >
>> > What are changes that are to done in *conf file of lxc* so as to get
>> this
>> > kind of address?
>> >
>> > Plz help me ASAP.
>>
>> According to the file manual
>>
>> man lxc.conf
>>
>> you set lxc.network.ipv4 to the IP address and network prefix.
>>
>> e.g.
>>
>> lxc.network.ipv4 = 193.163.195.1/24
>>
>>
> This is not working means I am not getting the ip address in sequence. Is
there any another solution to this??
>
>
>
>
>> Gordon
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 5
>> Date: Fri, 2 Dec 2011 09:31:02 +0100
>> From: J?kel, Guido <G.Jaekel at dnb.de>
>> Subject: Re: [Lxc-users] How assign the IP address of containers
>> sequentially.
>> To: <lxc-users at lists.sourceforge.net>
>> Message-ID:
>> <6DA97EFF2763174B8BDC409CA19729840EC0F74D at dbf-ex.AD.DDB.DE>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Dear Nishant,
>>
>> why do you not to use DHCP with a static configurations for this hosts?
>>
>> If you realy don't rely on DHCP, you may use something like
>>
>> lxc-start ... -n $CONTAINERNAME -s
>> lxc.network.ipv4=193.163.195.${CONTAINERNAME#container}
>>
>> for the containerN startup.
>>
>
> lxc-start ... -n $CONTAINERNAME -s
> lxc.network.ipv4=193.163.195.${CONTAINERNAME#container}, I am not
> understanding what to put in place of ${CONTAINERNAME#container}, do I
> need to put container name i.e ubuntu#1 or any thing else.
>
>> Guido
>>
>> >-----Original Message-----
>> >From: nishant mungse [mailto:nishantmungse at gmail.com]
>> >Sent: Friday, December 02, 2011 9:11 AM
>> >To: lxc-users at lists.sourceforge.net;
>> containers at lists.linux-foundation.org
>> >Subject: [Lxc-users] How assign the IP address of containers
>> sequentially.
>> >
>> >Hi,
>> >
>> >I want the ip address to be assigned in order as the containers are
>> started and not assigned by DHCP. For example ::
>> >container1:: 193.163.195.01,container2:: 193.163.195.02 like wise if
>> there is container30 :: 193.163.195.30, this should be its ip
>> >address.
>> >
>> >What are changes that are to done in conf file of lxc so as to get this
>> kind of address?
>> >
>> >Plz help me ASAP.
>> >
>> >Regards,
>> >Nishant Mungse
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 6
>> Date: Sun, 04 Dec 2011 14:13:21 +0000
>> From: John <lxc at jelmail.com>
>> Subject: [Lxc-users] Problems on ArchLinix
>> To: lxc-users at lists.sourceforge.net
>> Message-ID: <4EDB8001.3050707 at jelmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>> Hello, has anyone experienced problems with LXC on Archlinux in the past
>> few days?
>>
>> I use LXC quite a bit and I have scripted builds for my containers. This
>> weekend I rebuilt one of my containers (basically builds with up to date
>> stuff using mkinitcpio and pacman) and now when I try to start it it
>> clobbers the host. I have to log on from another machine and reboot. I
>> have been trying to find out what is wrong and thought I'd post here to
>> see if anyone else has experenced problems in the last week.
>>
>> Everything else is up to date (host updated yesterday, etc). Other
>> containers that have not been rebuilt work fine. I think it must be a
>> change to boot scripts but I don't know what. Both my older container
>> which works and the new one that doesn't have an identical cutdown
>> rc.sysinit.
>>
>> I'm going to keep digging but if anyone has noticed problems recently
>> please let me know. I would appreciate it.
>>
>> Thanks.
>>
>>
>>
>>
>>
>> ------------------------------
>>
>> Message: 7
>> Date: Mon, 5 Dec 2011 11:06:47 +0530
>> From: nishant mungse <nishantmungse at gmail.com>
>> Subject: [Lxc-users] how to make changes in conf file
>> To: lxc-users at lists.sourceforge.net,
>> containers at lists.linux-foundation.org
>> Message-ID:
>> <
>> CAHnfO6ymmvTi1bPZ3G4NAU87gCe0e+uk-E_8VfzRAWFtCs8Fag at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> >
>> > Hi,
>> >
>> > I want the ip address to be assigned in order as the containers are
>> > started and not assigned by DHCP. For example :: container1::
>> > 193.163.195.01,container2:: 193.163.195.02 like wise if there is
>> > container30 :: 193.163.195.30, this should be its ip address.
>> >
>> > What are changes that are to done in *conf file of lxc* so as to get
>> this
>> > kind of address?
>> >
>> > Plz help me ASAP.
>> >
>> > Regards,
>> > Nishant Mungse
>> >
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>>
>> ------------------------------
>>
>>
>> ------------------------------------------------------------------------------
>> All the data continuously generated in your IT infrastructure
>> contains a definitive record of customers, application performance,
>> security threats, fraudulent activity, and more. Splunk takes this
>> data and makes sense of it. IT sense. And common sense.
>> http://p.sf.net/sfu/splunk-novd2d
>>
>> ------------------------------
>>
>> _______________________________________________
>> Lxc-users mailing list
>> Lxc-users at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/lxc-users
>>
>>
>> End of Lxc-users Digest, Vol 24, Issue 2
>> ****************************************
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20111205/33e95495/attachment.html>
More information about the lxc-users
mailing list