A switch device configured to relay communication between a first device disposed in a first network and a second device disposed in a second network, the switch device comprising: a reception unit configured to receive, from the second device, information of a second virtual network used in the second network in response to a transmission request for information of a virtual network used in the communication from the first device; a virtual local area network correspondence table configured to store a first virtual network tag of the first virtual network used in the first network corresponding to a second virtual network tag of the second virtual network; a selection unit configured to select a first virtual network, corresponding to the second virtual network, in the first network, based on the first virtual network tag corresponding to the second virtual network tag; a notification unit configured to notify the first device of information of the first virtual network selected by the selection unit as information of a selected virtual network used in the communication by sending a packet which has a header including a virtual local area network identifier of the first virtual network selected by the selection unit; and a relay unit configured to: rewrite information of the first virtual network in data received from the first device to information of the second virtual network and forward the rewritten data to the second device; and rewrite information of the second virtual network in data received from the second device to information of the first virtual network and forward the rewritten data to the first device. a reception unit configured to receive, from the second device, information of a second virtual network used in the second network in response to a transmission request for information of a virtual network used in the communication from the first device; a virtual local area network correspondence table configured to store a first virtual network tag of the first virtual network used in the first network corresponding to a second virtual network tag of the second virtual network; a selection unit configured to select a first virtual network, corresponding to the second virtual network, in the first network, based on the first virtual network tag corresponding to the second virtual network tag; a notification unit configured to notify the first device of information of the first virtual network selected by the selection unit as information of a selected virtual network used in the communication by sending a packet which has a header including a virtual local area network identifier of the first virtual network selected by the selection unit; and a relay unit configured to: rewrite information of the first virtual network in data received from the first device to information of the second virtual network and forward the rewritten data to the second device; and rewrite information of the second virtual network in data received from the second device to information of the first virtual network and forward the rewritten data to the first device. rewrite information of the first virtual network in data received from the first device to information of the second virtual network and forward the rewritten data to the second device; and rewrite information of the second virtual network in data received from the second device to information of the first virtual network and forward the rewritten data to the first device.