A method for forwarding a data packet, comprising: receiving, by a line card of a layer-three virtual extensible local area network, VXLAN, gateway, a data packet; determining, by the line card of the layer-three VXLAN gateway, to perform a layer-three forwarding to the data packet; taking, by the line card of the layer-three VXLAN gateway, a fabric board of a category as a destination fabric board, wherein: the category matches with a value of a set bit position in a destination internal protocol, IP, address of the data packet, the category that matches with the value is from among two or more categories of the layer-three VXLAN gateway, fabric boards of different categories store different address resolution protocol, ARP, entries, and fabric boards of the category that matches with the value store ARP entries meeting a condition: a value of a set bit position in a destination IP address of an ARP entry is the same as the value of the set bit position of the destination IP address in the data packet; transmitting, by the line card of the layer-three VXLAN gateway, the data packet to the destination fabric board, such that the destination fabric board determines to perform the layer-three forwarding to the data packet, searches in ARP entries stored by the destination fabric board for an ARP entry matching with the destination IP address of the data packet, and cooperates with a first destination line card associated with an output port in the ARP entry searched out to forward the data packet, after receiving the data packet from the line card of the layer-three VXLAN gateway. receiving, by a line card of a layer-three virtual extensible local area network, VXLAN, gateway, a data packet; determining, by the line card of the layer-three VXLAN gateway, to perform a layer-three forwarding to the data packet; taking, by the line card of the layer-three VXLAN gateway, a fabric board of a category as a destination fabric board, wherein: the category matches with a value of a set bit position in a destination internal protocol, IP, address of the data packet, the category that matches with the value is from among two or more categories of the layer-three VXLAN gateway, fabric boards of different categories store different address resolution protocol, ARP, entries, and fabric boards of the category that matches with the value store ARP entries meeting a condition: a value of a set bit position in a destination IP address of an ARP entry is the same as the value of the set bit position of the destination IP address in the data packet; the category matches with a value of a set bit position in a destination internal protocol, IP, address of the data packet, the category that matches with the value is from among two or more categories of the layer-three VXLAN gateway, fabric boards of different categories store different address resolution protocol, ARP, entries, and fabric boards of the category that matches with the value store ARP entries meeting a condition: a value of a set bit position in a destination IP address of an ARP entry is the same as the value of the set bit position of the destination IP address in the data packet; transmitting, by the line card of the layer-three VXLAN gateway, the data packet to the destination fabric board, such that the destination fabric board determines to perform the layer-three forwarding to the data packet, searches in ARP entries stored by the destination fabric board for an ARP entry matching with the destination IP address of the data packet, and cooperates with a first destination line card associated with an output port in the ARP entry searched out to forward the data packet, after receiving the data packet from the line card of the layer-three VXLAN gateway.