<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 08/13/2014 09:47 AM, bryn1u85 .
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAHsHv-aWH6ontwV3SkG0_APFtdev_PhU2f4AuLQGY0-LXA-rVg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hey everyone,
        <div><br>
        </div>
        <div>I've been trying to configure Ubuntu LXC with 2 ip failover
          from OVH but i failed :(</div>
        <div>I've been reading many howto's and still nothing. I have
          found on this list same cool tutorial which has written by
          Olivier. There is a link: <a moz-do-not-send="true"
href="https://lists.linuxcontainers.org/pipermail/lxc-users/2011-May/001980.html">https://lists.linuxcontainers.org/pipermail/lxc-users/2011-May/001980.html</a></div>
        <div><br>
        </div>
        <div>I don't know why i still can't get access to internet from
          LXC.</div>
        <div><br>
        </div>
        <div>My host ip: <span
style="color:rgb(116,116,116);font-family:OpenSans;font-size:14px;line-height:20px;background-color:rgb(245,245,245)">94.23.237.216</span></div>
        <div>My ip fail over ip 1: <span
style="color:rgb(116,116,116);font-family:OpenSans;font-size:14px;line-height:20px;background-color:rgb(245,245,245)">91.121.239.228</span></div>
        <div><br>
        </div>
        <div>I'll focus on one failover ip. </div>
        <div>I did as Olivier has subscribed.</div>
        <div><br>
        </div>
        <div>Host:</div>
        <div>root@ns321124:~# cat /etc/network/interface</div>
        <div># The loopback network interface</div>
        <div>auto lo</div>
        <div>iface lo inet loopback</div>
        <div>auto eth0</div>
        <div>        iface eth0 inet static</div>
        <div><br>
        </div>
        <div>auto br0</div>
        <div>        iface br0 inet static</div>
        <div>        bridge_ports eth0</div>
        <div>        bridge_stp off</div>
        <div>        bridge_maxwait 0</div>
        <div>        bridge_fd 0</div>
        <div>        address 94.23.237.216</div>
        <div>        netmask 255.255.255.0</div>
        <div>        network 94.23.237.0</div>
        <div>        broadcast 94.23.237.255</div>
        <div>        gateway 94.23.237.254</div>
        <div>        </div>
        <div>post-up /sbin/ifconfig br0:0 91.121.239.228 netmask
          255.255.255.255 broadcast 91.121.239.228</div>
        <div>post-down /sbin/ifconfig br0:0 down<br>
        </div>
      </div>
    </blockquote>
    <br>
    Use either post-up and /sbin/ip or 'iface br0:0 inet static.....'.<br>
    <br>
    <blockquote
cite="mid:CAHsHv-aWH6ontwV3SkG0_APFtdev_PhU2f4AuLQGY0-LXA-rVg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>root@ns321124:~# cat /var/lib/lxc/Oksymoron/config</div>
          <div># Template used to create this container:
            /usr/share/lxc/templates/lxc-ubuntu<br>
          </div>
          <div># Parameters passed to the template:</div>
          <div># For additional config options, please look at
            lxc.container.conf(5)</div>
          <div>
            <br>
          </div>
          <div># Common configuration</div>
          <div>lxc.include = /usr/share/lxc/config/ubuntu.common.conf</div>
          <div><br>
          </div>
          <div># Container specific configuration</div>
          <div>lxc.rootfs = /var/lib/lxc/Oksymoron/rootfs</div>
          <div>lxc.mount = /var/lib/lxc/Oksymoron/fstab</div>
          <div>lxc.utsname = Oksymoron</div>
          <div>lxc.arch = amd64</div>
          <div><br>
          </div>
          <div># Network configuration</div>
          <div>lxc.network.type = veth</div>
          <div>lxc.network.flags = up</div>
          <div>lxc.network.link = br0</div>
          <div><a moz-do-not-send="true" href="http://lxc.network.name">lxc.network.name</a>
            = eth0</div>
          <div>lxc.network.ipv4 = 91.121.239.228</div>
        </div>
      </div>
    </blockquote>
    <br>
    Use this IP either here or on the bridge iface, but not at both
    places.<br>
    <br>
    <blockquote
cite="mid:CAHsHv-aWH6ontwV3SkG0_APFtdev_PhU2f4AuLQGY0-LXA-rVg@mail.gmail.com"
      type="cite">
      <div dir="ltr">root@ns321124:~# cat
        /var/lib/lxc/Oksymoron/rootfs/etc/network/interfaces<br>
        <div>
          <div># The loopback network interface</div>
          <div>auto lo</div>
          <div>iface lo inet loopback</div>
          <div><br>
          </div>
          <div>auto eth0</div>
          <div>iface eth0 inet static</div>
          <div>        adress 91.121.239.228</div>
          <div>        netmask 255.255.255.255</div>
          <div>        broadcast 91.121.239.228</div>
        </div>
      </div>
    </blockquote>
    <br>
    Define your network either in container:/etc/network/interfaces or
    in lxc config file, but not at both places.<br>
    <br>
    <blockquote
cite="mid:CAHsHv-aWH6ontwV3SkG0_APFtdev_PhU2f4AuLQGY0-LXA-rVg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div><br>
          </div>
          <div>        post-up route add 94.23.237.254 dev eth0</div>
          <div>        post-up route add default gw 94.23.237.254</div>
          <div>        post-down route del 94.23.237.254 dev eth0</div>
          <div>        post-down route del default gw 94.23.237.254</div>
        </div>
      </div>
    </blockquote>
    <br>
    Why not the standard 'gateway .....' configuration?<br>
    <br>
    <blockquote
cite="mid:CAHsHv-aWH6ontwV3SkG0_APFtdev_PhU2f4AuLQGY0-LXA-rVg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
        </div>
        <div><br>
        </div>
        <div>For sure i did reboot and lunch lxc.</div>
        <div><br>
        </div>
        <div>Checking ifconfig in LXC called Oksymoron</div>
        <div><br>
        </div>
        <div>
          <div>root@Oksymoron:/home/ubuntu# ifconfig</div>
          <div>eth0      Link encap:Ethernet  HWaddr 00:16:3e:3e:35:9e</div>
          <div>          inet addr:91.121.239.228  Bcast:255.255.255.255
             Mask:0.0.0.0</div>
          <div>          inet6 addr: fe80::216:3eff:fe3e:359e/64
            Scope:Link</div>
          <div>          UP BROADCAST RUNNING MULTICAST  MTU:1500
             Metric:1</div>
          <div>          RX packets:109 errors:0 dropped:0 overruns:0
            frame:0</div>
          <div>          TX packets:8 errors:0 dropped:0 overruns:0
            carrier:0</div>
          <div>          collisions:0 txqueuelen:1000</div>
          <div>          RX bytes:9448 (9.4 KB)  TX bytes:648 (648.0 B)</div>
          <div><br>
          </div>
          <div>lo        Link encap:Local Loopback</div>
          <div>          inet addr:127.0.0.1  Mask:255.0.0.0</div>
          <div>          inet6 addr: ::1/128 Scope:Host</div>
          <div>          UP LOOPBACK RUNNING  MTU:65536  Metric:1</div>
          <div>          RX packets:16 errors:0 dropped:0 overruns:0
            frame:0</div>
          <div>          TX packets:16 errors:0 dropped:0 overruns:0
            carrier:0</div>
          <div>          collisions:0 txqueuelen:0</div>
          <div>          RX bytes:1248 (1.2 KB)  TX bytes:1248 (1.2 KB)</div>
          <div><br>
          </div>
        </div>
        <div>Now try update.</div>
        <div>
          <div>root@Oksymoron:/home/ubuntu# apt-get update</div>
          <div>Err <a moz-do-not-send="true"
              href="http://archive.ubuntu.com">http://archive.ubuntu.com</a>
            trusty InRelease</div>
          <div><br>
          </div>
          <div>
            Err <a moz-do-not-send="true"
              href="http://archive.ubuntu.com">http://archive.ubuntu.com</a>
            trusty-updates InRelease</div>
          <div><br>
          </div>
          <div>Err <a moz-do-not-send="true"
              href="http://security.ubuntu.com">http://security.ubuntu.com</a>
            trusty-security InRelease</div>
          <div><br>
          </div>
          <div>Err <a moz-do-not-send="true"
              href="http://security.ubuntu.com">http://security.ubuntu.com</a>
            trusty-security Release.gpg</div>
          <div>  Could not resolve '<a moz-do-not-send="true"
              href="http://security.ubuntu.com">security.ubuntu.com</a>'</div>
          <div>Err <a moz-do-not-send="true"
              href="http://archive.ubuntu.com">http://archive.ubuntu.com</a>
            trusty Release.gpg</div>
          <div>  Could not resolve '<a moz-do-not-send="true"
              href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
          <div>Err <a moz-do-not-send="true"
              href="http://archive.ubuntu.com">http://archive.ubuntu.com</a>
            trusty-updates Release.gpg</div>
          <div>  Could not resolve '<a moz-do-not-send="true"
              href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
          <div>Reading package lists... Done</div>
          <div>W: Failed to fetch <a moz-do-not-send="true"
              href="http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease">http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease</a></div>
          <div><br>
          </div>
          <div>W: Failed to fetch <a moz-do-not-send="true"
              href="http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease">http://archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease</a></div>
          <div><br>
          </div>
          <div>W: Failed to fetch <a moz-do-not-send="true"
              href="http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease">http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease</a></div>
          <div><br>
          </div>
          <div>W: Failed to fetch <a moz-do-not-send="true"
              href="http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg">http://archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg</a>
             Could not resolve '<a moz-do-not-send="true"
              href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
          <div><br>
          </div>
          <div>W: Failed to fetch <a moz-do-not-send="true"
              href="http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg">http://archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg</a>
             Could not resolve '<a moz-do-not-send="true"
              href="http://archive.ubuntu.com">archive.ubuntu.com</a>'</div>
          <div><br>
          </div>
          <div>W: Failed to fetch <a moz-do-not-send="true"
href="http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg">http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg</a>
             Could not resolve '<a moz-do-not-send="true"
              href="http://security.ubuntu.com">security.ubuntu.com</a>'</div>
        </div>
      </div>
    </blockquote>
    <br>
    This is a dns resolving issue.<br>
    <br>
    t<br>
  </body>
</html>