iPhone 3G and 3GS users can follow the step-by-step guide posted below for unlocking using ultrasn0w. iPhone 2G users need to follow the guide posted here
Follow the step-by-step guide posted here to jailbreak iPhone 3GS or iPhone 3G on iPhone OS 3.1.3 firmware. Guide for iPhone 2G with redsn0w can be found here.
Once your iPhone is jailbroken, start “Cydia” on your iPhone and touch on “Manage” tab on the bottom. Now touch on “Sources” as seen in the screenshot below: Note: T-Mobile users should disable 3G before installing ultrasn0w.
Edit and Add “http://repo666.ultrasn0w.com“. Cydia will now automatically update your sources by following a series of automated steps.
Search for “ultrasn0w” in Cydia and install this application. The latest version 0.92 of this app will automatically unlock your iPhone so that you can use it with any carrier with proper carrier name/logo.
Now simply restart your iPhone. You should now have a fully unlocked iPhone 3G/3GS on firmware 3.1.3!