Firewall is mainly to protect the private network from the public network. Firewall is called as the wall between the Internet and the intranet of the company. That is when the companies intranet is exposed to the Internet there is every possibility of a third party to access companies data. In order to prevent that we have this wall called as firewall, which does not allow any unauthorized person from entering in to the private network.
This firewall can also be called as a gateway through which the request of the company passes and the reply from the Internet or public network comes. There are many types of firewalls. They are:
PACKET FILTER - the packet filtering firewall is one of the most basic and least powerful one. What it does is checks each and every packet for its address and if its valid it allows the packet else it discards it.
PROXY SERVER - this type of firewall is an indirect one. In this case the details are sent in the form of a client server model and the data packets are checked and verified.
APPLICATION GATEWAY - the most powerful firewall is the application gateway. For allowing data to enter into the network it checks the sender ip and confirms the host address and then only allows data to enter.
These firewalls are also subjected to attacks. The attacks will be made on the packets that are sent. There could also be changes in the intermediate data. There could be even a fake ip and many more attacks. The types of attacks include
NETBIOS BROWSING
TRACEROUTE
FLOODING
A good firewalls job is to identify these attacks and protect the network. It's always safe to use a firewall while exposing a private network into a public network.