PL04

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Criptografia e Fundamentos Goals

de Segurança Configure a system firewall

Practical Exercises #3 using IPTables in Linux

Use IPTables to configure a Linux system firewall Materials


• Segurança Prática em Sistemas e
1. Clear all the rules on the system’s firewall configuration Redes com Linux, Jorge Granjal,
FCA 2017, “Capítulo 17.
2. Create a firewall rule to ignore incoming ping requests from hosts on the
Proteção de Servidores”
network 10.1.0.0/24 (network of the server student.dei.uc.pt), while
authorizing all the remaining IP packets. Note: ping uses ICMP packets of
types 8 (echo request) and 0 (echo reply) • Red Hat Enterprise Linux
Security Guide: 2.8 Firewalls
3. Create firewall rules to authorize the following incoming TCP connections
(filter table, INPUT chain), while rejecting (only) other TCP • The netfilter.org Project
communications:
a. SSH and SMTP connections originated at the server
student.dei.uc.pt and from network 192.168.1.0/24 • Linux 2.4 Packet Filtering
b. POP3 and IMAP4 connections originated at other hosts on the HOWTO
Lab (network 10.254.0.0/24)

4. Add to the previous configuration firewall rules to authorize the following


outgoing TCP connections (filter table, OUTPUT chain), while rejecting
(only) other TCP communications:
a. HTTP and HTTPS connections destined to the server
student.dei.uc.pt
b. SSH connections destined to other hosts on the Lab (network
10.254.0.0/24)

5. Save the rules to a file

6. Clear all the firewall rules defined in the previous exercises

7. Use IPTables to authorize the following communications, while denying


the remaining IP traffic (policy DROP on both the INPUT and OUTPUT
chains):
a. Incoming SSH and HTTP connections
b. Outgoing SSH, HTTP and HTTPS connections
c. DNS queries sent to the server dns.dei.uc.pt and dns2.dei.uc.pt
d. Incoming ping requests from the server student.dei.uc.pt
e. All IP communications to or from the localhost (127.0.0.1, or
interface lo)

8. Activate the previous firewall configuration permanently on the system

Criptografia e Fundamentos de Segurança Practical Exercises #3 1


9. Add a rule to log all the pings requests that are performed to the virtual
machine.
a. Check the number of packets that have denied and logged
b. After the verification of the logging eliminate the rule

10. Use IPTables to limit the number of connections to the virtual machine, to
only accept two simultaneous incoming SSH connections. Consider
replacing rule of exercise 7a.

Criptografia e Fundamentos de Segurança Practical Exercises #3 2

You might also like