While surfing the Internet looking for security issues, I came across an e-book, or what you can regard as a tutorial.

Its very helpful, although that is was published at 1994, it contains the basic informations to understand firewalls and also to build one.

Firewalls and Internet Security: Repelling the Wily Hacker - William R. Cheswick and Steven M. Bellovin

The chapters are; in PDF format:

Part I Getting Started

- Introduction
- An Overview of TCP/IP

Part II Building Your Own Firewall

- Firewall Gateways
- How to Build an Application-Level Gateway
- Authentication
- Gateway Tools
- Traps, Lures, and Honey Pots
- The Hacker's Workbench

Part III A Look Back

- Classes of Attacks
- An Evening with Berferd
- Where the Wild Things Are: A Look at the Logs

Part IV Odds and Ends

- Legal Considerations
- Secure Communications over Insecure Networks
- Where Do We Go from Here?

Appendices

- Useful Free Stuff
- TCP and UDP Ports
- Recommendations to Vendors

Bibliography
List of Bombs
Index


I hope that you benifit from reading this, 'cause I am.