A method for anonymous communication, comprising: after receiving an anonymous communication request initiated by a terminal, the network allocating an anonymous identification identifier to the terminal, and recording a state of the terminal as an anonymous communication state; when the terminal is in the anonymous communication state, an access gateway device where the terminal is located replacing a source access identifier in a data message with the anonymous identification identifier while receiving the data message transmitted by the terminal, and including source routing-location identifier corresponding to the source access identifier in the data message sent with the anonymous identification identifier to a destination node; and replacing an anonymous identification identifier in the data message transmitted to the terminal with the source access identifier of the terminal while receiving the data message transmitted to the terminal, wherein the method is applied in an architecture network with identification identifier and locator separation, the architecture network with identification identifier and locator separation is divided into an access network and a backbone network, the access network is located at the edge of the backbone network and is responsible for the access of the terminal, the backbone network is responsible for the routing of the terminal, the access gateway device is located at a boundary point of the backbone network and the access network and interfaces with the access network and the backbone network; and the source access identifier is used in the access network and always remains the same when the terminal moves, wherein the source routing-location identifier indicates the location where the terminal is currently located, and the anonymous identification identifier is a new access identifier which is used in the backbone network. after receiving an anonymous communication request initiated by a terminal, the network allocating an anonymous identification identifier to the terminal, and recording a state of the terminal as an anonymous communication state; when the terminal is in the anonymous communication state, an access gateway device where the terminal is located replacing a source access identifier in a data message with the anonymous identification identifier while receiving the data message transmitted by the terminal, and including source routing-location identifier corresponding to the source access identifier in the data message sent with the anonymous identification identifier to a destination node; and replacing an anonymous identification identifier in the data message transmitted to the terminal with the source access identifier of the terminal while receiving the data message transmitted to the terminal, wherein the method is applied in an architecture network with identification identifier and locator separation, the architecture network with identification identifier and locator separation is divided into an access network and a backbone network, the access network is located at the edge of the backbone network and is responsible for the access of the terminal, the backbone network is responsible for the routing of the terminal, the access gateway device is located at a boundary point of the backbone network and the access network and interfaces with the access network and the backbone network; and the source access identifier is used in the access network and always remains the same when the terminal moves, wherein the source routing-location identifier indicates the location where the terminal is currently located, and the anonymous identification identifier is a new access identifier which is used in the backbone network.