Firewall vs router

Firewalls and routers are devices that are connected to networks and pass through network traffic according to a set of rules. A device or set of devices intended to allow authorization to accept or refuse transmissions based on a certain set of rules is called a firewall. The firewall is used to protect networks from unauthorized access, while allowing the passage of legitimate transmissions. In addition, a router is a device used to transfer packets between two networks and act as an intermediate node connecting two networks.

What is a firewall ??

A firewall is an entity (a device or group of devices) designed to control (allow or deny) network traffic using a set of rules. A firewall is designed to allow only authorized communications to pass. A firewall can be implemented in both hardware and software. Software firewalls are a common place in many personal computer operating systems. In addition, firewall components are contained in many routers. Conversely, many firewalls can also use routers.
There are several types of firewalls. They are classified according to the location of the communication, the location of the interception and the state sought. As the name suggests, a packet filter (also called a network layer firewall) examines packets entering or leaving the network and accepts or rejects the rules based on the filtering rules. Firewalls that apply security mechanisms to specific applications, such as FTP and Telnet servers, are called application gateway proxies. In theory, this application-level firewall is capable of preventing unwanted traffic. The circuit-level gateway applies security mechanisms when UDP / TCP is used. A proxy server itself can be used as a firewall. Since

What is a router ??

A router is a device used to transfer packets between two networks (usually between a LAN and a WAN or a LAN and an ISP). This helps to create an overlay inter-network. A router usually contains a routing table (or a routing policy). When a packet arrives from one of the networks to which it is connected, it first checks the address information contained in the packet to know the destination. Then, depending on the routing table (or policy), it will either be transferred to the other network or simply drop the packet. A packet is transferred from router to router until it reaches its destinations.

What is the difference between a firewall and a router?

It is therefore clear that firewalls and routers are apparently similar in that they both pass through network traffic, but they have their differences. The real task of a router is to transport data between networks, while a firewall is dedicated to the screen of data passing over a network. Typically, routers remain between multiple networks, while a firewall remains in a designated computer and prevents unauthorized requests from reaching non-public resources. The router can be identified as a device that directs traffic, while a firewall is installed primarily for protection or security purposes.