A multicast forwarding entry generation method in a Virtual Extensible Local Area Network, VXLAN, environment, comprising the steps of: receiving, by an access gateway (600, 700), a first multicast packet from a first border gateway; generating, by the access gateway (600, 700), a first multicast forwarding entry based on the first multicast packet, wherein the first multicast forwarding entry comprises an address of the first border gateway and information about a multicast source; receiving, by the access gateway (600, 700), a second multicast packet from a second border gateway, wherein the second multicast packet comprises an address of the second border gateway and the information about the multicast source, and the second multicast packet and the first multicast packet correspond to the same multicast source; determining, by the access gateway (600, 700), a first path to the multicast source through the first border gateway and a second path to the multicast source through the second border gateway; determining, by the access gateway (600, 700), an optimal path to the multicast source based on the first path and the second path; and generating, by the access gateway (600, 700), a forwarding entry of the multicast source based on the optimal path; wherein the generating, by the access gateway (600, 700), a forwarding entry of the multicast source based on the optimal path comprises: when the first path is the optimal path, using the first multicast forwarding entry as the forwarding entry of the multicast source; or when the second path is the optimal path, updating the first multicast forwarding entry based on information about the second border gateway, to obtain a second multicast forwarding entry, and using the second multicast forwarding entry as the forwarding entry of the multicast source, wherein the second multicast forwarding entry comprises the address of the second border gateway and the information about the multicast source; and wherein when the first path is the optimal path, the method further comprises: discarding, by the access gateway (600, 700), the second multicast packet; and sending, by the access gateway (600, 700), a notification message to the second border gateway, wherein the notification message is used to notify the second border gateway to stop forwarding a multicast packet of the multicast source to the access gateway (600, 700). receiving, by an access gateway (600, 700), a first multicast packet from a first border gateway; generating, by the access gateway (600, 700), a first multicast forwarding entry based on the first multicast packet, wherein the first multicast forwarding entry comprises an address of the first border gateway and information about a multicast source; receiving, by the access gateway (600, 700), a second multicast packet from a second border gateway, wherein the second multicast packet comprises an address of the second border gateway and the information about the multicast source, and the second multicast packet and the first multicast packet correspond to the same multicast source; determining, by the access gateway (600, 700), a first path to the multicast source through the first border gateway and a second path to the multicast source through the second border gateway; determining, by the access gateway (600, 700), an optimal path to the multicast source based on the first path and the second path; and generating, by the access gateway (600, 700), a forwarding entry of the multicast source based on the optimal path; wherein the generating, by the access gateway (600, 700), a forwarding entry of the multicast source based on the optimal path comprises: when the first path is the optimal path, using the first multicast forwarding entry as the forwarding entry of the multicast source; or when the second path is the optimal path, updating the first multicast forwarding entry based on information about the second border gateway, to obtain a second multicast forwarding entry, and using the second multicast forwarding entry as the forwarding entry of the multicast source, wherein the second multicast forwarding entry comprises the address of the second border gateway and the information about the multicast source; and wherein when the first path is the optimal path, the method further comprises: when the first path is the optimal path, using the first multicast forwarding entry as the forwarding entry of the multicast source; or when the second path is the optimal path, updating the first multicast forwarding entry based on information about the second border gateway, to obtain a second multicast forwarding entry, and using the second multicast forwarding entry as the forwarding entry of the multicast source, wherein the second multicast forwarding entry comprises the address of the second border gateway and the information about the multicast source; and wherein when the first path is the optimal path, the method further comprises: discarding, by the access gateway (600, 700), the second multicast packet; and sending, by the access gateway (600, 700), a notification message to the second border gateway, wherein the notification message is used to notify the second border gateway to stop forwarding a multicast packet of the multicast source to the access gateway (600, 700).