diff --git a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
index 0d564f1..1c02578 100644
--- a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
+++ b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/BgpRouter.java
@@ -381,15 +381,21 @@
                 case DEVICE_AVAILABILITY_CHANGED:
                     if (deviceService.isAvailable(event.subject().id())) {
                         log.info("Device connected {}", event.subject().id());
-                        processIntfFilters(true, configService.getInterfaces());
+                        if (event.subject().id().equals(deviceId)) {
+                            processIntfFilters(true, configService.getInterfaces());
 
-                        /* For test only - will be removed before Cardinal release */
-                        delay(1000);
-                        FibEntry fibEntry = new FibEntry(Ip4Prefix.valueOf("10.1.0.0/16"),
-                                                         Ip4Address.valueOf("192.168.10.1"),
-                                                         MacAddress.valueOf("DE:AD:BE:EF:FE:ED"));
-                        FibUpdate fibUpdate = new FibUpdate(FibUpdate.Type.UPDATE, fibEntry);
-                        updateFibEntry(Collections.singletonList(fibUpdate));
+                            /* For test only - will be removed before Cardinal release */
+                            delay(1000);
+                            FibEntry fibEntry = new FibEntry(Ip4Prefix.valueOf("10.1.0.0/16"),
+                                    Ip4Address.valueOf("192.168.10.1"),
+                                    MacAddress.valueOf("DE:AD:BE:EF:FE:ED"));
+                            FibUpdate fibUpdate = new FibUpdate(FibUpdate.Type.UPDATE, fibEntry);
+                            updateFibEntry(Collections.singletonList(fibUpdate));
+                        }
+
+                        if (event.subject().id().equals(ctrlDeviceId)) {
+                            connectivityManager.notifySwitchAvailable();
+                        }
                     }
                     break;
 
diff --git a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/TunnellingConnectivityManager.java b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/TunnellingConnectivityManager.java
index 7d8ca7c..39b248c 100644
--- a/apps/bgprouter/src/main/java/org/onosproject/bgprouter/TunnellingConnectivityManager.java
+++ b/apps/bgprouter/src/main/java/org/onosproject/bgprouter/TunnellingConnectivityManager.java
@@ -81,6 +81,23 @@
 
         this.bgpSpeaker = bgpSpeaker;
 
+    }
+
+    public void start() {
+        packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 3);
+    }
+
+    public void stop() {
+        packetService.removeProcessor(processor);
+        // Should revoke packet requests in the future
+    }
+
+    /**
+     * Pushes the flow rules for forwarding BGP TCP packets to controller.
+     * It is called when switches are connected and available.
+     */
+    public void notifySwitchAvailable() {
+        // control plane OVS is available, push default flows
         TrafficSelector selectorDst = DefaultTrafficSelector.builder()
                 .matchEthType(Ethernet.TYPE_IPV4)
                 .matchIPProtocol(IPv4.PROTOCOL_TCP)
@@ -105,7 +122,7 @@
                 .withFlag(ForwardingObjective.Flag.VERSATILE)
                 .add();
         flowObjectiveService.forward(bgpSpeaker.connectPoint().deviceId(),
-                                     puntSrc);
+                puntSrc);
 
         ForwardingObjective puntDst = DefaultForwardingObjective.builder()
                 .fromApp(appId)
@@ -115,18 +132,8 @@
                 .withFlag(ForwardingObjective.Flag.VERSATILE)
                 .add();
         flowObjectiveService.forward(bgpSpeaker.connectPoint().deviceId(),
-                                     puntDst);
+                puntDst);
         log.info("Sent punt forwarding objective to {}", bgpSpeaker.connectPoint().deviceId());
-
-    }
-
-    public void start() {
-        packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 3);
-    }
-
-    public void stop() {
-        packetService.removeProcessor(processor);
-        // Should revoke packet requests in the future
     }
 
     /**
