I've tried connecting with friends over WiFi but have never successfully invited anyone over or visited another town. I keep getting error code 028-0512 or 018-0512 before connecting to the internet or before the train arrives to take me to another town. People that want to enter are also given the error code 018-0511. I've tried the manual IP Address solution, but the problem persisted.
The WiFi (D-Link wireless router) works fine for Friend Code adding, updates, and SpotPass. I don't know if this matters or not, but I'm trying to connect using a US 3DS over Chinese WiFi. The error code suggestion says that: "This is often caused by network firewalls blocking necessary network traffic." Is it because of the permanent firewalls in China? Or is it because my router is bad?
Nintendo's Error Code Look-Up: http://www.nintendo.com/consumer/wfc/en_na/ds/results.jsp?error_code=018-0511&system=3DS&locale=en_US
Thanks!