An Internet Protocol address allocation method performed by a router, the method comprising: • receiving a delegate prefix of an upper-level network device sent by the upper-level network device, wherein the upper-level network device is a network device connected to a wide area network WAN interface of the router (S 201), if the router starts a cascade mode, performing the following steps: • configuring a next bit of a lowest bit of the delegate prefix of the upper-level network device to be a first bit value, and adding a random value after the next bit to obtain a local prefix of the router, so that a quantity of bits in the local prefix of the router is equal to a quantity of bits in a prefix of an end-system unique identifier, EUI, wherein a quantity of bits in the delegate prefix of the upper-level network device is less than the quantity of bits in the prefix of the EUI, • configuring the next bit to be a second bit value and increasing a quantity of bits in the delegate prefix of the upper-level network device by one to obtain a delegate prefix of the router, wherein the first bit value is different from the second bit value(S 202), and • sending the local prefix of the router and the delegate prefix of the router to a lower-level router of the router, wherein the lower-level router is a router connected to a local area network LAN interface of the router, wherein the local prefix of the router is used to enable the lower-level router to determine an Internet Protocol, IP, address of a WAN interface of the lower-level router and the delegate prefix of the router is used to enable the lower-level router to generate a local prefix of the lower-level router (S 203). • receiving a delegate prefix of an upper-level network device sent by the upper-level network device, wherein the upper-level network device is a network device connected to a wide area network WAN interface of the router (S 201), • configuring a next bit of a lowest bit of the delegate prefix of the upper-level network device to be a first bit value, and adding a random value after the next bit to obtain a local prefix of the router, so that a quantity of bits in the local prefix of the router is equal to a quantity of bits in a prefix of an end-system unique identifier, EUI, wherein a quantity of bits in the delegate prefix of the upper-level network device is less than the quantity of bits in the prefix of the EUI, • configuring the next bit to be a second bit value and increasing a quantity of bits in the delegate prefix of the upper-level network device by one to obtain a delegate prefix of the router, wherein the first bit value is different from the second bit value(S 202), and • sending the local prefix of the router and the delegate prefix of the router to a lower-level router of the router, wherein the lower-level router is a router connected to a local area network LAN interface of the router, wherein the local prefix of the router is used to enable the lower-level router to determine an Internet Protocol, IP, address of a WAN interface of the lower-level router and the delegate prefix of the router is used to enable the lower-level router to generate a local prefix of the lower-level router (S 203).