1. A packet relay device which relays packets, comprising: a packet receiving unit which receives packets from an input line; a switch for switching the packets received by the packet receiving unit; a packet sending unit which sends the packets switched by the switch, through an output line; an associative memory which holds a plurality of flow entries with a set condition identifying a flow to which the packets belong, and, when header information of the input packets satisfies a condition of any of the flow entries, outputs an address of the flow entry with the satisfied condition; and a packet search unit which executes an action associated with the flow to which the packets belong, based on an output of the associative memory, and wherein the packet search unit has an action register which holds information specifying an action to be executed, holds address range information including consecutive address ranges of the associative memory and the action registers in association with each other, registers the plurality of flow entries with the conditions identifying the flows associated with the same action at a plurality of addresses in the same address range, inputs the header information of the packets to the associative memory, determines an address range including the address output from the associative memory, determines the action to be performed for the packets, in accordance with information read out from the action register corresponding to the determined address range, and executes the determined action.