Archive for March, 2005

Postfix Tip of the Day!

Tuesday, March 22nd, 2005

If you are using postfix to relay mail to another mail server and the mail server’s address is a dynamic ip or switching ip (as larger ISP use for load balancing) then remember to wrap square brackets around the address. This will allow you to use the dynamic address and not need to specify an absolute address that could change (I have been caught out before).

So to save tears use brackets like so in your /etc/postfix/main.cf file:

relayhost = [mail-hub.bigpond.net.au]

Hazzarh!

Debian Pent@value Satellite Driver HOWTO

Monday, March 21st, 2005

Welcome to another quick walkthru by me… be very scared. Anyway, this time around I will show you how to install and get working a Pent@value PCI satellite card in Debian Linux.

Notes about this guide

This guide is not the be all and end all on how to get this hardware to work. It is how I got it to work after hours of hitting my head on the keyboard (I have an “e” key stuck where my left eye was..) and some haressment of knowledgable friends.

Thanks and Credits

Lauchlin Wilkinson at Internet Tasmania for helping me all the way from Thailand.

Software Required

  • Debian Linux (Woody) with Kernel 2.2 or 2.4 (recommened), 2.6 won’t work with this guide.
  • Pen@value linux tarball which comes on the installation CD
  • Access to the internet to grab the needed packages from the apt-get system
  • You will need to check some of the package names with version numbers to make sure they are the correct ones in the repositary. Do this using:
    apt-cache search

Installation

  1. Install the PCI card and boot the machine
  2. Best to install all the needed software from apt-get before moving on
  3. run apt-get to install the foloowing packages (you need to root for this):
    apt-get install libglib1.2-dev libgtk1.2-dev automake binutils bzip2 fileutils make gcc-2.95 libncurses5-dev
  4. You will need to get the header and source files for you kernel version.
    apt-get install kernel-headers-2.4.18-386 kernel-source-2.4.18

  5. Link your kernel libraries:
    ln -s /usr/src/kernel-headers2.4.18-386 /usr/src/linux
  6. Copy and untar the pent@value linux tarball off the cd to your home directory
  7. Go into the directory it makes and run the configure file
    ./configure
  8. Go into the driver directory that is created and edit MakeFile
    vim MakeFile
  9. Change the line that look like this: CFLAGS = -march=i486 -DCPU=486 -D__SMP___ -DMODVERSIONS etc
    Add -I /usr/src/linux/include before the \ at the end of the line
  10. Save and quit and go back a directory and make the install:
    make
    and then
    make install
  11. If all went well you will now have a pentaval driver which you can now assign a network interface:
    ifconfig pentaval0 192.168.1.1
  12. You need to add two modules into you configuration so they exist after next boot. Edit /etc/modules and add:
    pentaval
    scanval

    In that order.
  13. You also need to add an interface for next boot. Edit /etc/network/interfaces and add:

    auto pentaval0
    iface pentaval0 inet static
    address 192.168.1.1
    netmask 255.255.255.0
    network 192.168.1.0
    broadcast 192.168.1.255
  14. Next return to where you untared the original install files and copy the satellite tuning file into etc.
    cp pentaval-2.1.7/etc/pentaval.conf /etc/
  15. Edit the pentaval.conf file in etc and change the values to your providers settings
  16. Next is the big test.. lets see if you have satellite lock. Go back to your original install directory and then go into apps/text/ and run:
    pentaval -a (try to get lock)
    pentaval -s (status)
    pentaval -d (unlock)
  17. Lastly you need to create a script to allow asymetric routing which is normally not allowed with a standard install. Create a file in /etc/rc.boot/pentaval and make it executable then add:

    #!/bin/sh
    #
    # turn off ip spoofing on the sat card
    echo "0" > /proc/sys/net/ipv4/conf/pentaval0/rp_filter

    BE WARNED: This is actually allowing any packet to come into this network device not to be dropped before getting into the tcp stack for processing. This is a security problem, so don’t do it on your ethernet card or anything. The reason we change this is because normally packets are dropped if a request wasn’t originally send from the same interface recieving it. This is a problem since this is a one way satellite card. Your outgoing requests will be done by a modem or some other device.

  18. Lastly is to test it on the network, dail up you provider using your modem or isdn modem and give it a go. Use the pentaval app to check the status and packets received.

Any questions and comment feel free to to drop me a line, but be warned I ain’t no expert.

Belkin UPS on Debian Linux HOWTO

Tuesday, March 15th, 2005

Here is how to make a Belkin 350VA UPS Soho series run with their Bulldog software under Debian Linux (Woody).

I have run this under 2.2 and 2.4 kernels.

Grab the latest version of Bulldog from Belkin, 3.2 as of writing this article. New UPS’s in Australia come with the drivers on the install disk.

  1. Copy the tar ball onto your harddrive.
    cp linux.tar.gz
  2. Untar it.
    tar -xvfz linux.tar.gz
  3. Log in as root if not already.
    su
  4. Go into belkin directory.
    cd belkin
  5. Run install app.
    ./install
    This will copy all the files needed into “/etc/belkin/”
    It will not be able to create a script in “/etc/rc.local” due to Debian using “/etc/rc.boot” for it boot scripts (We will do something about this later).
  6. Once finished installing, the configure menu will open up. Change the settings as you want, but remember to get the serial port correct. I have found that it install with the default of ttyS1, but all my boxes use ttyS0. So experiment if you have more than one serial port on your box.Once finish press “s” to save and “q” to quit.
  7. You next need to edit you preshutdown.ini.
    vim /etc/belkin/preshutdown.bat
  8. Remove the two sync commands by going to the lines and pressing “d” twice on it. Then press “ESC” and type “:wq” to save and quit.
  9. Next file you need to edit is shutdown.bat script.
    vim /etc/belkin/shutdown.ini
  10. Remove the “/sbin/halt” line and add:
    /sbin/shutdown -h -t 1 now
    save and quit. Note that this needs to be the 1st and only line in this file.
  11. Create a boot script:
    vim /etc/rc.boot/ups
  12. Write in the script
    #!/bin/bash
    /etc/belkin/belkin start

    Write and quit
  13. Change the startup script to excute.
    chmod +x /etc/rc.boot/ups

This should now be a working UPS monitoring utility. To test, plug your box into a different power point (not the ups) and then plug the ups and monitor what is happening with the command:

/etc/belkin/belkin status

This isn’t a very complete guide, just a quick one with out any troubleshooting, but hopefully for anyone out there that is trying to do the same thing I did, this will help.