An electronic device comprising: at least one sensor; a communication circuit; and at least one processor operatively connected to the at least one sensor and the communication circuit, wherein the at least one processor is configured to: receive a system information block including information about a plurality of coverage levels for random access to a first base station from the first base station by using the communication circuit; transmit a first message including a preamble with a first transmission power corresponding to a first coverage level of the plurality of coverage levels to the first base station multiple times by using the communication circuit; obtain movement information of the electronic device by using the communication circuit or the at least one sensor; and attempt random access to a second base station different from the first base station when a number of transmissions of the first message to the first base station is greater than or equal to a specified first value and the movement information of the electronic device meets a specified condition; wherein the information about the plurality of coverage levels includes a maximum preamble attempt number and a number of repetitions per preamble attempt for the plurality of coverage levels; wherein the at least one processor is further configured to transmit the first message to the first base station with a second transmission power corresponding to a second coverage level of the plurality of coverage levels, the second coverage level being higher than the first coverage level when the number of transmissions of the first message is greater than or equal to a specified second value and the movement information does not meet the specified condition, and wherein the specified second value is set based on a first maximum preamble attempt number for the first coverage level and a first number of repetitions per preamble attempt for the first coverage level. at least one sensor; a communication circuit; and at least one processor operatively connected to the at least one sensor and the communication circuit, wherein the at least one processor is configured to: receive a system information block including information about a plurality of coverage levels for random access to a first base station from the first base station by using the communication circuit; transmit a first message including a preamble with a first transmission power corresponding to a first coverage level of the plurality of coverage levels to the first base station multiple times by using the communication circuit; obtain movement information of the electronic device by using the communication circuit or the at least one sensor; and attempt random access to a second base station different from the first base station when a number of transmissions of the first message to the first base station is greater than or equal to a specified first value and the movement information of the electronic device meets a specified condition; wherein the information about the plurality of coverage levels includes a maximum preamble attempt number and a number of repetitions per preamble attempt for the plurality of coverage levels; wherein the at least one processor is further configured to transmit the first message to the first base station with a second transmission power corresponding to a second coverage level of the plurality of coverage levels, the second coverage level being higher than the first coverage level when the number of transmissions of the first message is greater than or equal to a specified second value and the movement information does not meet the specified condition, and wherein the specified second value is set based on a first maximum preamble attempt number for the first coverage level and a first number of repetitions per preamble attempt for the first coverage level. receive a system information block including information about a plurality of coverage levels for random access to a first base station from the first base station by using the communication circuit; transmit a first message including a preamble with a first transmission power corresponding to a first coverage level of the plurality of coverage levels to the first base station multiple times by using the communication circuit; obtain movement information of the electronic device by using the communication circuit or the at least one sensor; and attempt random access to a second base station different from the first base station when a number of transmissions of the first message to the first base station is greater than or equal to a specified first value and the movement information of the electronic device meets a specified condition; wherein the information about the plurality of coverage levels includes a maximum preamble attempt number and a number of repetitions per preamble attempt for the plurality of coverage levels; wherein the at least one processor is further configured to transmit the first message to the first base station with a second transmission power corresponding to a second coverage level of the plurality of coverage levels, the second coverage level being higher than the first coverage level when the number of transmissions of the first message is greater than or equal to a specified second value and the movement information does not meet the specified condition, and wherein the specified second value is set based on a first maximum preamble attempt number for the first coverage level and a first number of repetitions per preamble attempt for the first coverage level.