diff --git a/src/vnet/gre/gre.h b/src/vnet/gre/gre.h
index 416ab30..a1a03df 100644
--- a/src/vnet/gre/gre.h
+++ b/src/vnet/gre/gre.h
@@ -181,11 +181,6 @@
   CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
 
   /**
-   * Linkage into the FIB object graph
-   */
-  fib_node_t node;
-
-  /**
    * The hash table's key stored in separate memory since the tunnel_t
    * memory can realloc.
    */
@@ -208,19 +203,6 @@
   gre_tunnel_type_t type;
 
   /**
-   * The FIB entry sourced by the tunnel for its destination prefix
-   */
-  fib_node_index_t fib_entry_index;
-
-  /**
-   * The tunnel is a child of the FIB entry for its desintion. This is
-   * so it receives updates when the forwarding information for that entry
-   * changes.
-   * The tunnels sibling index on the FIB entry's dependency list.
-   */
-  u32 sibling_index;
-
-  /**
    * an L2 tunnel always rquires an L2 midchain. cache here for DP.
    */
   adj_index_t l2_adj_index;
diff --git a/src/vnet/gre/interface.c b/src/vnet/gre/interface.c
index b9bfb79..4f5f528 100644
--- a/src/vnet/gre/interface.c
+++ b/src/vnet/gre/interface.c
@@ -112,14 +112,6 @@
   t->key = NULL;
 }
 
-static gre_tunnel_t *
-gre_tunnel_from_fib_node (fib_node_t * node)
-{
-  ASSERT (FIB_NODE_TYPE_GRE_TUNNEL == node->fn_type);
-  return ((gre_tunnel_t *) (((char *) node) -
-			    STRUCT_OFFSET_OF (gre_tunnel_t, node)));
-}
-
 /**
  * gre_tunnel_stack
  *
@@ -146,14 +138,11 @@
   if ((vnet_hw_interface_get_flags (vnet_get_main (), gt->hw_if_index) &
        VNET_HW_INTERFACE_FLAG_LINK_UP) == 0)
     {
-      adj_nbr_midchain_unstack (ai);
+      adj_midchain_delegate_unstack (ai);
     }
   else
     {
-      adj_nbr_midchain_stack_on_fib_entry (ai,
-					   gt->fib_entry_index,
-					   fib_forw_chain_type_from_fib_proto
-					   (gt->tunnel_dst.fp_proto));
+      adj_midchain_delegate_stack (ai, gt->outer_fib_index, &gt->tunnel_dst);
     }
 }
 
@@ -182,55 +171,6 @@
   }
 }
 
-/**
- * Function definition to backwalk a FIB node
- */
-static fib_node_back_walk_rc_t
-gre_tunnel_back_walk (fib_node_t * node, fib_node_back_walk_ctx_t * ctx)
-{
-  gre_tunnel_restack (gre_tunnel_from_fib_node (node));
-
-  return (FIB_NODE_BACK_WALK_CONTINUE);
-}
-
-/**
- * Function definition to get a FIB node from its index
- */
-static fib_node_t *
-gre_tunnel_fib_node_get (fib_node_index_t index)
-{
-  gre_tunnel_t *gt;
-  gre_main_t *gm;
-
-  gm = &gre_main;
-  gt = pool_elt_at_index (gm->tunnels, index);
-
-  return (&gt->node);
-}
-
-/**
- * Function definition to inform the FIB node that its last lock has gone.
- */
-static void
-gre_tunnel_last_lock_gone (fib_node_t * node)
-{
-  /*
-   * The MPLS GRE tunnel is a root of the graph. As such
-   * it never has children and thus is never locked.
-   */
-  ASSERT (0);
-}
-
-/*
- * Virtual function table registered by MPLS GRE tunnels
- * for participation in the FIB object graph.
- */
-const static fib_node_vft_t gre_vft = {
-  .fnv_get = gre_tunnel_fib_node_get,
-  .fnv_last_lock = gre_tunnel_last_lock_gone,
-  .fnv_back_walk = gre_tunnel_back_walk,
-};
-
 static int
 vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t * a,
 		     u32 outer_fib_index, u32 * sw_if_indexp)
@@ -267,7 +207,6 @@
 
   t->dev_instance = t_idx;	/* actual */
   t->user_instance = u_idx;	/* name */
-  fib_node_init (&t->node, FIB_NODE_TYPE_GRE_TUNNEL);
 
   t->type = a->tunnel_type;
   if (t->type == GRE_TUNNEL_TYPE_ERSPAN)
@@ -357,11 +296,6 @@
 	}
     }
 
-  t->fib_entry_index = fib_table_entry_special_add
-    (outer_fib_index, &t->tunnel_dst, FIB_SOURCE_RR, FIB_ENTRY_FLAG_NONE);
-  t->sibling_index = fib_entry_child_add
-    (t->fib_entry_index, FIB_NODE_TYPE_GRE_TUNNEL, t_idx);
-
   if (t->type != GRE_TUNNEL_TYPE_L3)
     {
       t->l2_adj_index = adj_nbr_add_or_lock
@@ -403,10 +337,10 @@
     ethernet_delete_interface (vnm, t->hw_if_index);
 
   if (t->l2_adj_index != ADJ_INDEX_INVALID)
-    adj_unlock (t->l2_adj_index);
-
-  fib_entry_child_remove (t->fib_entry_index, t->sibling_index);
-  fib_table_entry_delete_index (t->fib_entry_index, FIB_SOURCE_RR);
+    {
+      adj_midchain_delegate_unstack (t->l2_adj_index);
+      adj_unlock (t->l2_adj_index);
+    }
 
   ASSERT ((t->type != GRE_TUNNEL_TYPE_ERSPAN) || (t->gre_sn != NULL));
   if ((t->type == GRE_TUNNEL_TYPE_ERSPAN) && (t->gre_sn->ref_count-- == 1))
@@ -419,7 +353,6 @@
 
   hash_unset (gm->instance_used, t->user_instance);
   gre_tunnel_db_remove (t);
-  fib_node_deinit (&t->node);
   pool_put (gm->tunnels, t);
 
   if (sw_if_indexp)
@@ -690,9 +623,7 @@
 clib_error_t *
 gre_interface_init (vlib_main_t * vm)
 {
-  fib_node_register_type (FIB_NODE_TYPE_GRE_TUNNEL, &gre_vft);
-
-  return 0;
+  return (NULL);
 }
 
 VLIB_INIT_FUNCTION (gre_interface_init);
