Merge lp:~serge-hallyn/ubuntu/saucy/lxc/lxc-dnsmasq into lp:ubuntu/saucy/lxc

Proposed by Serge Hallyn
Status: Merged
Merge reported by: Serge Hallyn
Merged at revision: not available
Proposed branch: lp:~serge-hallyn/ubuntu/saucy/lxc/lxc-dnsmasq
Merge into: lp:ubuntu/saucy/lxc
Diff against target: 48 lines (+12/-1)
3 files modified
debian/changelog (+6/-0)
debian/lxc.lxc-net.upstart (+2/-1)
debian/lxc.preinst (+4/-0)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/saucy/lxc/lxc-dnsmasq
Reviewer Review Type Date Requested Status
Stéphane Graber Approve
Review via email: mp+166979@code.launchpad.net

Description of the change

Add a LXC_DHCP_CONFILE variable to /etc/default/lxc-net to specify a configuration file for lxcbr0's dnsmasq.

For instance if you have:

dhcp-host=mail1,10.0.3.100

then you can forward ports 25,465,etc from the host to 10.0.3.100.

I personally think this is preferable to using static ip addresses in the container config file (as that still requires changes to the container). What do you think?

To post a comment you must log in.
Revision history for this message
Stéphane Graber (stgraber) wrote :

I assume you confirmed that "--conf-file=" is valid (as in, doesn't read any file)?

If so, then that all looks good and is definitely a nice feature to have.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-05-28 18:24:48 +0000
3+++ debian/changelog 2013-06-02 20:19:25 +0000
4@@ -1,3 +1,9 @@
5+lxc (0.9.0-0ubuntu13) UNRELEASED; urgency=low
6+
7+ * lxc-net: support an optional dnsmasq configuration file.
8+
9+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Sun, 02 Jun 2013 15:13:58 -0500
10+
11 lxc (0.9.0-0ubuntu12) saucy; urgency=low
12
13 * 0007-lxc.conf.doc: Fill in missing sections in lxc.conf(5) manual
14
15=== modified file 'debian/lxc.lxc-net.upstart'
16--- debian/lxc.lxc-net.upstart 2013-05-28 14:52:18 +0000
17+++ debian/lxc.lxc-net.upstart 2013-06-02 20:19:25 +0000
18@@ -11,6 +11,7 @@
19 env LXC_NETWORK="10.0.3.0/24"
20 env LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
21 env LXC_DHCP_MAX="253"
22+env LXC_DHCP_CONFILE=""
23 env varrun="/var/run/lxc"
24
25 pre-start script
26@@ -39,7 +40,7 @@
27 mkdir -p ${varrun}
28 ifconfig ${LXC_BRIDGE} ${LXC_ADDR} netmask ${LXC_NETMASK} up
29 iptables -t nat -A POSTROUTING -s ${LXC_NETWORK} ! -d ${LXC_NETWORK} -j MASQUERADE
30- dnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=${varrun}/dnsmasq.pid --conf-file= --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup
31+ dnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=${varrun}/dnsmasq.pid --conf-file=${LXC_DHCP_CONFILE} --listen-address ${LXC_ADDR} --dhcp-range ${LXC_DHCP_RANGE} --dhcp-lease-max=${LXC_DHCP_MAX} --dhcp-no-override --except-interface=lo --interface=${LXC_BRIDGE} --dhcp-leasefile=/var/lib/misc/dnsmasq.${LXC_BRIDGE}.leases --dhcp-authoritative || cleanup
32 touch ${varrun}/network_up
33 end script
34
35
36=== modified file 'debian/lxc.preinst'
37--- debian/lxc.preinst 2013-05-14 19:34:51 +0000
38+++ debian/lxc.preinst 2013-06-02 20:19:25 +0000
39@@ -24,6 +24,10 @@
40 LXC_NETWORK="10.0.$i.0/24"
41 LXC_DHCP_RANGE="10.0.$i.2,10.0.$i.254"
42 LXC_DHCP_MAX="253"
43+# Uncomment the next line if you'd like to use a conf-file for the lxcbr0
44+# dnsmasq. For instance, you can use 'dhcp-host=mail1,10.0.3.100' to have
45+# container 'mail1' always get ip address 10.0.3.100.
46+#LXC_DHCP_CONFILE=/etc/lxc/dnsmasq.conf
47 EOF
48 }
49

Subscribers

People subscribed via source and target branches

to all changes: