摘要 |
Disclosed is a method for obtaining an Internet protocol address, belonging to the field of communications. The method comprises: detecting PDP (Packet Data Protocol) connection information between a mobile broadband device and a network side; if the detected PDP connection information between the mobile broadband device and the network side changes, obtaining identifier information, wherein the identifier information is used for identifying the PDP connection information between the mobile broadband device and the network side; and transmitting the identifier information to a host, and enabling the host to obtain the IP (Internet Protocol) address of the host according to the identifier information. In the present invention, the mobile broadband device transmits the identifier information to the host, so that the host can set the values of state identifiers comprised by the host according to the identifier information, wherein the values of different state identifiers correspond to different connection states between the mobile broadband device and the network side; no matter what the order of the IPv4 PDP connection and the IPv6 PDP connection built by the mobile broadband device is or what the length of the time interval thereof is, the host does not need to disconnect the network during the process of obtaining the IPv4 address and the IPv6 address, so that the data service for users is not interrupted. |