diff --git a/internal/pkg/onuadaptercore/device_handler.go b/internal/pkg/onuadaptercore/device_handler.go
index dac5177..e5946f4 100644
--- a/internal/pkg/onuadaptercore/device_handler.go
+++ b/internal/pkg/onuadaptercore/device_handler.go
@@ -287,6 +287,34 @@
 	return nil
 }
 
+func (dh *DeviceHandler) DisableDevice(device *voltha.Device) {
+	logger.Debug("disable-device", log.Fields{"DeviceId": device.Id, "SerialNumber": device.SerialNumber})
+	// and disable port
+	// yield self.disable_ports(lock_ports=True, device_disabled=True)
+	if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "OmciAdminLock"); err != nil {
+		logger.Errorw("error-updating-reason-state", log.Fields{"deviceID": dh.deviceID, "error": err})
+	}
+
+	if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID, voltha.ConnectStatus_REACHABLE,
+		voltha.OperStatus_UNKNOWN); err != nil {
+		logger.Errorw("error-updating-device-state", log.Fields{"deviceID": dh.deviceID, "error": err})
+	}
+}
+
+func (dh *DeviceHandler) ReenableDevice(device *voltha.Device) {
+	logger.Debug("reenable-device", log.Fields{"DeviceId": device.Id, "SerialNumber": device.SerialNumber})
+	if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), dh.deviceID, voltha.ConnectStatus_REACHABLE,
+		voltha.OperStatus_ACTIVE); err != nil {
+		logger.Errorw("error-updating-device-state", log.Fields{"deviceID": dh.deviceID, "error": err})
+	}
+
+	if err := dh.coreProxy.DeviceReasonUpdate(context.TODO(), dh.deviceID, "InitialMibDownloaded"); err != nil {
+		logger.Errorw("error-updating-reason-state", log.Fields{"deviceID": dh.deviceID, "error": err})
+	}
+	// and enable port
+	// yield self.enable_ports(device)
+}
+
 func (dh *DeviceHandler) GetOfpPortInfo(device *voltha.Device,
 	portNo int64) (*ic.PortCapability, error) {
 	logger.Debugw("GetOfpPortInfo start", log.Fields{"deviceID": device.Id, "portNo": portNo})
diff --git a/internal/pkg/onuadaptercore/openonu.go b/internal/pkg/onuadaptercore/openonu.go
index 1cd7585..255af1d 100644
--- a/internal/pkg/onuadaptercore/openonu.go
+++ b/internal/pkg/onuadaptercore/openonu.go
@@ -226,12 +226,24 @@
 
 //Disable_device disables the given device
 func (oo *OpenONUAC) Disable_device(device *voltha.Device) error {
-	return errors.New("unImplemented")
+	logger.Debug("Disable_device", device.Id)
+	if handler := oo.getDeviceHandler(device.Id); handler != nil {
+		go handler.DisableDevice(device)
+		return nil
+	}
+	logger.Warn("no handler found for reenable device 'device.Id'")
+	return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
 }
 
 //Reenable_device enables the olt device after disable
 func (oo *OpenONUAC) Reenable_device(device *voltha.Device) error {
-	return errors.New("unImplemented")
+	logger.Debug("Reenable_device", device.Id)
+	if handler := oo.getDeviceHandler(device.Id); handler != nil {
+		go handler.ReenableDevice(device)
+		return nil
+	}
+	logger.Warn("no handler found for reenable device 'device.Id'")
+	return fmt.Errorf(fmt.Sprintf("handler-not-found-%s", device.Id))
 }
 
 //Reboot_device reboots the given device
