主权项 |
1. A server, for automatically setting a mode of the server according to a state of a network of the server, wherein the mode of the server is selected from the group comprising a positive mode and a negative mode, and when the server operates in the positive mode, the server provides Dynamic Host Configuration Protocol (DHCP) service in the network, and when the server operates in the negative mode, the server does not provide DHCP service in the network, the server comprising:
at least one processor; a storage system; one or more programs that are stored in the storage system and are executed by the at least one processor, comprising: a monitoring module detecting a DHCP offer packet provided by another DHCP server in the network, wherein the DHCP offer packet records a mode of the another DHCP server; an analyzing module, determining the mode of the another DHCP server according to the DHCP offer packet; and a mode setting module, setting the mode of the server to the negative mode when the sever boots, maintaining the server in the negative mode when the another DHCP server operates in the positive mode, and setting the mode of the server to the positive mode when the monitoring module does not detect the DHCP offer packet in the network, wherein the monitoring module broadcasts an DHCP discover packet at an interval in the network to detect the DHCP offer packet in the network. |