A packet forwarding method, the method comprising: receiving, by an Input/Output, I/O, board of a Virtual extensible Local Area Network, VXLAN, switch, a packet from a Virtual Local Area Network, VLAN; searching out by the I/O board a layer 3 entry matching a destination Internet Protocol, IP, address of the packet from a local layer 3 table; when an egress port in the layer 3 entry is a VXLAN tunnel port, modifying by the I/O board a source Media Access Control, MAC, address of the packet into a gateway MAC address of the VXLAN switch; modifying by the I/O board a destination MAC address of the packet into a MAC address in the layer 3 entry; and sending by the I/O board the modified packet to a fabric board of the VXLAN switch; receiving, by the fabric board of the VXLAN switch, the packet sent by the I/O board; determining by the fabric board to perform layer 2 forwarding for the received packet; searching out by the fabric board a MAC entry matching the destination MAC address of the packet from a local MAC table; and when an egress port in the MAC entry is a VXLAN tunnel port, sending by the fabric board the packet to an I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch; and receiving, by the I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch, the packet sent by the fabric board; adding, by the I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch, VXLAN encapsulation to the received packet; and forwarding, by the I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch, the packet with the VXLAN encapsulation to a VXLAN. receiving, by an Input/Output, I/O, board of a Virtual extensible Local Area Network, VXLAN, switch, a packet from a Virtual Local Area Network, VLAN; searching out by the I/O board a layer 3 entry matching a destination Internet Protocol, IP, address of the packet from a local layer 3 table; when an egress port in the layer 3 entry is a VXLAN tunnel port, modifying by the I/O board a source Media Access Control, MAC, address of the packet into a gateway MAC address of the VXLAN switch; modifying by the I/O board a destination MAC address of the packet into a MAC address in the layer 3 entry; and sending by the I/O board the modified packet to a fabric board of the VXLAN switch; receiving, by the fabric board of the VXLAN switch, the packet sent by the I/O board; determining by the fabric board to perform layer 2 forwarding for the received packet; searching out by the fabric board a MAC entry matching the destination MAC address of the packet from a local MAC table; and when an egress port in the MAC entry is a VXLAN tunnel port, sending by the fabric board the packet to an I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch; and receiving, by the I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch, the packet sent by the fabric board; adding, by the I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch, VXLAN encapsulation to the received packet; and forwarding, by the I/O board associated with the egress port in the MAC entry in the gateway VXLAN switch, the packet with the VXLAN encapsulation to a VXLAN.