A route configuration method, wherein the method comprises: obtaining, by a session management network element, virtual local area network, VLAN, information of a first port, wherein the first port is a port, which corresponds to an established PDU session of a first terminal, on a first user plane network element, and the first user plane network element is a user plane network element that serves the first terminal, wherein the VLAN information of the first port comprises a default virtual local area network identifier, VID, of the first port, and an allowed VID list of the first port; generating, by the session management network element, first routing information and second routing information based on the VLAN information of the first port, wherein the first routing information is used by the first user plane network element to handle a first packet, the first packet is an uplink packet of the first terminal received by the first user plane network element through the first port, the second routing information is used by the first user plane network element to handle a second packet, and the second packet is a downlink packet to be sent by the first user plane network element to the first terminal through the first port; and sending, by the session management network element, the first routing information and the second routing information to the first user plane network element, wherein the first routing information comprises the default VID of the first port and the allowed VID list of the first port; and that the first routing information is used by the first user plane network element to handle a first packet comprises a combination of one or more of the following: the first routing information indicates the first user plane network element to add the default VID of the first port to the first packet when the first packet does not carry a VID; the first routing information indicates the first user plane network element to accept the first packet when the allowed VID list of the first port comprises a VID carried in the first packet; or the first routing information indicates the first user plane network element to discard the first packet when the allowed VID list of the first port does not comprise a VID carried in the first packet. obtaining, by a session management network element, virtual local area network, VLAN, information of a first port, wherein the first port is a port, which corresponds to an established PDU session of a first terminal, on a first user plane network element, and the first user plane network element is a user plane network element that serves the first terminal, wherein the VLAN information of the first port comprises a default virtual local area network identifier, VID, of the first port, and an allowed VID list of the first port; generating, by the session management network element, first routing information and second routing information based on the VLAN information of the first port, wherein the first routing information is used by the first user plane network element to handle a first packet, the first packet is an uplink packet of the first terminal received by the first user plane network element through the first port, the second routing information is used by the first user plane network element to handle a second packet, and the second packet is a downlink packet to be sent by the first user plane network element to the first terminal through the first port; and sending, by the session management network element, the first routing information and the second routing information to the first user plane network element, wherein the first routing information comprises the default VID of the first port and the allowed VID list of the first port; and that the first routing information is used by the first user plane network element to handle a first packet comprises a combination of one or more of the following: the first routing information indicates the first user plane network element to add the default VID of the first port to the first packet when the first packet does not carry a VID; the first routing information indicates the first user plane network element to accept the first packet when the allowed VID list of the first port comprises a VID carried in the first packet; or the first routing information indicates the first user plane network element to discard the first packet when the allowed VID list of the first port does not comprise a VID carried in the first packet. the first routing information indicates the first user plane network element to add the default VID of the first port to the first packet when the first packet does not carry a VID; the first routing information indicates the first user plane network element to accept the first packet when the allowed VID list of the first port comprises a VID carried in the first packet; or the first routing information indicates the first user plane network element to discard the first packet when the allowed VID list of the first port does not comprise a VID carried in the first packet.