A computer device which can be connected to a home network and to a
foreign network is provided with a local security mechanism, called a
personal firewall, for protecting the computer device from attacks from
the foreign network, in addition to or instead of a firewall in the
internal network which protects the computer when connected to the
internal network. The personal firewall is arranged to detect its current
location, i.e. to determine the network to which it is connected at each
particular moment, and to control its operation accordingly. The current
location of the computer device is first determined on the basis of a
currently used IP address of the computer device. Then this location
determined on the basis of the current IP address of the computer device
is verified by carrying out an additional location verification procedure
with a predetermined network element.