Installing and Administering PPP

8
Contents
Filter Stanzas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Packets Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Internet Protocol (IP) Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Internet Control Message Protocol (ICMP) Level. . . . . . . . . . . . . . . . 94
Transmission Control Protocol (TCP) Level . . . . . . . . . . . . . . . . . . . . 95
User Datagram Protocol (UDP) Level . . . . . . . . . . . . . . . . . . . . . . . . . 96
Building a Stanza - General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Building a Stanza - Speciļ¬cs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Numbers and Addresses. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Keywords with Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Keywords with Origins and Destinations . . . . . . . . . . . . . . . . . . . . . 101
Keywords Based on TCP Packet Header Bits . . . . . . . . . . . . . . . . . . 102
Keywords Based on IP Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
frag Keyword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
all Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Time-Based Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Unreach Keyword and Sending ICMP Messages . . . . . . . . . . . . . . . 104
Log and Trace Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Stanza Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Writing a Stanza - A Complex UDP Example . . . . . . . . . . . . . . . . . . . 108
An Unsafe Domain Name System Rule. . . . . . . . . . . . . . . . . . . . . . . 108
What Happens During Domain Name Queries. . . . . . . . . . . . . . . . . 108
Developing Safer Domain Name Request Rules . . . . . . . . . . . . . . . . 109
Writing a Stanza - TCP Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Two Approaches to Filtering TCP connections . . . . . . . . . . . . . . . . . 114
Identifying Rulesets with Hostnames and Addresses . . . . . . . . . . . 114
A Note on Ruleset Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Ordering Stanzas Effectively . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Isolating an 'Incorrect' Stanza . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Working with Default Rulesets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116