Once upon a time, I wanted to take the Ubuntu Hoary CD, remove all the graphical stuff, install a preseed ("answers") file for the installer, add some components from universe, and have a nice neat firewall-on-a-CD.
Since Dapper, a "server" CD has been available, which solves the "graphical cruft" problem. I recommend preseeding that for server/firewall installs.
This has been documented in much detail, by myself and others, at https://help.ubuntu.com/community/InstallCDCustomization. Please go there.
4 pages link to UbuntuRemastering: