Method for allocating port of address conversion device and address conversion device

The invention discloses a method for allocating a port of an address conversion device and the address conversion device. One public IP address is configured for a user group by the address conversion device, and one fixed port block is allocated for each user in the user group in a fixed allocation port space; and when ports in the fixed port blocks of the users are exhausted, one or more available dynamic port blocks are allocated for the users in a dynamic allocation port space by the address conversion device. According to the method for allocating the port of the address conversion device and the address conversion device, the dynamic port blocks can be allocated for the users according to requirements of the users. On the basis of allocating the fixed port blocks for the users in advance, extra port blocks are dynamically allocated, and fairness in allocating the port blocks dynamically is realized to the largest extent by utilizing a recovery mechanism, a competition allocation mechanism and a user weight management mechanism.