What sumwun said above is perhaps helpful, but if you're trying to do it online, that is technically still possible, but rather complicated and not officially endorsed by Nintendo. It's not cheating per se, because it's not hacking, but it's not Nintendo's original intention, so I guess if you believe using private servers which revive Nintendo Wi-Fi Connection is cheating, then you have to cheat. But I digress.
The only way I know of to use Gen 4/5 online features is to use Wiimmfi:
Nintendo WFC was required for online play, but the Wiimmfi Project has replicated much of its functionality and allows for continued online play in Mario Kart Wii and other games.
I myself have not figured out the whole functionality to it, and it may not actually work for battles. Finding ranked games is still not supported yet; I believe they're trying to add that? However, it allegedly works for link battles.
Anyway, here's a setup guide by MrBean35000vr for the whole schtick. The GTS is fully functional, and I think since all it takes to get your Friend Code is what MrBean here calls "talking to the server", you should be just fine.
Hope I helped a lot, give me a yell if you have any questions and I'll try to answer. Thank you to Fizz for supplying me with the setup video.