Diablo 2 port numbers?

I’m having trouble playing TCP/IP games in Diablo 2, and I think it may be my stubborn router again. Anyone here know which ports it uses, if that’s the problem?

Allow port 6112 TCP out and allow established sessions in
Allow port 4000 TCP out (realm games)
Allow port 4000 TCP out and in (hosting open games only)


Allow port 23, then give me your IP.


As a point of curiosity, what determines if I’m letting them “in” or “out”?