Friday, February 26, 2010

PLDT WeRoam Dongle and Linux (Ubuntu)

I was able to test out a PLDT WeRoam dongle at our office, and to those familiar Linux users out there, there isn't a default configuration avaiable to use the PLDT dongle. The closest configuration is the one saved for Smart Bro.

The configuration that I used to make it work are the following:
  • APN: weroamplan
  • username: pldt@weroam
  • password: pldt
  • number to dial: *99#
  • authentication method: PAP (or sometimes CHAP)
  • allow BSD data, Deflate data and Header data compression
  • IPV4 Settings: automatic PPP address only, add 8.8.8.8 (GoogleDNS) as your DNS server.
The performance if you might ask... it is pretty quick and somewhat reliable (in my case it works like a charm in the Makati area). This setting works like a charm, especially the addition of GoogleDNS (really, PLDT's own DNS suck big-time).

As for those who are having troubles configuring their dongles to work, might I suggest to search over my previous blog posts on some of the guides I have written for it.

Sunday, February 14, 2010

Using Apt-Mirror with Debian/Ubuntu netbooting

Just want to share my experiences in configuring your own local apt-mirror to use with netboot installation methods of Debian/Ubuntu. I did this setup in a Debian Lenny 32bit Server inside a VM instance.

First off, the main packages that you do need to install onto your server are...

For your netboot:
# apt-get install tftpd-hpa dhcp3-server

The DHCP server is optional if your network already have a separate machine that handles that since we could use that...

For your apt-mirror and sharing it:
# apt-get install apt-mirror apache2

The first thing that you initially have to do is add something to the configuration file of your DHCP server. Apart from the basic configurations in defining your intended subnet, there is a few additional configurations to be added specifically for your netbooting. You have to add a few lines inside your /etc/dhcp3/dhcpd.conf that will handle redirection of those requesting an IP address and are in PXE booting mode. Below is a sample that needs to be added inside your subnet declaration.

#this is what is inside my DHCP server conf file

subnet 10.10.0.0 netmask 255.255.0.0
{

range 10.10.1.1 10.10.1.199;

option broadcast-address 10.10.255.255;
option router 10.10.1.254;
allow unknown-clients;

#this is what I added for the netboot
next-server (URL or IP of netboot server);
filename "pxelinux.0";
}


Afterwards, you need to edit your /etc/apt/mirror.list to point to the desired mirror server ubuntu/debian resources that you want to copy or mirror. The contents and format of mirror.list is quite similar to what is contained on your /etc/apt/sources.list. There is only one more important detail that needs to be added, which is a "main/debian-installer" and "restricted/debian-installer". To do this, just add an additional entry of a source in your mirror.list that looks something like below, just change the values accordingly to what you intend (if debian or ubuntu and what distro version).

#my sample here is something for Ubuntu Karmic mirror

deb http://(URL of external mirror site)/ubuntu karmic main restricted
deb http://
(URL of external mirror site)/ubuntu karmic main/debian-installer restricted/debian-installer
clean http://
(URL of external mirror site)

Upon doing this, do a "sudo apt-mirror" so that it will start fetching the packages and such into your local mirror server. For the sample I shown a while ago, it was around 6.7 GB worth of packages, therefore be mindful of the storage capacity of your server and your bandwidth. This will definitely take some time, so let's configure the other stuff you need.

Remember I had you install apache2? We're going to need this to make your apt-mirror visible and can be shared over the network easily. What we only need to do, as a quick configure, is to make a soft-link of your apt-mirror sources file directory (/var/spool/apt-mirror/mirror/) into the default directory of apache2 (/var/www/). Below is a sample on the command to do this.

#if you are making a debian apt-mirror
sudo ln -s /var/spool/apt-mirror/mirror/(URL of external mirror site)/debian /var/www/debian
#if you are making an ubuntu apt-mirror
sudo ln -s /var/spool/apt-mirror/mirror/(URL of external mirror site)/ubuntu /var/www/ubuntu

Afterwards, run your apache2 server and try to view it with your browser (localhost/ubuntu or localhost/debian). You should see a directory on display that somewhat contains packages and stuff that is being fetched by your apt-mirror.

Now we configure your TFTPBOOT. First off, we need to edit your /etc/default/tftpd-hpa file. Try to mimic the settings shown below.

#defaults of the tftpd-hpa with RUN_DAEMON set to YES

RUN_DAEMON=yes
OPTIONS="-l -s /var/lib/tftpboot"

The directory /var/lib/tftpboot is the default directory where your intended netboot images will be placed. You are free to change this value but just be mindful of the needed permissions or ownership of the file or directory as it might be cause some trouble. You can copy into this directory the netboot files of either Ubuntu or Debian. The images that you need can be downloaded here for Debian and here for Ubuntu. In some cases, the default directory doesn't exist so you might need to mkdir one.

After you have placed a netboot image, we then try to run it by...

# /etc/init.d/tftpd-hpa start

To check if it is working, try to boot-up a PC (of course with PXE network booting capabilities) that is connected to your network. If that PC boots up to a network installation menu of the distro that you pasted in your tftpboot directory, it means that things are working for your netboot.

To check if your apt-mirror is working and sharing, during your netboot installation it will ask for a mirror site, you should select the topmost option from the list which gives you a way to manually define the mirror URL. Just type in the IP address of your mirror server and press enter for the defaults of the remaining questions related to it. if it proceeds to the next step of your installation, it is therefore working.

One problem that I encountered while configuring my apt-mirror is that the "debian-installer" is missing, and possible reasons for this is not being included in the /etc/apt/mirror.list or the selected URL site being mirrored doesn't have that resources. Changing the sources and re-run the apt-mirror should do the job.

Some sources I used in making this are listed below. Credits to the writers of the guides.
  • http://www.debian-administration.org/articles/478
  • http://www.howtoforge.org/local_debian_ubuntu_mirror
Hope my guide helps some of you guys out there.

Tuesday, February 9, 2010

Netboot linux installation solutions

Over these past few days, I have been looking and conducting trials on the various forms of massive or volume based formatting of some of our desktops with linux-based distributions. Since I have the network infrastructure resources at the office (where I work in) at my "diligent" disposal to use, an obvious solution is creating a system that will catch network boot (netboot) requests.

Some few months ago, I have been taught on using DRBL together with Clonezilla for "mass-producing" thin-client units for one of the office's projects. I was planning to integrate this service onto our network but somehow having trouble in configuring it's DHCP server to cooperate or simply use the one already present and implemented on our gateway server. I also partially abandoned the cloning idea because you are basically limited to cloning.

With some discussions done with my peers at the office, this side-project is once again up and running about, but this time I'm experimenting the use of tftpboot and FAI-server. Basically, my current objective is to create a server (a small VM instance) that will handle any lookup for a boot loader. Right now, I have been able to set up a Debian Lenny server with tftpboot installed and configured our gateway/DHCP server to point into that server for pxeboot image request (not sure on how this is called). To test, I stored a generic (available) netboot image of a Debian and Ubuntu Karmic installer that will be thrown into the target desktop PC. So far it is working but of course I still need to figure our a way of optimizing it.

The next steps that I am trying to undertake is studying how to then set it up with FAI (fully automated install). Things are still a bit fuzzy on how to implement this; from what I read, I still have to prep-up a nfs partition or such that will store the images and scripts I plan to install.

Maybe next time... if I have some free time... I could make a detailed blog on configuring each of those features I did mention.