The current wide deployment of PON (Passive Optical Network) technologies implies that there is a wide variety of PON devices causing incompatibility problems when configuring and controlling them simultaneously. Although these devices follow the same standards, each manufacturer adds its own implementations, so there are no universal devices. SDN (Software Defined Networking) is a technology for dealing with these problem, since equipment from different manufacturers can be managed simultaneously, as SDN separates the control layer from the data layer. This paper proposes the development of an SDN agent based on the OpenFlow protocol to enable and facilitate the management of PONs, as well as being compatible with legacy PONs. In fact, this SDN agent allows to translate the OpenFlow commands sent by the SDN controller into the native language of PON devices.