A packet forwarding method performed by a first node, wherein the method comprises: determining (step 501) information about a loop-free path from the first node to a second node, wherein the first node and the second node are a pair of nodes having an anycast route, a segment identifier, SID of the first node is the same as the SID of the second node; and when the first node receives a packet to be sent to a third node and a link from the first node to the third node is faulty, forwarding (step 502) the packet to the second node based on the information about the loop-free path, so as to forward the packet to the third node through the second node; • wherein network topology information comprises a virtual node, and an address of the virtual node is the same as an address of the first node, wherein there is a virtual link between the virtual node and the first node, and there is a virtual link between the virtual node and the second node, wherein the determining information about a loop-free path from the first node to a second node comprises: • determining, by the first node, the information about the loop-free path from the first node to the second node based on the first node, the virtual node, and network topology information obtained after the virtual node and the virtual links are added. determining (step 501) information about a loop-free path from the first node to a second node, wherein the first node and the second node are a pair of nodes having an anycast route, a segment identifier, SID of the first node is the same as the SID of the second node; and when the first node receives a packet to be sent to a third node and a link from the first node to the third node is faulty, forwarding (step 502) the packet to the second node based on the information about the loop-free path, so as to forward the packet to the third node through the second node; • wherein network topology information comprises a virtual node, and an address of the virtual node is the same as an address of the first node, wherein there is a virtual link between the virtual node and the first node, and there is a virtual link between the virtual node and the second node, wherein the determining information about a loop-free path from the first node to a second node comprises: • determining, by the first node, the information about the loop-free path from the first node to the second node based on the first node, the virtual node, and network topology information obtained after the virtual node and the virtual links are added. • wherein network topology information comprises a virtual node, and an address of the virtual node is the same as an address of the first node, wherein there is a virtual link between the virtual node and the first node, and there is a virtual link between the virtual node and the second node, wherein the determining information about a loop-free path from the first node to a second node comprises: • determining, by the first node, the information about the loop-free path from the first node to the second node based on the first node, the virtual node, and network topology information obtained after the virtual node and the virtual links are added.