A method for implementing load balancing, wherein the method is applied to a system that comprises a controller and a mesh network, the mesh network comprises multiple switches (S1..Sn), and the method is executed by the controller and comprises: obtaining a port attribute of each port of a first switch, wherein the first switch is any switch in the mesh network, and the port attribute is used to indicate that the port is a user-side port or a network-side port; determining, according to the port attribute of each port of the first switch, a virtual routing and forwarding instance corresponding to each port of the first switch, wherein a user-side port and a network-side port correspond to different virtual routing and forwarding instances, and all user-side ports of the first switch correspond to a first virtual routing and forwarding instance; generating a forwarding table of the first switch according to a topology of the mesh network and the virtual routing and forwarding instance corresponding to each port of the first switch, wherein a first forwarding entry of the forwarding table comprises the first virtual routing and forwarding instance, a first destination network segment corresponding to the first virtual routing and forwarding instance and at least two forwarding paths corresponding to the first destination network segment; and sending the forwarding table to the first switch, wherein the forwarding table is used to enable the first switch to select, according to a load balancing algorithm and the first forwarding entry and from the at least two forwarding paths corresponding to the first destination network segment, a target forwarding path for a packet corresponding to the first destination network segment. obtaining a port attribute of each port of a first switch, wherein the first switch is any switch in the mesh network, and the port attribute is used to indicate that the port is a user-side port or a network-side port; determining, according to the port attribute of each port of the first switch, a virtual routing and forwarding instance corresponding to each port of the first switch, wherein a user-side port and a network-side port correspond to different virtual routing and forwarding instances, and all user-side ports of the first switch correspond to a first virtual routing and forwarding instance; generating a forwarding table of the first switch according to a topology of the mesh network and the virtual routing and forwarding instance corresponding to each port of the first switch, wherein a first forwarding entry of the forwarding table comprises the first virtual routing and forwarding instance, a first destination network segment corresponding to the first virtual routing and forwarding instance and at least two forwarding paths corresponding to the first destination network segment; and sending the forwarding table to the first switch, wherein the forwarding table is used to enable the first switch to select, according to a load balancing algorithm and the first forwarding entry and from the at least two forwarding paths corresponding to the first destination network segment, a target forwarding path for a packet corresponding to the first destination network segment.