This is a portion of the link provided at the top of thread, copy n paste. If you still have issues, please review entire thread.
Official online support for Battlefield ended with the shutdown of the Gamespy Master Server. A replacement server was created independently. Redirecting your game to it will restore server browser function.
Your options to connect to an online server are. ( CD and Origin version )
Option 1 Changes game files and adds enhanced content. ( Most common method )
Option 2 Leaves game files pure. Adds the new server address files to the windows host.