Well, you could write your own server, using something like
IO::Socket::Inet. This way, you'll be able to listen on a specific port, get connections, and get the IP addresses of these connnections. Is this what you mean?
Or do you want to get info on
all connections? If so, you probably should do as previously suggested, and google for
firewall.