Patent ID: 7391782

Claim:
A packet relaying apparatus comprising: first means for selecting one or more transmission destination virtual private network identifiers which are allowed to relay a received packet based on a transmission source virtual private network identifier related to the received packet; second means for selecting one or more transmission destination domain identifiers corresponding to each of said one or more transmission destination virtual private network identifiers, the one or more transmission destination domain identifiers corresponding to a plurality of destination addresses and masks, at least one of the destination domain identifiers corresponding to a plurality of destination addresses and masks that are commonly used for the packet relaying apparatus and another packet relaying apparatus that are connected by a virtual private network; third means for collating, using a mask, a next relaying apparatus address of the received packet with each routing information stored in one or more domain relaying means which corresponds to each of the one or more domain identifiers to select the next relaying apparatus address; and fourth means for transmitting the received packet in accordance with the next relaying apparatus address selected by the third means.