It is most likely a port forwarding problem. If you can get into your router, forward port 5730 — the default — to your PS3. In my case the console's address was 192.168.2.13.
To find your PS3's IP, go to Settings > Network Settings > Settings and Connection Status List, and read the address listed beside IP Address.
That said, here is what actually fixed it for me. After doing every port forward, DMZ and NAT tweak I could find on the internet, all it took was opening my DSL modem's page by typing its IP into a browser. There was a setting defaulted to keep the IP private; I changed it to public and hosting worked immediately. Nothing else on the PS3 or the router needed touching. Good luck.