John Voigt posted the a way to accomplish this to the m0n0wall mailing list on September 22, 2004.
Chris Buechler is working on making this more understandable and easier to follow. You can see the work in progress on the wiki here for now.