HP-UX IPFilter Version A.03.05.14 Administrator's Guide
Rules and Keywords
IPFilter Keywords
Chapter 234
keep state: Protecting TCP, UDP, and ICMP Sessions
Use keep state to identify and authorize individual TCP, UDP, and
ICMP sessions that pass multiple packets back and forth. keep state
enables IPFilter to distinguish legitimate traffic from port scanners and
DoS attacks.
IPFilter maintains a state table. The state table is a list of open TCP,
UDP, and ICMP sessions. If a packet matches an entry in the state table,
it passes through the firewall without being checked against the ruleset.
This enhances the performance of the IPFilter system.
IPFilter checks both inbound and outbound packets against the state
table. If either an inbound or an outbound packet matches a session in
the state table, it is not checked against the ruleset.
You can use keep state to limit the number of rules you must configure.
Use keep state to pass or block the first packet in a TCP, UDP, or ICMP
session. When a packet matches a keep state rule, and entry is added
to the state table. You do not need to configure rules for all the other
types of traffic that might pass within a specific session.
For example, you can use the keep state keyword with IPFilter rules to
protect an SSH server.
block out quick on lan0 all
pass in quick on lan0 proto tcp from any to 20.20.20.1/32 port
= 22 keep state
Using the keep state keyword, after the first SYN packet is received by
the SSH server, an entry is made in the IPFilter state table. The
remainder of the SSH session continues without any further packets
within the session being checked against the IPFilter ruleset. Therefore,
the outbound traffic can flow freely within the session, despite the
block-out rule specified.
<= le true if port is less than or equal to configured
value
>= ge true if port is greater than or equal to
configured value
Operand Alias Result