A firewall will allow you to filter a network or areas of a network based on ports as well as the data inside of each packet.
In computing, a firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. A firewall typically establishes a barrier between a trusted internal network and untrusted outside network, such as the Internet.
Firewalls are often categorized as either network firewalls or host-based firewalls. Network firewalls filter traffic between two or more networks; they are either software appliances running on general-purpose hardware, or hardware-based firewall computer appliances. …