iptables can manage incoming and outcoming connections of a Linux computer, simply it is used as a firewall for a server.
A link to a fairly comprehensive guide about how it works (not always obvious), its management and administration.
Keep it nearby if needed.