Porkchop gave a talk about Firewalls in general, and specifically how to set them up in Linux with iptables. The presentation gives many concrete examples of specific scenarios, including port blocking, and ip masquerading. Further lecture notes can be found on Porkchop’s Website.