According to a fourth aspect, an embodiment of the present disclosure provides a network device, including: a sending module, configured to send first resource configuration information to a terminal, where the first resource configuration information is used to indicate M first frequency resources and N second frequency resources, and M and N are positive integers greater than or equal to 1; and a receiving module, configured to receive a random access request sent by the terminal on a target first frequency resource, where the sending module is further configured to send a random access response on a target second frequency resource to the terminal, where the target first frequency resource is a free frequency resource in the M first frequency resources, and the target second frequency resource is a free frequency resource in the N second frequency resources.
According to a fifth aspect, an embodiment of the present disclosure provides a terminal, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where when the computer program is executed by the processor, steps of the random access method according to the first aspect are implemented.
According to a sixth aspect, an embodiment of the present disclosure provides a network device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where when the computer program is executed by the processor, steps of the random access method according to the second aspect are implemented.