diff --git a/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceAddCommand.java b/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceAddCommand.java
index 9ceeb65..f2a0bbc 100644
--- a/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceAddCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceAddCommand.java
@@ -33,14 +33,14 @@
 public class DeviceInterfaceAddCommand extends AbstractShellCommand {
 
     private static final String CONFIG_VLAN_SUCCESS =
-            "VLAN %s set on device %s interface %s.";
+            "VLAN %s added on device %s interface %s.";
     private static final String CONFIG_VLAN_FAILURE =
-            "Failed to set VLAN %s on device %s interface %s.";
+            "Failed to add VLAN %s on device %s interface %s.";
 
     private static final String CONFIG_TRUNK_SUCCESS =
-            "Trunk mode set for VLAN %s on device %s interface %s.";
+            "Trunk mode added for VLAN %s on device %s interface %s.";
     private static final String CONFIG_TRUNK_FAILURE =
-            "Failed to set trunk mode for VLAN %s on device %s interface %s.";
+            "Failed to add trunk mode for VLAN %s on device %s interface %s.";
 
     @Argument(index = 0, name = "uri", description = "Device ID",
             required = true, multiValued = false)
diff --git a/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceRemoveCommand.java b/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceRemoveCommand.java
new file mode 100644
index 0000000..1f727cb
--- /dev/null
+++ b/cli/src/main/java/org/onosproject/cli/net/DeviceInterfaceRemoveCommand.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cli.net;
+
+import org.apache.karaf.shell.commands.Argument;
+import org.apache.karaf.shell.commands.Command;
+import org.apache.karaf.shell.commands.Option;
+import org.onlab.packet.VlanId;
+import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.behaviour.InterfaceConfig;
+import org.onosproject.net.driver.DriverHandler;
+import org.onosproject.net.driver.DriverService;
+
+/**
+ * Removes configured interface from a device.
+ */
+@Command(scope = "onos", name = "device-remove-interface",
+         description = "Removes an interface configuration from a device")
+public class DeviceInterfaceRemoveCommand extends AbstractShellCommand {
+
+    private static final String REMOVE_VLAN_SUCCESS =
+            "VLAN %s removed from device %s interface %s.";
+    private static final String REMOVE_VLAN_FAILURE =
+            "Failed to remove VLAN %s from device %s interface %s.";
+
+    private static final String REMOVE_TRUNK_SUCCESS =
+            "Trunk mode removed for VLAN %s on device %s interface %s.";
+    private static final String REMOVE_TRUNK_FAILURE =
+            "Failed to remove trunk mode for VLAN %s on device %s interface %s.";
+
+    @Argument(index = 0, name = "uri", description = "Device ID",
+            required = true, multiValued = false)
+    private String uri = null;
+
+    @Argument(index = 1, name = "interface",
+              description = "Interface name",
+              required = true, multiValued = false)
+    private String portName = null;
+
+    @Argument(index = 2, name = "vlan",
+            description = "VLAN ID",
+            required = true, multiValued = false)
+    private String vlanString = null;
+
+    @Option(name = "-t", aliases = "--trunk",
+            description = "Remove trunk mode for VLAN",
+            required = false, multiValued = false)
+    private boolean trunkMode = false;
+
+    @Override
+    protected void execute() {
+        DriverService service = get(DriverService.class);
+        DeviceId deviceId = DeviceId.deviceId(uri);
+        DriverHandler h = service.createHandler(deviceId);
+        InterfaceConfig interfaceConfig = h.behaviour(InterfaceConfig.class);
+
+        VlanId vlanId = VlanId.vlanId(Short.parseShort(vlanString));
+
+        if (trunkMode) {
+            // Trunk mode for VLAN to be removed.
+            if (interfaceConfig.removeTrunkInterface(deviceId, portName, vlanId)) {
+                print(REMOVE_TRUNK_SUCCESS, vlanId, deviceId, portName);
+            } else {
+                print(REMOVE_TRUNK_FAILURE, vlanId, deviceId, portName);
+            }
+            return;
+        }
+
+        // Interface to be removed from VLAN.
+        if (interfaceConfig.removeInterfaceFromVlan(deviceId, portName, vlanId)) {
+            print(REMOVE_VLAN_SUCCESS, vlanId, deviceId, portName);
+        } else {
+            print(REMOVE_VLAN_FAILURE, vlanId, deviceId, portName);
+        }
+    }
+
+}
diff --git a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index d57dcb2..a98a38a 100644
--- a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -161,6 +161,12 @@
             </completers>
         </command>
         <command>
+            <action class="org.onosproject.cli.net.DeviceInterfaceRemoveCommand"/>
+            <completers>
+                <ref component-id="deviceIdCompleter"/>
+            </completers>
+        </command>
+        <command>
             <action class="org.onosproject.cli.net.AddMeter"/>
             <completers>
                 <ref component-id="deviceIdCompleter"/>
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/InterfaceConfig.java b/core/api/src/main/java/org/onosproject/net/behaviour/InterfaceConfig.java
index 4079350..1e1898f 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/InterfaceConfig.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/InterfaceConfig.java
@@ -34,6 +34,15 @@
     boolean addInterfaceToVlan(DeviceId deviceId, String intf, VlanId vlanId);
 
     /**
+     * Removes an interface from a VLAN.
+     * @param deviceId the device ID
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the result of operation
+     */
+    boolean removeInterfaceFromVlan(DeviceId deviceId, String intf, VlanId vlanId);
+
+    /**
      *  Configures an interface as trunk for VLAN.
      * @param deviceId the device ID
      * @param intf the name of the interface
@@ -42,8 +51,19 @@
      */
     boolean addTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId);
 
-    /* TODO Addition of more methods to make the behavior symmetrical.
-    Methods removeVlanFromInterface, getInterfacesForVlan, getVlansForInterface
-    should be added to complete the behavior.
+    /**
+     *  Removes trunk mode configuration for VLAN from an interface.
+     * @param deviceId the device ID
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the result of operation
      */
+    boolean removeTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId);
+
+    /**
+     *  TODO Addition of more methods to make the behavior symmetrical.
+     *  Methods getInterfacesForVlan, getVlansForInterface, getTrunkforInterface,
+     *  getInterfacesForTrunk should be added to complete the behavior.
+     */
+
 }
diff --git a/drivers/cisco/features.xml b/drivers/cisco/features.xml
index 6fa9fe2..6c8158f 100644
--- a/drivers/cisco/features.xml
+++ b/drivers/cisco/features.xml
@@ -18,6 +18,8 @@
     <feature name="${project.artifactId}" version="${project.version}"
              description="${project.description}">
         <feature>onos-api</feature>
+        <bundle>mvn:${project.groupId}/onos-drivers-netconf/${project.version}</bundle>
+
         <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
 
         <bundle>mvn:${project.groupId}/onos-drivers-utilities/${project.version}</bundle>
diff --git a/drivers/cisco/src/main/java/org/onosproject/drivers/cisco/InterfaceConfigCiscoIosImpl.java b/drivers/cisco/src/main/java/org/onosproject/drivers/cisco/InterfaceConfigCiscoIosImpl.java
new file mode 100644
index 0000000..4a9cced
--- /dev/null
+++ b/drivers/cisco/src/main/java/org/onosproject/drivers/cisco/InterfaceConfigCiscoIosImpl.java
@@ -0,0 +1,304 @@
+/*
+ *
+ *  * Copyright 2016 Open Networking Laboratory
+ *  *
+ *  * Licensed under the Apache License, Version 2.0 (the "License");
+ *  * you may not use this file except in compliance with the License.
+ *  * You may obtain a copy of the License at
+ *  *
+ *  *     http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing, software
+ *  * distributed under the License is distributed on an "AS IS" BASIS,
+ *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  * See the License for the specific language governing permissions and
+ *  * limitations under the License.
+ *
+ */
+
+package org.onosproject.drivers.cisco;
+
+import org.onlab.packet.VlanId;
+import org.onosproject.drivers.utilities.XmlConfigParser;
+import org.onosproject.net.DeviceId;
+import org.onosproject.net.behaviour.InterfaceConfig;
+import org.onosproject.net.driver.AbstractHandlerBehaviour;
+import org.onosproject.netconf.NetconfController;
+import org.onosproject.netconf.NetconfException;
+import org.onosproject.netconf.NetconfSession;
+import org.slf4j.Logger;
+
+import java.io.ByteArrayInputStream;
+import java.nio.charset.StandardCharsets;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Configures interfaces on Cisco IOS devices.
+ */
+public class InterfaceConfigCiscoIosImpl extends AbstractHandlerBehaviour
+        implements InterfaceConfig {
+
+    private final Logger log = getLogger(getClass());
+
+    /**
+     * Adds an interface to a VLAN.
+     * @param deviceId the device ID
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the result of operation
+     */
+    @Override
+    public boolean addInterfaceToVlan(DeviceId deviceId, String intf, VlanId vlanId) {
+        NetconfController controller = checkNotNull(handler()
+                                       .get(NetconfController.class));
+
+        NetconfSession session = controller.getDevicesMap().get(handler()
+                                 .data().deviceId()).getSession();
+        String reply;
+        try {
+            //TODO remove XML triming if preceeds in Session
+            reply = session.requestSync(addInterfaceToVlanBuilder(intf, vlanId)).trim();
+        } catch (NetconfException e) {
+            log.error("Failed to configure VLAN ID {} on device {} interface {}.",
+                      vlanId, deviceId, intf, e);
+            return false;
+        }
+
+        return XmlConfigParser.configSuccess(XmlConfigParser.loadXml(
+                new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))));
+    }
+
+    /**
+     * Builds a request to add an interface to a VLAN.
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the request string.
+     */
+    private String addInterfaceToVlanBuilder(String intf, VlanId vlanId) {
+        StringBuilder rpc =
+                new StringBuilder("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ");
+        rpc.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
+        rpc.append("<edit-config>");
+        rpc.append("<target>");
+        rpc.append("<running/>");
+        rpc.append("</target>");
+        rpc.append("<config>");
+        rpc.append("<xml-config-data>");
+        rpc.append("<Device-Configuration><interface><Param>");
+        rpc.append(intf);
+        rpc.append("</Param>");
+        rpc.append("<ConfigIf-Configuration>");
+        rpc.append("<switchport><access><vlan><VLANIDVLANPortAccessMode>");
+        rpc.append(vlanId);
+        rpc.append("</VLANIDVLANPortAccessMode></vlan></access></switchport>");
+        rpc.append("<switchport><mode><access/></mode></switchport>");
+        rpc.append("</ConfigIf-Configuration>");
+        rpc.append("</interface>");
+        rpc.append("</Device-Configuration>");
+        rpc.append("</xml-config-data>");
+        rpc.append("</config>");
+        rpc.append("</edit-config>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+    /**
+     * Removes an interface from a VLAN.
+     * @param deviceId the device ID
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the result of operation
+     */
+    @Override
+    public boolean removeInterfaceFromVlan(DeviceId deviceId, String intf,
+                                           VlanId vlanId) {
+        NetconfController controller = checkNotNull(handler()
+                                                            .get(NetconfController.class));
+
+        NetconfSession session = controller.getDevicesMap().get(handler()
+                                 .data().deviceId()).getSession();
+        String reply;
+        try {
+            //TODO remove XML triming if preceeds in Session
+            reply = session.requestSync(removeInterfaceFromVlanBuilder(intf, vlanId)).trim();
+        } catch (NetconfException e) {
+            log.error("Failed to remove VLAN ID {} from device {} interface {}.",
+                      vlanId, deviceId, intf, e);
+            return false;
+        }
+
+        return XmlConfigParser.configSuccess(XmlConfigParser.loadXml(
+                new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))));
+    }
+
+    /**
+     * Builds a request to remove an interface from a VLAN.
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the request string.
+     */
+    private String removeInterfaceFromVlanBuilder(String intf, VlanId vlanId) {
+        StringBuilder rpc =
+                new StringBuilder("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ");
+        rpc.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
+        rpc.append("<edit-config>");
+        rpc.append("<target>");
+        rpc.append("<running/>");
+        rpc.append("</target>");
+        rpc.append("<config>");
+        rpc.append("<xml-config-data>");
+        rpc.append("<Device-Configuration><interface><Param>");
+        rpc.append(intf);
+        rpc.append("</Param>");
+        rpc.append("<ConfigIf-Configuration>");
+        rpc.append("<switchport operation=\"delete\"><access><vlan><VLANIDVLANPortAccessMode>");
+        rpc.append(vlanId);
+        rpc.append("</VLANIDVLANPortAccessMode></vlan></access></switchport>");
+        rpc.append("<switchport operation=\"delete\"><mode><access/></mode></switchport>");
+        rpc.append("</ConfigIf-Configuration>");
+        rpc.append("</interface>");
+        rpc.append("</Device-Configuration>");
+        rpc.append("</xml-config-data>");
+        rpc.append("</config>");
+        rpc.append("</edit-config>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+    /**
+     * Configures an interface as trunk for VLAN.
+     * @param deviceId the device ID
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the result of operation
+     */
+    @Override
+    public boolean addTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId) {
+        NetconfController controller = checkNotNull(handler()
+                                       .get(NetconfController.class));
+
+        NetconfSession session = controller.getDevicesMap().get(handler()
+                                 .data().deviceId()).getSession();
+        String reply;
+        try {
+            //TODO remove XML triming if preceeds in Session
+            reply = session.requestSync(addTrunkInterfaceBuilder(intf, vlanId)).trim();
+        } catch (NetconfException e) {
+            log.error("Failed to configure trunk mode for VLAN ID {} on device {} interface {}.",
+                      vlanId, deviceId, intf, e);
+            return false;
+        }
+
+        return XmlConfigParser.configSuccess(XmlConfigParser.loadXml(
+                new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))));
+    }
+
+    /**
+     * Builds a request to configure an interface as trunk for VLAN.
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the request string.
+     */
+    private String addTrunkInterfaceBuilder(String intf, VlanId vlanId) {
+        StringBuilder rpc =
+                new StringBuilder("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ");
+        rpc.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
+        rpc.append("<edit-config>");
+        rpc.append("<target>");
+        rpc.append("<running/>");
+        rpc.append("</target>");
+        rpc.append("<config>");
+        rpc.append("<xml-config-data>");
+        rpc.append("<Device-Configuration><interface><Param>");
+        rpc.append(intf);
+        rpc.append("</Param>");
+        rpc.append("<ConfigIf-Configuration>");
+        rpc.append("<switchport><trunk><encapsulation><dot1q/></encapsulation>");
+        rpc.append("</trunk></switchport><switchport><trunk><allowed><vlan>");
+        rpc.append("<VLANIDsAllowedVLANsPortTrunkingMode>");
+        rpc.append(vlanId);
+        rpc.append("</VLANIDsAllowedVLANsPortTrunkingMode></vlan></allowed></trunk>");
+        rpc.append("</switchport><switchport><mode><trunk/></mode></switchport>");
+        rpc.append("</ConfigIf-Configuration>");
+        rpc.append("</interface>");
+        rpc.append("</Device-Configuration>");
+        rpc.append("</xml-config-data>");
+        rpc.append("</config>");
+        rpc.append("</edit-config>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+    /**
+     *  Removes trunk mode configuration for VLAN from an interface.
+     * @param deviceId the device ID
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the result of operation
+     */
+    @Override
+    public boolean removeTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId) {
+        NetconfController controller = checkNotNull(handler()
+                                       .get(NetconfController.class));
+
+    NetconfSession session = controller.getDevicesMap().get(handler()
+                             .data().deviceId()).getSession();
+    String reply;
+    try {
+        //TODO remove XML triming if preceeds in Session
+        reply = session.requestSync(removeTrunkInterfaceBuilder(intf, vlanId)).trim();
+    } catch (NetconfException e) {
+        log.error("Failed to remove trunk mode for VLAN ID {} on device {} interface {}.",
+                  vlanId, deviceId, intf, e);
+        return false;
+    }
+
+    return XmlConfigParser.configSuccess(XmlConfigParser.loadXml(
+            new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))));
+}
+
+    /**
+     * Builds a request to remove trunk mode configuration for VLAN from an interface.
+     * @param intf the name of the interface
+     * @param vlanId the VLAN ID
+     * @return the request string.
+     */
+    private String removeTrunkInterfaceBuilder(String intf, VlanId vlanId) {
+        StringBuilder rpc =
+                new StringBuilder("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ");
+        rpc.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
+        rpc.append("<edit-config>");
+        rpc.append("<target>");
+        rpc.append("<running/>");
+        rpc.append("</target>");
+        rpc.append("<config>");
+        rpc.append("<xml-config-data>");
+        rpc.append("<Device-Configuration><interface><Param>");
+        rpc.append(intf);
+        rpc.append("</Param>");
+        rpc.append("<ConfigIf-Configuration>");
+        rpc.append("<switchport><mode operation=\"delete\"><trunk/></mode></switchport>");
+        rpc.append("<switchport><trunk operation=\"delete\"><encapsulation>");
+        rpc.append("<dot1q/></encapsulation></trunk></switchport>");
+        rpc.append("<switchport><trunk operation=\"delete\"><allowed><vlan>");
+        rpc.append("<VLANIDsAllowedVLANsPortTrunkingMode>");
+        rpc.append(vlanId);
+        rpc.append("</VLANIDsAllowedVLANsPortTrunkingMode></vlan></allowed>");
+        rpc.append("</trunk></switchport></ConfigIf-Configuration>");
+        rpc.append("</interface>");
+        rpc.append("</Device-Configuration>");
+        rpc.append("</xml-config-data>");
+        rpc.append("</config>");
+        rpc.append("</edit-config>");
+        rpc.append("</rpc>");
+
+        return rpc.toString();
+    }
+
+}
+
diff --git a/drivers/cisco/src/main/java/org/onosproject/drivers/cisco/InterfaceConfigCiscoSmXImpl.java b/drivers/cisco/src/main/java/org/onosproject/drivers/cisco/InterfaceConfigCiscoSmXImpl.java
deleted file mode 100644
index 6df1076..0000000
--- a/drivers/cisco/src/main/java/org/onosproject/drivers/cisco/InterfaceConfigCiscoSmXImpl.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- *
- *  * Copyright 2016 Open Networking Laboratory
- *  *
- *  * Licensed under the Apache License, Version 2.0 (the "License");
- *  * you may not use this file except in compliance with the License.
- *  * You may obtain a copy of the License at
- *  *
- *  *     http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing, software
- *  * distributed under the License is distributed on an "AS IS" BASIS,
- *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  * See the License for the specific language governing permissions and
- *  * limitations under the License.
- *
- */
-
-package org.onosproject.drivers.cisco;
-
-import org.onlab.packet.VlanId;
-import org.onosproject.drivers.utilities.XmlConfigParser;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.behaviour.InterfaceConfig;
-import org.onosproject.net.driver.AbstractHandlerBehaviour;
-import org.onosproject.netconf.NetconfController;
-import org.onosproject.netconf.NetconfException;
-import org.onosproject.netconf.NetconfSession;
-import org.slf4j.Logger;
-
-import java.io.ByteArrayInputStream;
-import java.nio.charset.StandardCharsets;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.slf4j.LoggerFactory.getLogger;
-
-/**
- * Configures interfaces on Cisco SM-X devices.
- */
-public class InterfaceConfigCiscoSmXImpl extends AbstractHandlerBehaviour
-        implements InterfaceConfig {
-
-    private final Logger log = getLogger(getClass());
-
-    /**
-     * Adds an interface to a VLAN.
-     * @param deviceId the device ID
-     * @param intf the name of the interface
-     * @param vlanId the VLAN ID
-     * @return the result of operation
-     */
-    @Override
-    public boolean addInterfaceToVlan(DeviceId deviceId, String intf, VlanId vlanId) {
-        NetconfController controller = checkNotNull(handler()
-                                       .get(NetconfController.class));
-
-        NetconfSession session = controller.getDevicesMap().get(handler()
-                                 .data().deviceId()).getSession();
-        String reply;
-        try {
-            reply = session.requestSync(addInterfaceToVlanBuilder(intf, vlanId)).trim();
-        } catch (NetconfException e) {
-            log.error("Failed to configure VLAN ID {} on device {} port {}.",
-                      vlanId, deviceId, intf, e);
-            return false;
-        }
-
-        return XmlConfigParser.configSuccess(XmlConfigParser.loadXml(
-                new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))));
-    }
-
-    /**
-     * Builds a request crafted to add an interface to a VLAN.
-     * @param intf the name of the interface
-     * @param vlanId the VLAN ID
-     * @return the request string.
-     */
-    private String addInterfaceToVlanBuilder(String intf, VlanId vlanId) {
-        StringBuilder rpc = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-        rpc.append("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ");
-        rpc.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
-        rpc.append("<edit-config>");
-        rpc.append("<target>");
-        rpc.append("<running/>");
-        rpc.append("</target>");
-        rpc.append("<config>");
-        rpc.append("<xml-config-data>");
-        rpc.append("<Device-Configuration><interface><Param>");
-        rpc.append(intf);
-        rpc.append("</Param>");
-        rpc.append("<ConfigIf-Configuration>");
-        rpc.append("<switchport><access><vlan><VLANIDVLANPortAccessMode>");
-        rpc.append(vlanId);
-        rpc.append("</VLANIDVLANPortAccessMode></vlan></access></switchport>");
-        rpc.append("<switchport><mode><access/></mode></switchport>");
-        rpc.append("</ConfigIf-Configuration>");
-        rpc.append("</interface>");
-        rpc.append("</Device-Configuration>");
-        rpc.append("</xml-config-data>");
-        rpc.append("</config>");
-        rpc.append("</edit-config>");
-        rpc.append("</rpc>");
-
-        return rpc.toString();
-    }
-
-    /**
-     * Configures an interface as trunk for VLAN.
-     * @param deviceId the device ID
-     * @param intf the name of the interface
-     * @param vlanId the VLAN ID
-     * @return the result of operation
-     */
-    @Override
-    public boolean addTrunkInterface(DeviceId deviceId, String intf, VlanId vlanId) {
-        NetconfController controller = checkNotNull(handler()
-                                       .get(NetconfController.class));
-
-        NetconfSession session = controller.getDevicesMap().get(handler()
-                                 .data().deviceId()).getSession();
-        String reply;
-        try {
-            reply = session.requestSync(addTrunkInterface(intf, vlanId)).trim();
-        } catch (NetconfException e) {
-            log.error("Failed to configure VLAN ID {} on device {} port {}.",
-                      vlanId, deviceId, intf, e);
-            return false;
-        }
-
-        return XmlConfigParser.configSuccess(XmlConfigParser.loadXml(
-                new ByteArrayInputStream(reply.getBytes(StandardCharsets.UTF_8))));
-    }
-
-    /**
-     * Builds a request crafted to configure an interface as trunk for VLAN.
-     * @param intf the name of the interface
-     * @param vlanId the VLAN ID
-     * @return the request string.
-     */
-    private String addTrunkInterface(String intf, VlanId vlanId) {
-        StringBuilder rpc = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-        rpc.append("<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" ");
-        rpc.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
-        rpc.append("<edit-config>");
-        rpc.append("<target>");
-        rpc.append("<running/>");
-        rpc.append("</target>");
-        rpc.append("<config>");
-        rpc.append("<xml-config-data>");
-        rpc.append("<Device-Configuration><interface><Param>");
-        rpc.append(intf);
-        rpc.append("</Param>");
-        rpc.append("<ConfigIf-Configuration>");
-        rpc.append("<switchport><trunk><encapsulation><dot1q/></encapsulation></trunk></switchport>");
-        rpc.append("<switchport><trunk><allowed><vlan><VLANIDsAllowedVLANsPortTrunkingMode>");
-        rpc.append(vlanId);
-        rpc.append("</VLANIDsAllowedVLANsPortTrunkingMode></vlan></allowed></trunk></switchport>");
-        rpc.append("<switchport><mode><trunk/></mode></switchport>");
-        rpc.append("</ConfigIf-Configuration>");
-        rpc.append("</interface>");
-        rpc.append("</Device-Configuration>");
-        rpc.append("</xml-config-data>");
-        rpc.append("</config>");
-        rpc.append("</edit-config>");
-        rpc.append("</rpc>");
-
-        return rpc.toString();
-    }
-
-}
-
diff --git a/drivers/cisco/src/main/resources/cisco-drivers.xml b/drivers/cisco/src/main/resources/cisco-drivers.xml
index 2c07021..e779f2c 100644
--- a/drivers/cisco/src/main/resources/cisco-drivers.xml
+++ b/drivers/cisco/src/main/resources/cisco-drivers.xml
@@ -16,8 +16,8 @@
   -->
 <drivers>
     <driver name="cisco-netconf" extends="netconf" manufacturer="Cisco"
-            hwVersion="SM-X" swVersion="IOS 15">
+            hwVersion="" swVersion="IOS">
         <behaviour api="org.onosproject.net.behaviour.InterfaceConfig"
-                   impl="org.onosproject.drivers.cisco.InterfaceConfigCiscoSmXImpl"/>
+                   impl="org.onosproject.drivers.cisco.InterfaceConfigCiscoIosImpl"/>
     </driver>
 </drivers>
