Method for configuring a device in a local area network using a gateway, the gateway being communicatively coupled to a remote management server outside the local area network, the local area network comprising a protected portion and an unprotected portion, the protected portion being restricted for only specific use by one or more different devices, the unprotected portion being fully open for communication of devices connected with the gateway, whereby the remote management server is loaded with or has access to configuration data for a plurality of user devices and is aware of users that are allowed to operate within the protected portion of the local area network, the method comprising the following actions executed by the gateway: a) receiving a connection request from a user device; b) providing an address to the user device, the address enabling the user device to establish a connection with the gateway within the unprotected portion of the local area network; c) receiving a configuration request from the user device, the configuration request including device information, said device information being usable to unambiguously link the user device to the user of the user device; d) appending network information to the configuration request, said network information being based on analysis of the device information and linking the device information to the user of the user device, and sending the appended configuration request to the remote management server; e) receiving a configuration response message including configuration data from the remote management server; and f) establishing configuration of the user device within the protected portion of the local area network on the basis of the configuration data, so that the gateway performs a network configuration including adding the user device to devices that can operate within the protected portion of the local area network and establishing a connection between the user device and the gateway within the protected portion of the local area network. a) receiving a connection request from a user device; b) providing an address to the user device, the address enabling the user device to establish a connection with the gateway within the unprotected portion of the local area network; c) receiving a configuration request from the user device, the configuration request including device information, said device information being usable to unambiguously link the user device to the user of the user device; d) appending network information to the configuration request, said network information being based on analysis of the device information and linking the device information to the user of the user device, and sending the appended configuration request to the remote management server; e) receiving a configuration response message including configuration data from the remote management server; and f) establishing configuration of the user device within the protected portion of the local area network on the basis of the configuration data, so that the gateway performs a network configuration including adding the user device to devices that can operate within the protected portion of the local area network and establishing a connection between the user device and the gateway within the protected portion of the local area network.