Back up all data before you do anything else.
Step 1
If you haven't already done so, reboot the router and try again.
Step 2
Check the router's settings to make sure that it's configured as a DHCP server, and also make sure that you have one and only one such server on the network. For example, if your broadband device and your wireless access point are separate, one of them should be set up in bridge mode. If other wireless clients on the same network are working normally, you can probably skip this step.
Step 3
Try this step only if you have a third-party router (not an Apple AirPort or Time Capsule.) Click the
Advanced button in the
Network preference pane, then the
TCP/IP tab. Type something (anything, as long as it's unique) in the
DHCP Client ID text box. Click
OK, then
Apply. Reopen the
TCP/IP tab and click
Renew DHCP lease. If there's no change, go to the next step.
Step 4
Make a note of all your settings for Wi-Fi in the
Network preference pane, then
delete the connection from the connection list.
Launch the Keychain Access application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Keychain Access in the page that opens.
In the keychain list, an item named "System" should be listed. If it isn't, select
File
▹
Add Keychain from the menu bar and add the following:
/Library/Keychains/System.keychain
Now search in Keychain Access for the
name of the wireless network (
not the name of the router.) Double-click one of the items and check the box labeled
Show password in the inspector window. You'll be prompted for your keychain password to confirm. Make a note of the network password. Then
delete every "AirPort Network Password" in the search results. Quit Keychain Access.
Go back to the
Network preference pane and recreate the Wi-Fi connection with the same settings as before. You do this by clicking the plus-sign icon below the connection list, and selecting
Wi-Fi as the interface in the sheet that opens. Select
Join other network from the
Network Name menu, then select your network. Enter the password when prompted and save it in the keychain.
Go back into the
TCP/IP tab to see whether you now have a valid IP address (one not beginning with 169.254.) If you don't, try again to renew the DHCP lease.