If you're using AirPort, the answer is simple: turn off the AirPort connection, which is normally what I do. However, with my G4 tower at work, which uses a wired ethernet connection, I couldn't do that.
So, what you can do instead is to create a new network location (I called mine "No Access") and enter in bad or garbled information. Or, in my case where at work I have a static IP, I made the new location try to use DHCP (which would fail). Then, when you want to turn off your network connection, just go to the Apple menu, Locations menu, and select No Access, and you're kicked offline until you want to go back.

