A firewall is a system or group of systems that establishes access control policies between two networks. In principle, a firewall can be thought of as a pair of mechanisms: the first blocks network traffic, the second allows network traffic.

A firewall can be used to protect a network from external attacks, but a firewall cannot protect against attacks that don’t go through the firewall and attacks from someone on the same network, and a firewall cannot protect a network from poorly written application programs.

In general, firewalls usually perform the following functions:

  • Packet analysis and filtering.
  • Content and protocol blocking.
  • Connection authentication and encryption.

In this time we will use iptables as a firewall configured on a PC that acts as a PC Router. For details, see here.