The present invention provides a repeater which automatically closes a
dynamically opened port in accordance with prior setting, the repeater
including: a port mapping table where a global IP address and an external
port number, or an external port number on the Internet is associated
with a local IP address and an internal port number of a terminal
connected to a LAN; a control unit which, receiving a communications
packet to which an external port number is specified, converts the
external port number to an internal port number based on the port mapping
table and transfers the internal port number to the LAN; a timer unit
which counts the unoccupied time of the port after transferring a
communications packet to which an external port number is specified; and
a port management unit which checks whether the registered machine is
present on the LAN and in case it is absent, deletes registration
concerning the external port number from the port mapping table.