Table of Contents
1. Introduction...........................................................................................................................1
Why this document was written..........................................................................................1How it was written...............................................................................................................1About the author.................................................................................................................1Dedications.........................................................................................................................1
2. Preparations..........................................................................................................................3
Where to get iptables..........................................................................................................3Kernel setup .......................................................................................................................321...............................................................................................................................5userland setup....................................................................................................................6Compiling the userland applications..........................................................................6Installation on Red Hat 7.1.........................................................................................8
3. How a rule is built................................................................................................................11
Basics...............................................................................................................................11Tables ...............................................................................................................................11Commands.......................................................................................................................12Matches............................................................................................................................16Generic matches......................................................................................................16Implicit matches.......................................................................................................18TCP matches...................................................................................................19UDP matches..................................................................................................20ICMP matches.................................................................................................22Explicit matches.......................................................................................................23MAC match......................................................................................................23Limit match......................................................................................................23Multiport match................................................................................................24Mark match .....................................................................................................25Owner match...................................................................................................26State match.....................................................................................................27Unclean match ................................................................................................28TOS match......................................................................................................28TTL match.......................................................................................................29Targets/Jumps ..................................................................................................................30ACCEPT target........................................................................................................31DROP target ............................................................................................................31QUEUE target..........................................................................................................31RETURN target........................................................................................................31LOG target...............................................................................................................32MARK target ............................................................................................................33REJECT target.........................................................................................................34TOS target................................................................................................................35MIRROR target........................................................................................................36SNAT target..............................................................................................................37DNAT target .............................................................................................................38MASQUERADE target.............................................................................................39
i
Leave a Comment