Crumpled Thoughts

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

July 26th, 2006

Haiatus

Posted by Chris in Life, Rant, Funny

This past month has been a little crazy, and the bloging has suffered. I imagine most of you all understand. Let me tell you though, that I’m coming back with a vengence. Expect to find a load of upcoming posts on a new PC Build, some IT frustrations, and a bathroom remodel. Till then, entertain yourselves with this:

Chuck Norris Jokes

So funny, and so true.

June 14th, 2006

This font cracks me up

Posted by Chris in Funny

This font cracks me up

Ouch!® Std Regular

Who knew Adobe had such a sense of humor? I was browsing trough OpenType fonts at www.adobe.com/type and came across this jewel. Not sure if I’ll ever have the opportunity to use it, but you never know :)

June 13th, 2006

Treo Exchange ActiveSync Hell

Posted by Chris in Technology, Linux, Windows, Sysadmin, Rant
Treo + Apache + Exchange 2003 = HELL

Today I had to set up a Treo 650 to access a user’s Exchange mailbox over the web. I did not imagine it would be as difficult as it turned out to be.

At this site we run a Linux router/firewall that handles all traffic coming into, and leaving the network. We use Apache’s mod_proxy to proxy web connections from the internet to IIS servers on the private network. Having had more than a couple 36+ hour days cleaning up viruses due to exploited IIS servers, I feel much more comfortable having Apache handle the web requests.

One of the “Gotcha’s” to using mod_proxy is that you have to disable “Integrated Windows Authentication” on any sites you proxy with Apache. Apache doesn’t understand the headers involved. No big deal, because these requests are typically coming from the internet over SSL.

I started the setup at about 12:00 noon today. The first thing I did was add the following bits of code to the Apache configuration file to Proxy the ActiveSync connections:

#ActiveSync
ProxyPass /Microsoft-Server-ActiveSync https://webmail.example.com/Microsoft-Server-ActiveSync
ProxyPassReverse /Microsoft-Server-ActiveSync https://webmail.example.com/Microsoft-Server-ActiveSync

I then put the appropriate settings into the Treo, and tested connectivity. This is where things started to piss me off.

The software on the Treo has terrible, non-intuitive error codes. The documentation is even worse. This is what I discovered (over about 4 hours of trying to get it to work):

  • For the ProxyPass directives to work, you can not use Integrated Windows Authentication on the IIS site.
  • For the Treo VersaMail app to use Exchange ActiveSync it must use kerberos authentication, which requires enabling Integrated Windows Authentication.
  • Palm’s software engineers don’t really give a shit whether the error message you get is in any way helpful, just as long as you understand it’s not working.

So the thing that sucks about this is that we run “stuff” on the gateway which requires us to use Apache on Linux. It provides remote access for employees through a web interface, and dynamically modifies iptables firewall rules when folks need access.

This was my fix, which I think is as good of a fix as is possible.

  • Exported the IIS web site that handled OWA, OMA, and ActiveSync to a file.
  • Created a new web site from the exported file.
  • Changed the TCP ports for HTTP and HTTPS to obscure, high ports.
  • Modified the document root on the IIS site, as all the magic happens in Virtual Directories.
  • Requested/Installed a new SSL certificate from an internal enterprise CA with a common name matching the internet FQDN.
  • Enabled “Integrated Windows Authentication” on the “Exchange” virtual directory in this new web site.
  • Forwarded the obscure, high SSL port from the firewall into the Exchange server.

Now the Treo works… just had to set the obscure high port in the advanced settings on the Treo. I didn’t want to go down the forwarded port road, because it seems like a compromise in security. All too often I see people bypass security measures in order to get things to work, and I hate it. This seems like a small compromise I’ll have to settle for.

Got a better solution? Let me know.

-Chris

June 11th, 2006

Vacation comes to an end

Posted by Chris in Technology, Life, Rant

It’s Sunday night and we’re back in Boise. McCall was really nice, even though it was a bit chilly at times. Paula & Kairi went up to McCall with Paula’s parents last Monday… and I joined them Wednesday afternoon. I took three days of vacation from work and it felt really nice. My boss insisted that I leave my cell phone and laptop in Boise to make sure I had a true vacation. Last year at this time I kept my laptop on a constant VPN connection to the office to monitor email and stay in touch. This year I cheated once and checked my email Thursday night.

It’s funny… I need an internet connection to stay sane. If I’m without internet access it feels like being without electricity. I use the internet for everything. I haven’t opened a phone book in probably 4 years, when my cable internet access was down and I needed the number to call the cable company. I order pizza online, bank online, shop online, pay bills online, get movies, books, and software online. For better or worse I need internet access, and it has to be fast.

I saw a job posting for an IT position at the Tamarack Resort in Donnelly Idaho and just about sent a resume over. Then I thought about how internet access in Donnelly would probably be. I’m thinking slow, with frequent outages. I couldn’t handle that. It would kill me.

So, we’re back in Boise. As much as I’m not looking forward to going in to the office in the morning, it was great to get home to my cable modem. Downloaded a movie to watch tonight… transferred a full DVD in 4 hours. If you haven’t seen Failure to Launch, I recommend it. It wasn’t the typical Matthew McConaughey chick flick. It got terrible reviews, but I really enjoyed it.

Anyhow… I guess I’m rambling at this point, better go unpack :)

June 10th, 2006

Hitting the trails at Bear Basin

Posted by Chris in Life, Kairi

Yesterday we took out the bikes and ATV to Bear Basin to hit the trails. We had a really good time. Kairi got to ride on the ATV with Grandpa (very slowly).

Kairi Frog

Chris warming up bike

Kairi and Grandpa

June 9th, 2006

Relaxing in McCall

Posted by Chris in Life, Kairi

We’ve been spending this week relaxing in McCall. Today we went to Zims hot springs in New Meadows, and afterward went and checked out the ‘Last Chance’ campground off of Highway 55, between New Meadows and McCall. I took this picture of Kairi smiling.

Kairi Smile

June 6th, 2006

Fact Contortionists

Posted by Chris in Rant

Today everyone has been going on and on about the potential evil activities which will undoubtably occur today. TODAY IS NOT 6/6/6. Today is 6/6/2006. Get your head out of the book of Revelations long enough to realize today is just another day.

Anyone who tells you that today is 6/6/6 is a liar, and you can tell them I told you that. It was that kind of thinking that got us in to the whole Y2K mess.

Discuss.

« Previous PageNext Page »