There are a couple of things that you can try. First would be folllowing the Wi-Fi troubleshooting from the article below.
Aother thing I would recommend is setting up a new network location and seeing if your issues persist then. Take a look at the section "Making new locations" in the article below.
Hope that helps,
Thanks for the reply Griff. Actually, before I saw this, someone told me to try deleting the SystemConfiguration Preferences folder and reboot. That did it. I later learned that if I had just deleted the NetworkInterfaces.plist file in that folder, my problem would have been solved. Anyway, all good now.