If you are trying to HOST and are operating behind a Router, read this post:
http://www.eqemulator.net/forums/viewtopic.php?t=16747
If you are trying to PLAY..I'm sorry i really dont have much advice with this, As the main reason why i have gotten 1017 trying to play was that i was trying to:
a) play on a server running an OLDER version of EQEmu than i had patched to.
b) play on a server running a NEWER version of EQEmu than i had patched to.
If you're trying to play on a 5.8 server, make sure you're patched to live. If you're patched to live, You CANNOT play on 5.7 servers. Anyways, thats my 2cp.