NetApp bonded VLAN configuration


To maximize the benefit from the multi-port adapters on a NetApp, it is best to bond the ports together (some vendors refer to this as “trunk groups”). Then over the new bonded trunk, the various networks can be assigned as VLANs, maximizing the network throughput for each LAN the NetApp needs to communicate with.


In this example, I will show how to bond two interfaces together, and create three VLANs:

vif create multi vif0 e9a e9b
vlan create -g vif0 200
vlan add vif0 201 202
ifconfig vif0-200 netmask
ifconfig vif0-201 netmask
ifconfig vif0-202 netmask


How To Install 3ware Tools on Debian Lenny


In order to manage the 3ware raid controller under Linux, an embedded web server needs to be installed. 3ware provides a download-able tarball on their site, however, the installation on Lenny is problematic. The following steps explain how to get the install and the configuration done.


  • Edit /etc/apt/sources.list and add the following lines:
    # 3Ware
    deb lenny restricted
  • # wget -O - | apt-key add -
  • # apt-get update
  • # apt-cache search 3ware
  • # aptitude install 3ware-3dm2-binary 3ware-cli-binary
  • # cd /etc/3dm2
  • # cp 3dm2.conf 3dm2.conf-dist
  • Edit 3dm2.conf set :
    RemoteAccess 1
  • # /etc/init.d/3dm2 restart
  • Browse to https://yourhost:888/
  • Select 3DM 2 Settings and change the default password 3ware to something secure. If you lock yourself out, you can copy the original config file back in place as it has the default password.


OpenVZ shared directory mounting from host to guest systems


An OpenVZ host can share any part of its filesystem with any guest operating system running on it. This post describes how to manually mount a filesystem tree from the host OpenVZ box to a guest, and how to automate the process. We will also address an error that can happen with a correctly configured file preventing the automated mount process.


Manual mount

To mount a filesystem tree to any guest from the host, run the following:
mount --bind /path/to/tree/on/host ${VE_ROOT}/path/to/tree/on/guest

You need to replace ${VE_ROOT} with /var/lib/vz/root/<guest id>

Automate the mount

There is two options to automate the mount: automation for each guest and automation for a specific guest. The file looks the same either way. For setting up a mount on each guest, use vps.mount and vps.umount as the file names. To use automated mount for a specific guest, use the the filename that is <guest id>.mount and <guest id>.umount. For example, if your container id for your virtual private server (guest) is 123, then the specific files to set the mount and unmount code for are 123.mount and 123.umount. This is how the .mount file needs to look:

source /etc/vz/vz.conf
source ${VE_CONFFILE}
echo "Starting ${VEID}.mount..."
mount --bind /path/to/tree/on/host ${VE_ROOT}/path/to/tree/on/guest
echo "...${VEID}.mount complete"

And this is how the .umount file needs to look:

source /etc/vz/vz.conf
source ${VE_CONFFILE}
echo "Starting ${VEID}.umount..."
umount ${VE_ROOT}/path/to/tree/on/guest
echo "...${VEID}.umount done"

Note that the echo is necessairy, otherwise, the filesystem will most likely not mount correctly. This is due to the fact that on start and restart the vzctl program will call umount first, and if that script fails (returns a non zero exit code) the .mount script isn’t called. Thus, if the directory isn’t mounted and there isn’t an echo at the end of the script, the script returns the exit code of the last command which in this case is the exit code from the failed umount command.


Cacti Install on RHEL 5 or CentOS 5


Cacti is a great tool to graph performance of the various hardware components of a network. With the use of the yum repository manager, it is very simple to install on Red Hat Enterprise Linux 5 or CentOS 5.

Install steps

  • First make sure that you have the dag repository configured in yum. Edit or create the file /etc/yum.repos.d/dag.repo:
    name=Dag RPM Repository for Red Hat Enterprise Linux
  • Now install the required packages:
    sudo yum install net-snmp mysql mysql-server cacti
  • Edit the /etc/httpd/conf.d/cacti.conf file to allow access to cacti as needed.
  • Make sure Apache and MySQL are started and set to start automatically:
    sudo service mysqld start
    sudo service httpd start
    sudo chkconfig –level 345 mysqld on
    sudo chkconfig –level 345 httpd on
  • Set up the cacti database in MySQL:
    sudo mysqladmin –user=root create cacti
    cd /var/www/cacti
    sudo mysql cacti < cacti.sql sudo mysql --user=root mysql mysql> GRANT ALL ON cacti.* TO [email protected] IDENTIFIED BY ‘cactiuser’;
    mysql> SET PASSWORD FOR cactiuser = PASSWORD('my_super_secret_cacti_password');
    mysql> flush privileges;
    mysql> exit
    sudo mysqladmin –user=root password "my_super_secret_root_password"
  • Setup the cacti poll schedule in /etc/crontab:
    */5 * * * * cacti php /var/www/cacti/poller.php > /dev/null 2>&1
  • Run the cacti installer in the browser:
    provide the user and password for the database, you can accept all defaults and just click next
  • That is it, you are good to go.


Installing Cacti on CentOS with yum

Setting up shared VMWare Fusion host folders on CentOS and RHEL guest


How to view folders from the Mac that hosts the VMWare Fusion guest operating system CentOS or Red Hat Linux?


  • First, make sure that the VMWare Tools are installed. That always helps.
  • Next, in the WMWare configuration menu of the guest, set up the desired shared folders. There might be already a default shared folder pointing to the user’s home directory.
  • Next, in the guest OS, ls -ld /mnt/hgfs will display the available shared folders.


[CentOS-virt] CentOS 5.1 guide for VMware Fusion

Directing all VPN traffic through the OpenVPN concentrator


It is necessary for some users to have all their traffic directed through the OpenVPN concentrator. The number one reason for such a configuration is to protect the HTTP traffic over unsecured WiFi (a.k.a. hotspots).


Add to the bottom of the connecting client’s configuration file (typically under /etc/openvpn/clients.d the following line:
push "redirect-gateway"

Installing RHEL from an AIX NIM master


The AIX NIM server allows a very flexible automated installation process to deploy hundreds or AIX nodes as well as LPARs in a matter of hours. It is possible to achieve similar results using the RHEL kickstart system. This article is about a way of automating the RHEL 5 deployment directly from AIX 6.1 NIM.


  • Copy the RHEL 5 DVD to an NFS file system. E.g. /nfs/rhel5
  • Configure the NIM server to offer the correct boot image in /etc/bootptab:
  • Configure TFTP on the NIM server in /etc/tftpaccess.ctl:

    # NIM access for network boot
  • Restart TFTP and reload INETD:

    stopsrc -s tftpd
    startsrc -a -n -s tftpd
    refresh -s inetd
  • Boot the network client with SMS: remote ip setup (with client ip, server ip, router ip, subnet mask, ping test), multiboot setup (with ethernet as first boot device)
  • Follow the regular RHEL install process. (This is where you can get kickstart going.)
  • Reboot the system and reset the boot order.

Fixing Yum dependency problems on RedHat Linux and CentOS

Yum update fails

I see the question of failed dependencies come up on forums quite a bit. Users post errors like:

Missing Dependency: bind-utils = 9.3.4-10.P1.el5_3.1 is needed bind-sdb-9.3.4-10.P1.el5_3.1


ImageMagick-perl- from installed has depsolving problems
--> Missing Dependency: /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi is needed by package ImageMagick-perl-


httpd-2.2.3-22.el5.centos.2.x86_64 from updates has depsolving problems
--> Missing Dependency: /usr/share/magic.mime is needed by package httpd-2.2.3-22.el5.centos.2.x86_64 (updates)

In all these cases, the solution is to clean yum:
yum clean all


Mount CD/DVD in an AIX or Linux LPAR

To mount a CD or DVD in an LPAR, first you need to use the media library to assign one of the CDs in the library to the LPAR. For example, using the ivm inteface:

  1. Click on the lpar name in the “View/Modify Partitions” section
  2. Select the optical devices tab
  3. Create a virtual optical device if there isn’t one yet
  4. Click modify under current media
  5. Select the CD or DVD from the library
  6. Click OK

Then, you need to mount the media inside the AIX or Linux partition:

  1. Create the /mnt/cdrom directory if it doens’t exist yet: mkdir /mnt/cdrom
  2. Mount the media device: mount -v cdrfs -r /dev/cd0 /mnt/cdrom (on Linux the mount command is slightly different)

Note: on AIX you can edit the file “/etc/cdromd.conf” and add the line “device cd0 /mnt/cdrom” to have the CD or DVD mounted automatically.

Setting up Apache Authentication with htpasswd / htaccess

Authentication in Apache is done through htaccess, either from the configuration file, or from the .htaccess file in a given directory. Note that only full directories can be easily protected with this method.
Here is how: (first log in to the shell, as this method only works if
you have shell access)

$ cd .../html/protected_dir

$ cat > .htaccess

AuthType Basic

Authname "Protected KLC directory"

AuthUserFile ../../control/htpasswd

AuthGroupFile /dev/null

Require valid-user


$ htpasswd -c ../../control/htpasswd user_name

[give passwd]

After the file is created for the first time, to
add more users:

$ htpasswd ../../control/htpasswd user_name

There are also more sophisticated authentication schemes available, that allow database driven authentication. Feel free to contact me for more information about those solutions.