PDF Version Available

This document is also available in PDF format: iptables.pdf

The PDF version includes bookmarks for easy navigation and is optimized for printing.

Accessibility Notice

This document is also available in HTML format at:

Link: https://aholdengouveia.name/LinuxAdmin/labexcercises/iptables.html

The HTML version provides enhanced accessibility features including keyboard navigation, screen reader support, responsive design, dark mode support, and high contrast options.

Ticket

Ticket: ACME-7219
Requested by: Security team
Systems: Both report servers

Background

Acme Corp's two report servers are going into production. Before they do, Security needs firewall rules in place for the services they run. You will be working on the two servers you set up in the Server Setup lab: your Red Hat based server and your second server.

Learning Outcomes

By the end of this lab, you will be able to:

Requirements

On both servers, write iptables commands, statements, or scripts to do the following:

  1. Web server: open the ports the web server needs, and forward port 80 traffic to port 8080.
  2. MySQL: open the ports MySQL needs.
  3. SSH: allow incoming and outgoing SSH, and write a second script that denies SSH.
  4. Hosts: allow or block specific hosts and MAC addresses.
  5. Telnet and ping: block telnet with one script or command, and block ping with another.
  6. DDoS: write the specs for how you could reduce the impact of a DDoS attack using iptables. Then implement one protection from your specs on your web server, such as limiting the number of new connections from a single IP address. Test it from your other server by sending more connections than your limit allows, for example with ApacheBench (ab), and show that the extra connections are dropped. Only run this test against your own servers.

Where a requirement leaves room for interpretation, make a reasonable decision and document it as an assumption.

Acceptance Criteria

Deliverables

Audience: someone taking care of your servers who hasn't used iptables before. Assume some technical knowledge but not expertise. Screenshots are helpful to go with your descriptions.

Include documents for both servers, clearly labeled with what the document is and which server it's for.

  1. A text document with your commands, statements, or scripts for each requirement. Include why you chose what you chose, any assumptions you made, and the Wireshark screenshots showing each one works.
  2. Documentation of the iptables rules on each server. Include a list of the changes you made to the chains, which table you changed, and when each change was made. Include a copy of your original rules and your updated rules at the end.
  3. A short document with your DDoS specs, the protection you implemented, and how you tested it, including a detailed explanation of your testing method and screenshots of the results. Cite at least 2 sources.

Resources

References, a video, a PowerPoint and some notes are available at my website Link: https://www.aholdengouveia.name/LinuxAdmin/iptables.html

Your servers are command line only, so Wireshark can't run on them directly. You can run Wireshark on your host computer to watch your virtual machines' network traffic, or capture the traffic on a server with TShark or tcpdump, save it to a file, and open that file in Wireshark on your host computer.