7 Firewall And Network Security

Network and System Administration · Unit 7

Firewall and Network Security

Exam-focused notes for Firewall and Network Security (Network and System Administration, BIT451): what the TU syllabus asks and how it has actually been tested, with 3 solved past questions from this unit.

Firewall and Network Security in short

Servers connected to a network are open to attack. Firewalls and access control lists decide which traffic may enter or leave, and are the first line of defence.

Firewall and Network Security: notes

Firewall concepts and requirements

A firewall is hardware or software that filters network traffic using a set of rules. It sits between a trusted internal network and an untrusted network such as the Internet.

Why a firewall is required:

  • It blocks unauthorized access from outside.
  • It allows only the services you choose, such as web and mail.
  • It hides internal addresses using NAT.
  • It records traffic for audit and analysis.
  • It reduces the attack surface of servers and stops some attacks such as port scans.
  • It helps follow security policy and rules.

A good practice is a default deny policy: block everything, then allow only what is needed.

Packet-level firewall operation

A packet filtering firewall works at the network and transport layers. It checks each packet's source and destination IP address, protocol, port numbers and TCP flags. It then accepts or drops the packet by the rule list.

  • Very fast, because it does not read the data.
  • Cheap and simple.
  • Cannot see the content or the user, so it cannot stop attacks hidden in allowed traffic.
  • A stateful filter also remembers connections, and allows only replies to requests sent from inside.

Application-level firewall operation

An application-level firewall, also called a proxy firewall, works at the application layer. The client connects to the firewall, and the firewall opens a separate connection to the real server. It understands protocols such as HTTP, FTP and SMTP and can check commands and content.

PointPacket-levelApplication-level
OSI layerNetwork and transportApplication
ChecksHeaders: IP, port, flagsFull content and commands
SpeedFastSlower
SecurityBasicHigher
Cost and complexityLowHigh
Exampleiptables, router ACLSquid, web application firewall

What this unit covers

  • Firewall concepts and requirements
  • Packet-level firewall operation
  • Application-level firewall operation
  • Firewall configuration using iptables
  • Firewall configuration using firewalld
  • Access Control Lists (ACL)
  • SSH, HTTP, HTTPS port configuration

Firewall concepts and requirements

2082 · 5 marks

What is the use of firewall? Explain packet level and application level firewall. [5]

Show solved answer

Model Answer: Firewall Uses and Types

Use of Firewall (1 mark)

A firewall is a network security system that acts as a barrier between an organization's internal network and untrusted external networks (such as the Internet). Its primary uses are:

  • Monitor and control incoming and outgoing network traffic based on predetermined security rules
  • Prevent unauthorized access to protected networks
  • Block malicious traffic and potential threats
  • Enforce security policies and access control
  • Protect sensitive data from being exposed to external threats

Packet Level Firewall (2 marks)

Definition: Also called a stateless firewall, it operates at the network and transport layers (Layers 3 and 4 of the OSI model).

How it works:

  • Examines each packet individually in isolation
  • Analyzes packet headers containing source IP, destination IP, port numbers, and protocol type
  • Makes filtering decisions based on predefined rules without considering the context of previous packets
  • Does not maintain information about the state of connections

Characteristics:

  • Fast and efficient (minimal processing overhead)
  • Simple rule-based filtering
  • Cannot detect sophisticated attacks that span multiple packets
  • Suitable for basic filtering tasks

Application Level Firewall (2 marks)

Definition: Also called a proxy firewall or stateful firewall, it operates at the application layer (Layer 7 of the OSI model).

How it works:

  • Examines the actual content and context of data packets
  • Maintains state information about connections and sessions
  • Acts as an intermediary (proxy) between client and server
  • Analyzes application-level protocols (HTTP, FTP, SMTP, etc.)
  • Makes intelligent filtering decisions based on application data

Characteristics:

  • More secure and intelligent than packet-level firewalls
  • Can detect and block application-level attacks (e.g., SQL injection, malware in files)
  • Higher processing overhead and slower performance
  • Better protection against sophisticated threats
  • Can enforce user-level policies and authentication

Key Difference: Packet-level firewalls are fast but basic; application-level firewalls are slower but provide deeper security inspection and context-aware protection.

Open this answer on its own page →

2081 · 10 marks

What do you understand by Firewall? Why is it required? Differentiate between packet-level and application-level firewall.[10]

A firewall is a network security system that acts as a barrier between an internal network (or a computer) and external networks (such as the Internet). It monitors and controls incoming and outgoing network traffic based on predetermined security rules and policies. A firewall can be implemented...

Open this answer on its own page →

Firewall configuration using iptables

2082.1 · 5 marks

Describe firewall configuration using iptables or firewalld to allow: SSH, HTTP/HTTPS and Custom port. [5]

iptables is a command-line utility for configuring Linux kernel firewall rules. Here's how to configure it: 1. Allow SSH (port 22): 2. Allow HTTP (port 80): 3. Allow HTTPS (port 443): 4. Allow Custom Port (e.g., port 8080): 5. Set default policy and allow established connections: 6. Save rules (p...

Open this answer on its own page →