A method for obtaining a cross-domain link, wherein the method comprises: sending, by a control device, a first message to a forwarding device in an internet protocol, IP, domain, wherein the first message is used to instruct the forwarding device to search for a device that is adjacent to the forwarding device and that is in an optical domain by sending a second message; in response to sending the first message, receiving, by the control device, a third message from an optical network element in the optical domain, wherein the third message comprises a first identifier, a second identifier, and a media access control, MAC, address of the forwarding device, the first identifier is used to identify the optical network element, the second identifier is used to identify a port that communicates with the forwarding device and that is on the optical network element, and the optical network element is the device that is adjacent to the forwarding device and that is in the optical domain; and obtaining, by the control device, the cross-domain link between the forwarding device and the optical network element based on the first identifier, the second identifier, and the MAC address of the forwarding device; wherein the first control device determines that there is a connection between the optical network element in the optical domain and the forwarding device, by triggering the forwarding device to send the second message to the optical domain through broadcast; wherein the obtaining, by the control device, the cross-domain link between the forwarding device and the optical network element based on the first identifier, the second identifier, and the MAC address of the forwarding device comprises: obtaining, by the control device, a correspondence based on the first identifier, the second identifier, and the MAC address of the forwarding device, wherein the correspondence is used to indicate the cross-domain link between the forwarding device and the optical network element, and the correspondence comprises the first identifier, the second identifier, and the MAC address of the forwarding device. sending, by a control device, a first message to a forwarding device in an internet protocol, IP, domain, wherein the first message is used to instruct the forwarding device to search for a device that is adjacent to the forwarding device and that is in an optical domain by sending a second message; in response to sending the first message, receiving, by the control device, a third message from an optical network element in the optical domain, wherein the third message comprises a first identifier, a second identifier, and a media access control, MAC, address of the forwarding device, the first identifier is used to identify the optical network element, the second identifier is used to identify a port that communicates with the forwarding device and that is on the optical network element, and the optical network element is the device that is adjacent to the forwarding device and that is in the optical domain; and obtaining, by the control device, the cross-domain link between the forwarding device and the optical network element based on the first identifier, the second identifier, and the MAC address of the forwarding device; wherein the first control device determines that there is a connection between the optical network element in the optical domain and the forwarding device, by triggering the forwarding device to send the second message to the optical domain through broadcast; wherein the obtaining, by the control device, the cross-domain link between the forwarding device and the optical network element based on the first identifier, the second identifier, and the MAC address of the forwarding device comprises: obtaining, by the control device, a correspondence based on the first identifier, the second identifier, and the MAC address of the forwarding device, wherein the correspondence is used to indicate the cross-domain link between the forwarding device and the optical network element, and the correspondence comprises the first identifier, the second identifier, and the MAC address of the forwarding device.