I've been experiencing the same issue, and so far I haven't been able to achieve a permanent solution. The problem connecting to the internet started after I had my I/O board replaced at my local Apple Store. When I brought my MacBook Pro home, it was connected to my wireless router (Airport Express), yet I could not connect to the internet.
Under my System Prefs/Network it said, "AirPort has the self-assigned IP address 169.254.111.112 and will not be able to connect to the Internet."
So I searched around on the internet, and I tried numerous suggestions without any success (dis/re-connecting modem and router, toggling firewall on/off, etc.)
Then I finally found something that worked (as described here:
http://aviflax.com/post/os-x-tip-dont-deny-incoming-connections-to-configd/):
(in Terminal): "sudo cp /usr/libexec/ApplicationFirewall/com.apple.alf.plist /Library/Preferences/com.apple.alf.plist"
until my MacBook went to sleep. After that, it went back to "self-assigned IP address. I tried to type this command into the Terminal again, and it wouldn't work.
Then I tried this, and it worked:
Deleted the following files from Library/Preferences/System Configuration:
com.apple.airport.preferences.plist
com.apple.network.identification.plist
com.apple.smb.server.plist
NetworkInterfaces.plist
preferences.plist
Then reset the PRAM and NVRAM as illustrated here:
http://support.apple.com/kb/ht1379
this worked for most of the day (even after my MacBook went to sleep multiple times). Then WHILE I was surfing the net, out-of-the-blue, the internet suddenly stopped responding. I checked my network, and sure enough it was back to "self-assigned IP address"
I tried both methods above (that worked for me), but neither one works anymore.
I have a Dell laptop, PS3, Wii, two iPhones and an iPod Touch that can all connect to my Airport Express wireless router without any problems. This leads me to believe that my modem and router are okay (?)
I live in a condo complex, and My MacBook Pro can successfully connect to the internet via all my neighbors that aren't putting up passwords on their wireless networks
It can also connect to wireless networks at other places that have passwords (work, friends/family homes, etc.) This leads me to believe that my MacBook is okay (?)
I have a feeling this has to do with having my I/O board being replaced, as everything was working fine before. Side note: the reason my I/O board was replaced was because the connection between the AC power cord and my MacBook stopped working. But before I call the Apple Store for some help, I wanted to reach out to see if anyone had some advice.
Mac OS X 10.6.4
Card Type: AirPort Extreme (0x168C, 0x86)
Firmware Version: Atheros 5424: 2.0.19.10
Locale: FCC
Country Code: US
Thanks!
--------
UPDATE:
I woke up this morning, turned on my Macbook Pro (it was shut down), and after booting up it automatically connected perfectly. When I shut down my computer the night before (just after my post above), it still wasn't working correctly. I didn't do anything except shut my computer down (which I did multiple times in an effort to try and fix things), so don't ask me why it has decided to work now. One thing to note: I'm connecting to the internet fine, but it's SLOW to fully load pages. When going to any web page, the browser will just sit there with no reaction except to say "Loading [webpage]" for a good 60 seconds. Then the page will suddenly appear somewhat quickly. All the information and images (seem to) appear on the page, but it will continue to load for about another minute before the page is fully loaded. This occurs for all sites and all my browsers (Firefox 3.6.8, Chrome 6.0.472.55 and Safari 5.0.2). Also my Gmail "Google Notifier" will often 'time out' while checking for emails, which it never did before. My internet is usually always pretty speedy throughout all times of the day, fully loading pages in seconds. My ISP is Comcast.
I haven't restarted, shut down, or allowed my computer to go to sleep yet (I need it connected in order to do work from home), but FOR NOW it's functioning (just slower than usual). I'll update if/when it goes out again.
It looks like this issue isn't a specific router or Mac device problem, as based on what I've read, it is/has occurred on various routers and Macs. So I'm assuming it has something to do with the software/settings/OS on the Mac (?)