I cannot connect to my own Team Fortress 2 server? Why?

AIUI the client needs to listen on some port (usually 27015) on the loopback interface (why, I don't know). When you try to put the server on that same port, the client ends up moving to a different port, and for some reason, the two of them get confused. I run my server on my LAN IP, and then use iptables to control access. When working with closed-source software, it's usually easiest to manage security elsewhere :)