A method for processing a packet in an access network, comprising: receiving, by an access device, a layer 2 protocol packet sent by a central device, wherein a destination address of the layer 2 protocol packet is a Media Access Control, MAC, address of the access device, the access device is configured to connect to user equipment, and the central device is configured to connect the access device to an Internet Protocol, IP network; obtaining, by the access device, flow table information according to the layer 2 protocol packet, wherein the flow table information comprises a match field and an instruction, and generating, by the access device, a flow table entry according to the flow table information, wherein the flow table entry comprises the match field and the instruction; receiving, by the access device, a service packet sent by the user equipment; and determining, by the access device, a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, processing the service packet according to the instruction in the generated flow table entry, wherein when a gigabit passive optical network, GPON, or a next-generation GPON is between the access device and the central device, the central device is an optical line terminal, OLT, the access device is an optical network unit, ONU, and the layer 2 protocol packet is an optical network terminal, ONT, management and control interface, OMCI, protocol packet, wherein the OMCI protocol packet carries a uniform resource identifier, URI, of a configuration file, and the OMCI protocol packet comprises a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and the obtaining, by the access device, flow table information according to the layer 2 protocol packet comprises: when the access device determines that the OMCI protocol packet carries the second message identifier, accessing, by the access device, the configuration file according to the URI, to obtain the flow table information from the configuration file. receiving, by an access device, a layer 2 protocol packet sent by a central device, wherein a destination address of the layer 2 protocol packet is a Media Access Control, MAC, address of the access device, the access device is configured to connect to user equipment, and the central device is configured to connect the access device to an Internet Protocol, IP network; obtaining, by the access device, flow table information according to the layer 2 protocol packet, wherein the flow table information comprises a match field and an instruction, and generating, by the access device, a flow table entry according to the flow table information, wherein the flow table entry comprises the match field and the instruction; receiving, by the access device, a service packet sent by the user equipment; and determining, by the access device, a matching flow table entry according to the service packet, and when the matching flow table entry is the generated flow table entry, processing the service packet according to the instruction in the generated flow table entry, wherein when a gigabit passive optical network, GPON, or a next-generation GPON is between the access device and the central device, the central device is an optical line terminal, OLT, the access device is an optical network unit, ONU, and the layer 2 protocol packet is an optical network terminal, ONT, management and control interface, OMCI, protocol packet, wherein the OMCI protocol packet carries a uniform resource identifier, URI, of a configuration file, and the OMCI protocol packet comprises a second message identifier, where the second message identifier is used to identify that the OMCI protocol packet carries the URI; and the obtaining, by the access device, flow table information according to the layer 2 protocol packet comprises: when the access device determines that the OMCI protocol packet carries the second message identifier, accessing, by the access device, the configuration file according to the URI, to obtain the flow table information from the configuration file.