The network
relay device of the invention makes a pair with at least a specific network device to
relay data in a network. The network
relay device includes: a control module that sends and receives a control frame
signal to and from the specific network device, selects either of a master mode and a
backup mode based on at least the control frame
signal sent from the specific network device, and changes a working state according to a result of the selection; and a communication module that is under control of the control module to open a port and enable
data transmission via a line linked to the port in the case of setting a master state to the working state, and to block off the port and disconnect the line linked to the port in the case of setting a
backup state or another non-master state to the working state. The control module changes the working state from the
backup state to a first
intermediate state in response to selection of the master mode, determines whether the specific network device is in the backup state, based on the control frame
signal sent from the specific network device, and changes the working state from the first
intermediate state to the master state after confirmation that the specific network is in the backup state.