Crumpled Thoughts

August 26th, 2006

Waiting for my oil change

Posted by Chris in Technology, Life

Well, I’m waiting for the folks at Jiffy Lube to change my oil, and the Treo is really helping pass the time. I’ve caught up on unread email, read Jason’s latest blog post, and checked Slashdot headlines.

I really like this device. It’s not nearly as bad as a phone as I was afraid it would be. I’ve been able to be much more reponsive to email than I was without it.

Now, all of the little breaks in my day I can use productively. Filling up the car with gas, bathroom breaks, smoke breaks, and waiting rooms are all productive. Now, when I get back to the office I don’t have to spend 30 minutes catching up on email… I can get right to work.

August 24th, 2006

Persistent IP Routes in Mac OS X Tiger

Posted by Chris in Technology, Sysadmin

One of the clients I work for has a Mac OS X server which handles most of the file shares on the network. They have two internet connections, one on their T1, and a secondary DSL connection for redundancy. The Mac OS X server has two network interfaces; one with an internet IP (behind a BSD firewall) and another on the private network. The default gateway on the Mac server is on the internet interface, and a seperate router on the internal network routes traffic to 5 local IP subnets for remote offices, and co-located servers.

Since the default gateway points to the internet, routes have to be added for the four other local subnets to send traffic for those subnets to the router on the internal network. These routes need to survive a reboot— they need to be persistent.

On a Windows box it is simple to add a persistent IP route. Along with your ‘route add’ command, you add a ‘-p’ to make it persistent. Easy enough. Not so simple on Mac OS X. On Linux you could just add the ‘route add’ statements to the /etc/rc.local file and they would be executed at startup, effectively making them persistent. Easy enough. This is not so easy on Mac OS X… but I found a way to do it.

Let me add my standard disclaimer that you do this at your own risk. I won’t be held responsible for any trouble you experience trying to do this. It is working great for me though :)

Open up terminal, and switch to the root user:

sudo su -

You’ll have to type in your password, and have ‘Administer the Server’ rights.

Change to the /Library/StartupItems directory

cd /Library/StartupItems/

The way I created my script was by copying one that was created by a MySQL 4 installer. You should be able to copy any of the directories in /Library/StartupItems to give you a starting point. Just substitute the one you’re using where you see me use ‘MySQLCOM’.

cp -rp MySQLCOM PersistentRoutes

Now change to the PersistentRoutes directory.

cd PersistentRoutes

If you list the contents of this directory you should see two files, one named for the service you copied, and StartupParameters.plist. We need to rename the service you copied to ‘PersistentRoutes’

mv MySQLCOM PersistentRoutes

Now we edit PersistentRoutes with your favorite text editor… mine’s vi.

vi PersistentRoutes

Go ahead and empty the file. If you’re using vi type ‘1000dd’ (no quotes) and it will delete 1000 lines. That should empty it :) . This is the contents of my PersistentRoutes file:

#!/bin/sh
. /etc/rc.common
ConsoleMessage "Adding Persistent IP Routes"
/sbin/route add 10.0.0.0/24 10.1.2.1 #Route to Boise Colo Facility
/sbin/route add 10.1.3.0/24 10.1.2.1 #Route for SonicWall L2TP Group VPN
/sbin/route add 10.1.4.0/24 10.1.2.1 #Route to Portland Office
/sbin/route add 192.168.69.0/24 10.1.2.1 #Route to Chris' House 

Save, and exit your text editor. ‘:wq’ in vi (write, quit)

Now we need to edit the StartupParameters.plist. Mine looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC “-//Apple Computer//DTD PLIST 1.0//EN” 
“http://www.apple.com/DTDs/PropertyList-1.0.dtd”>
<plist version=”1.0″>
<dict>
        <key>Description</key>
        <string>Persistent Routes for VPN Tunnels</string>
        <key>OrderPreference</key>
        <string>Last</string>
        <key>Provides</key>
        <array>
                <string>PersistentRoutes</string>
        </array>
        <key>Uses</key>
        <array>
                <string>Network</string>
                <string>NetworkExtensions</string>
        </array>
        </dict>
</plist>

That’s it! Now your routes will be added when you reboot. Need to add a new route?.. manually add it from the terminal using ‘/sbin/route add…’ then update the /Library/StartupItems/PersistentRoutes/PersistentRoutes file. Easy!

Hope this helps someone. It was causing me a bit of aggravation. Perhaps someday Apple will make this a bit easier. Use ‘netstat -r’ to display your routing table.

Cheers,
Chris

August 21st, 2006

Recent pictures of Kairi

Posted by Chris in Life, Kairi

We recently had some family pictures taken. Shortly after this, Kairi took a spill and ended up getting blood all over Paula’s shirt. It started raining hard and we didn’t get any pictures of the 3 of us :(

Kairi 2

Kairi 1

August 7th, 2006

Trying out the Treo 700W

Posted by Chris in Uncategorized

A quick post from the treo I’m testing :U