A searching method for a Security Policy Database (SPD) is proposed. The
characteristic of peer gateway of the IPSec is applied to divide the
original SPD into multiple smaller peer-based SPDs, and build a peer
table corresponding to the peer-based SPDs. When it is required to search
the policies in the database, the peer-based SPD according to the present
invention can be directly used so as to save the time of data searching.