摘要 |
The present invention is applicable to the network access control field and provides a method and apparatus for preventing unauthorized service access. The method includes: receiving a service access request packet, where the packet includes a domain name of a server to which access is requested and an IP address of the server to which access is requested; searching for an IP address corresponding to the domain name of the server to which access is requested; determining whether the IP address of the server to which access is requested is consistent with the found IP address; and terminating the service access request if the IP address of the server to which access is requested is inconsistent with the found IP address. According to embodiments of the present invention, the found IP address is compared with the IP address of the server to which access is requested in the packet, so as to effectively determine a service access request whose packet is tampered with and to terminate the service access request. This effectively solves a problem in which a gateway device cannot charge for a chargeable service due to tampering of a domain name in a packet by a user. |