The invention relates to the fields of information security and anonymous communication, and discloses a grouping rerouting method for an anonymous communication system. The method comprises the following steps of: 1, supposing that the anonymous communication system comprises N nodes of which each has the attributes of the home autonomous system of an Internet protocol (IP) address, the home nation of the IP address and social relations, and obtaining an attribute vector by using an attribute set consisting of the three attributes; 2, computing similarity between any two of the N nodes, and grouping the N nodes into five according to computational results; 3, computing the average node bandwidth of each group, namely computing a value obtained by dividing the number of the nodes in each group by using the summation of bandwidths of all the nodes in the group; and 4, performing anonymous communication path selection. By the method, the resistance of the anonymous communication system to a plurality of active and passive attacks can be improved, the security performance of the system is greatly improved, and simultaneously, the overall efficiency and performance of the system are combined.