Like I said, there is already a thread about that on there. This is the topmost reply: "Please try these ports, per Nintendo support page: TCP: 80, 443, 6667, 12400, 28910, 29900, 29901, 29920 UDP: 1-65535 (I don't recommend opening the entire range, though)".
Even if I wanted to do that, I can't do that with my router because it needs some of the ports for other functions. I went ahead and called the Nintendo tech support yesterday and they just told me to put my Wii U in a DMZ. It's a bit of a bother because it's only possible to have either my Wii U or my 3DS in the DMZ but it'll be fine I guess.
For people who have this problem in the future, make sure your Wii U/3DS always gets the same IP adress from your router when you do that.