(A firewall is a set of hardware and software devices that can significantly separate the physical line connection between two or more networks. The separated networks can communicate with each other through packet forwarding technology. Through the security management mechanism of the firewall, it is possible to decide which data can flow and which data cannot flow, so as to achieve the purpose of network security maintenance.
Using iptables to build a Linux firewall[1]..pdf)