<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <font size="+1">Hey! I think I have it working! While waiting for
      comments, I tried a different approach. I can ping out to anything
      on the Internet from my container and in from my LAN on which my
      Host Node computer is setting, to my test container.
      Seems....perfect!<br>
      <br>
      Here's what my container says:<br>
      <br>
      root@vm101:~# cat /etc/issue<br>
      Debian GNU/Linux 6.0 \n \l<br>
      <br>
      So, it appears I have a squeeze container now.</font><font
      size="+1">  Thanks guys!</font><br>
    <font size="+1"><br>
      And for anyone curious on how I put this together from scratch, or
      for checking that I actually did it in an acceptable manner, below
      is my step by step howto:<br>
      <br>
      Thanks for all your help! :)<br>
      <br>
    </font>
    <style type="text/css">pre.cjk { font-family: "DejaVu Sans",monospace; }p { margin-bottom: 0.08in; }a:link {  }</style>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>KEY:</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # </b>
        <------ HOST NODE root command</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> VM# </b><span
          style="font-weight: normal;"><------
          VM CONTAINER root command</span></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>INSTALL THE
          FOLLOWING ON YOUR DEBIAN SQUEEZE HOST NODE:</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>aptitude
            install bridge-utils debootstrap lxc</b></font> </font>
    </p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>CREATE
          cgroup
          MOUNT POINT:</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>mkdir
            -p /var/local/cgroup</b></font></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>echo
            "cgroup /var/local/cgroup cgroup defaults 0 0" >>
            /etc/fstab</b></font></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>mount
            -a</b></font></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>CREATE A
          BRIDGE FOR THE HOST NODE (static)</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>nano
            /etc/network/interfaces</b></font></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> <Then
        change
        the entries to look like this:></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">#
        The loopback network interface</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">auto
        lo</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">iface
        lo inet loopback</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">#
        The primary network interface</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">#allow-hotplug
        eth0</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">#iface
        eth0 inet dhcp</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">auto
        br0</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">iface
        br0 inet static</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff"> bridge_ports eth0</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff"> bridge_fd 0</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     address</font> <font
          color="#ff0000">192.168.2.100</font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     netmask</font> <font
          color="#ff0000">255.255.255.0</font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     gateway</font> <font
          color="#ff0000">192.168.2.1</font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     dns-nameservers</font>
        <font color="#ff0000">192.168.2.1</font></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000">Change the
        above
        addressing numbers as appropriate to your Host Node.</font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000">Then restart
        the
        network:</font></p>
    <p style="margin-bottom: 0in;"> <font color="#008000"><b>/etc/init.d/networking
          restart</b></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>SETUP FOR
          CREATING SQUEEZE BASED CONTAINERS:</b></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000">First,
        we save a lenny version of the present lxc-debian script: </font>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">cp
            /usr/lib/lxc/templates/lxc-debian
            /usr/lib/lxc/templates/lxc-debian-lenny</font></b></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000">Second,
        we remove the lenny lxc-debian script:</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">rm
            /usr/lib/lxc/templates/lxc-debian</font></b></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000">Third,
        we need a altered script for squeeze containers:</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> (The
        modified source can be inspected and downloaded </font>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> from
        <a href="http://www.jotschi.de/download/lxc-debian">http://www.jotschi.de/download/lxc-debian</a>
        ), or-</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">cd</font>
          <font color="#008000">/usr/lib/lxc/templates</font></b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">wget
            <a class="moz-txt-link-freetext" href="http://www.jotschi.de/download/lxc-debian">http://www.jotschi.de/download/lxc-debian</a></font></b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">chmod
            +x lxc-debian</font></b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b><font
            color="#008000"> </font>#<font color="#008000">
            ./lxc-debian</font></b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> ( </b><span
          style="font-weight: normal;">NOTE:
          You can edit the new lxc-debian file to contain most your IP
          addressing info</span><b> )</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>CREATE A NEW
          CONTAINER:</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">cd</font>
          <font color="#008000">/usr/lib/lxc/templates</font></b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> form=
          <font color="#008000">./lxc-debian squeeze </font><font
            color="#ff0000"><your
            vm name here></font><font color="#008000"> </font><font
            color="#ff0000"><IP/container
            number></font></b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">./lxc-debian squeeze </font><font
            color="#ff0000">vm101</font><font color="#008000">
          </font><font color="#ff0000">101</font></b></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> (
        Your container with the above entered name will be installed in
        /var/lib/lxc )</font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"> <b>-OR- </b><font
          size="3"><span style="font-weight: normal;">you
            can use lxc-create command, but I haven't figured out yet
            how to use
            it as shown here- </span></font></font>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> </b></font><font
        color="#000000"><b># </b></font><font color="#000000">lxc-create
        -t debian -n </font><font color="#000000">foo</font><font
        color="#000000"> </font><font color="#000000"><--OR--> </font><font
        color="#000000"><span style="font-weight: normal;">lxc-create
          -n foo -f lxc.conf -t debian</span></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>EDIT THE
          FOLLOWING FILES TO FIT YOUR UNIQUE ADDRESSING:</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">nano
            /var/lib/lxc/</font><font color="#ff0000">vm101</font><font
            color="#008000">/rootfs/etc/network/interfaces</font></b></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">auto
        lo</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">iface
        lo inet loopback</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">auto
        eth0</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">iface
        eth0 inet static</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     address</font> <font
          color="#ff0000">192.168.2.101</font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     netmask</font> <font
          color="#ff0000">255.255.255.0</font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#008000"><font color="#0000ff">     gateway</font> <font
          color="#ff0000">192.168.2.1</font></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">nano
            /var/lib/lxc/</font><font color="#ff0000">vm</font><font
            color="#ff0000">101</font><font color="#008000">/rootfs/etc/resolv.conf</font></b></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">nameserver
        <font color="#ff0000">192.168.2.1</font></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000">Then
        BEGIN the setting up of hostname.domain.com- make the changes
        shown
        below the command</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><b> # <font
            color="#008000">nano
            /var/lib/lxc/</font><font color="#ff0000">vm</font><font
            color="#ff0000">101</font><font color="#008000">/rootfs/</font><font
            color="#008000">etc/</font><font color="#008000">hosts/</font></b></font></p>
    <p style="margin-bottom: 0in;"><br>
    </p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#0000ff">#
        Auto-generated hostname. Please do not remove this comment.</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#ff0000">192.168.2.101
        vm101.firewall.com</font></p>
    <br>
    <p style="margin-bottom: 0in;"><font color="#000000"><b>NOTE:</b></font><font
        color="#000000"><span style="font-weight: normal;">
          it appears to me that the</span></font><font color="#008000"><b>
        </b></font><font color="#008000"><i><b>/var/lib/lxc/</b></i></font><font
        color="#ff0000"><i><b><your
            vm name here></b></i></font><font color="#008000"><i><b>/config</b></i></font><font
        color="#008000"><b>
        </b></font><font color="#000000"><span style="font-weight:
          normal;">file
          is now pretty much automatically </span></font><font
        color="#000000">filled out
      </font><font color="#000000">and has been changed anyway from what
        it
        was</font><font color="#000000"> (i think), </font><font
        color="#000000">as this setup appears to work without editing
        this file</font><font color="#000000">:</font></p>
    <pre class="western"></pre>
    <font style="font-size: 16pt;" size="4"><b><br>
        CONFIGURE
        CONTAINER:</b></font>
    <p style="margin-bottom: 0in;"><font color="#000000"><font
          color="#0000ff"><b>S</b></font><font color="#0000ff"><b>TART</b></font>
        the Container (VM):</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><font
          color="#008000"><b> </b></font><b>#</b><font color="#008000"><b>
          </b></font><font color="#008000"><b>lxc-start -n </b></font><font
          color="#ff0000"><b>vm101</b></font><font color="#008000"><b>
            -d </b></font><font size="2"><span style="font-weight:
            normal;"><----- “-d” starts it in background. Without
            “-d” you are thrown
            inside it.</span></font></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000">Is it <font
          color="#0000ff"><b>RUNNING?</b></font>:</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>lxc-info
            -n </b></font><font color="#ff0000"><b>vm101</b></font></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><font
          color="#0000ff"><b>ENTER</b></font>
        container:</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> # <font
          color="#008000"><b>lxc-console
            -n </b></font><font color="#ff0000"><b>vm101</b></font></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> Type <<font
          color="#0000ff"><b>Ctrl+a
            q</b></font>> to <font color="#0000ff"><b>EXIT</b></font>
        the
        console</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"> login = root ,
        password = root</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000">Then change
        <font color="#0000ff"><b>PASSWORD</b></font>:</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><span
          style="font-weight: normal;"> </span><span
          style="font-weight: normal;">VM#</span> <font color="#008000"><b>passwd</b></font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000">Then
        UPDATE /etc/apt/sources.list – (just to be sure)-</font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><span
          style="font-weight: normal;"> </span></font><font
        color="#000000"><span style="font-weight: normal;">VM#
        </span></font><font color="#008000"><b>apt-get update &&
          apt-get upgrade</b></font></p>
    <p style="margin-bottom: 0in;"><font color="#000000"><span
          style="font-weight: normal;">Then
          FINISH setting up </span></font><font color="#000000"><b>hostname.domain.com</b></font><font
        color="#000000"><span style="font-weight: normal;">
          from inside the Container—change for you needs--</span></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> VM# <font color="#008000"><b>echo </b></font><font
          color="#ff0000"><b>vm101.firewall.com</b></font><font
          color="#008000"><b>
            > /etc/hostname</b></font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> VM# <font color="#008000"><b>/etc/init.d/hostname.sh
            start</b></font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000">Then
        TEST to see if it worked:</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> VM# <font color="#008000"><b>hostname</b></font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> vm101.firewall.com <---or whatever it should
        be showing</font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> VM# <font color="#008000"><b>hostname -f</b></font></font></p>
    <p style="margin-bottom: 0in; font-weight: normal;"><font
        color="#000000"> vm101.firewall.com <---or whatever it should
        be showing</font></p>
    <br>
    <br>
    <b><big>If anyone has anything to add to this or corrections, I'd
        appreciate adding them to my notes!  Thanks again!</big></b><br>
  </body>
</html>