← Back to team overview

touch-packages team mailing list archive

[Bug 1367495] Re: Bridge still not created if bind9 is on

 

Okay. FYI I went ahead and defined my own bridge to let containers
communicate directly with my router's dhcp server, but I've created and
started a new privileged container `pr1` and made sure it uses `lxcbr0`
and not my `br0`. Still, it's possible I'll have to tell `lxcbr0` to
plug into `br0` rather than `eth0`, as `eth0` doesn't get an IP anymore
on my machine, and if so I'll need some help doing that. Anyhow:

>From within container `pr1`:
root@pr1:/# netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
root@pr1:/# ifconfig -a
    eth0      Link encap:Ethernet  HWaddr 00:16:3e:b2:93:2b  
              inet6 addr: fe80::216:3eff:feb2:932b/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:10 errors:0 dropped:0 overruns:0 frame:0
              TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:1177 (1.1 KB)  TX bytes:7656 (7.6 KB)

    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    root@pr1:/# cat /etc/
    cat: /etc/: Is a directory

But then after following your other directions:
    root@pr1:/# ifconfig eth0 10.0.3.10 netmask 255.255.255.0
    root@pr1:/# sudo route add -net default dev eth0
    root@pr1:/# ping 10.0.3.1
    PING 10.0.3.1 (10.0.3.1) 56(84) bytes of data.
    64 bytes from 10.0.3.1: icmp_seq=1 ttl=64 time=0.102 ms
    64 bytes from 10.0.3.1: icmp_seq=2 ttl=64 time=0.032 ms
    64 bytes from 10.0.3.1: icmp_seq=3 ttl=64 time=0.049 ms

Even better, if instead I do
    root@pr1:/# sudo route add -host 10.0.3.1 dev eth0
    root@pr1:/# route add -net default gw 10.0.3.1 dev eth0
then I can now ping to my LAN from within the container, and also ping out to 8.8.8.8. At this point I have:
    root@pr1:/# netstat -rn
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    0.0.0.0         10.0.3.1        0.0.0.0         UG        0 0          0 eth0
    10.0.3.0        0.0.0.0         255.255.255.0   U         0 0          0 eth0
    10.0.3.1        0.0.0.0         255.255.255.255 UH        0 0          0 eth0
    root@pr1:/# ifconfig -a
    eth0      Link encap:Ethernet  HWaddr 00:16:3e:b2:93:2b  
              inet addr:10.0.3.10  Bcast:10.0.3.255  Mask:255.255.255.0
              inet6 addr: fe80::216:3eff:feb2:932b/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:30 errors:0 dropped:0 overruns:0 frame:0
              TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:3579 (3.5 KB)  TX bytes:19728 (19.7 KB)
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:51 errors:0 dropped:0 overruns:0 frame:0
              TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:3792 (3.7 KB)  TX bytes:3792 (3.7 KB)

However, and BTW this is a problem I still have on the unprivileged
container using `br0` as well, I can't resolve DNS from within the
container. It returns `ping: unknown host www.google.com` immediately.

Finally, on my host I get:
    root@srv-Ub1404:~# ps -ef | grep dnsmasq
    lxc-dns+ 11309     1  0 Jan15 ?        00:00:00 dnsmasq -u lxc-dnsmasq --strict-order --bind-interfaces --pid-file=/run/lxc/dnsmasq.pid --conf-file= --listen-address 10.0.3.1 --dhcp-range 10.0.1.2,10.0.1.254 --dhcp-lease-max=253 --dhcp-no-override --except-interface=lo --interface=lxcbr0 --dhcp-leasefile=/var/lib/misc/dnsmasq.lxcbr0.leases --dhcp-authoritative
    root     13063 13052  0 00:01 pts/2    00:00:00 grep --color=auto dnsmasq

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to lxc in Ubuntu.
https://bugs.launchpad.net/bugs/1367495

Title:
  Bridge still not created if bind9 is on

Status in lxc package in Ubuntu:
  Incomplete

Bug description:
  This is probably a dup of bug 1240757, created just so I could upload
  the data requested in that bug report.

  On a fresh, probably vanilla, ubuntu 14.04 server, I tried using ubuntu 14.04's default lxc.
  It created containers fine, but they failed to start, complaining
    lxc-start: failed to attach 'veth9HNUS9' to the bridge 'lxcbr0' : No such device
  /var/log/upstart/lxc-net.log says
    dnsmasq: failed to create listening socket for 10.0.3.1: Address already in use

  This didn't happen on a desktop 14.04 instance, where bind9 is not
  installed by default.

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: lxc 1.0.5-0ubuntu0.1
  ProcVersionSignature: Ubuntu 3.13.0-35.62-generic 3.13.11.6
  Uname: Linux 3.13.0-35-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3.3
  Architecture: amd64
  Date: Tue Sep  9 16:39:34 2014
  ProcEnviron:
   LANGUAGE=en_US:
   TERM=xterm
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: lxc
  UpgradeStatus: No upgrade log present (probably fresh install)
  defaults.conf:
   lxc.network.type = veth
   lxc.network.link = lxcbr0
   lxc.network.flags = up
   lxc.network.hwaddr = 00:16:3e:xx:xx:xx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/1367495/+subscriptions


Follow ups

References