diff --git a/src/vnet/fib/ip6_fib.c b/src/vnet/fib/ip6_fib.c
index ddd7079..861edcc 100644
--- a/src/vnet/fib/ip6_fib.c
+++ b/src/vnet/fib/ip6_fib.c
@@ -20,6 +20,12 @@
 #include <vppinfra/bihash_24_8.h>
 #include <vppinfra/bihash_template.c>
 
+ip6_fib_table_instance_t ip6_fib_table[IP6_FIB_NUM_TABLES];
+
+/* ip6 lookup table config parameters */
+u32 ip6_fib_table_nbuckets;
+uword ip6_fib_table_size;
+
 static void
 vnet_ip6_fib_init (u32 fib_index)
 {
@@ -183,7 +189,7 @@
     int i, n_p, rv;
     u64 fib;
 
-    table = &ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING];
+    table = &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING];
     n_p = vec_len (table->prefix_lengths_in_search_order);
 
     kv.key[0] = addr->as_u64[0];
@@ -230,7 +236,7 @@
     u64 fib;
     int rv;
 
-    table = &ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING];
+    table = &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING];
     mask = &ip6_main.fib_masks[len];
     fib = ((u64)((fib_index))<<32);
 
@@ -283,7 +289,7 @@
     ip6_address_t *mask;
     u64 fib;
 
-    table = &ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING];
+    table = &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING];
     mask = &ip6_main.fib_masks[len];
     fib = ((u64)((fib_index))<<32);
 
@@ -315,7 +321,7 @@
     ip6_address_t *mask;
     u64 fib;
 
-    table = &ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING];
+    table = &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING];
     mask = &ip6_main.fib_masks[len];
     fib = ((u64)((fib_index))<<32);
 
@@ -368,7 +374,7 @@
     ip6_address_t *mask;
     u64 fib;
 
-    table = &ip6_main.ip6_table[IP6_FIB_TABLE_FWDING];
+    table = &ip6_fib_table[IP6_FIB_TABLE_FWDING];
     mask = &ip6_main.fib_masks[len];
     fib = ((u64)((fib_index))<<32);
 
@@ -399,7 +405,7 @@
     ip6_address_t *mask;
     u64 fib;
 
-    table = &ip6_main.ip6_table[IP6_FIB_TABLE_FWDING];
+    table = &ip6_fib_table[IP6_FIB_TABLE_FWDING];
     mask = &ip6_main.fib_masks[len];
     fib = ((u64)((fib_index))<<32);
 
@@ -511,7 +517,7 @@
     };
 
     clib_bihash_foreach_key_value_pair_24_8(
-        &ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
+        &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
         ip6_fib_walk_cb,
         &ctx);
 
@@ -532,7 +538,7 @@
     };
 
     clib_bihash_foreach_key_value_pair_24_8(
-        &ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
+        &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
         ip6_fib_walk_cb,
         &ctx);
 }
@@ -595,8 +601,8 @@
 {
     uword bytes_inuse;
 
-    bytes_inuse = (alloc_arena_next(&(ip6_main.ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash)) +
-                   alloc_arena_next(&(ip6_main.ip6_table[IP6_FIB_TABLE_FWDING].ip6_hash)));
+    bytes_inuse = (alloc_arena_next(&(ip6_fib_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash)) +
+                   alloc_arena_next(&(ip6_fib_table[IP6_FIB_TABLE_FWDING].ip6_hash)));
 
     s = format(s, "%=30s %=6d %=12ld\n",
                "IPv6 unicast",
@@ -681,11 +687,11 @@
     {
         vlib_cli_output (vm, "IPv6 Non-Forwarding Hash Table:\n%U\n",
                          BV (format_bihash),
-                         &im6->ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
+                         &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
                          detail);
         vlib_cli_output (vm, "IPv6 Forwarding Hash Table:\n%U\n",
                          BV (format_bihash),
-                         &im6->ip6_table[IP6_FIB_TABLE_FWDING].ip6_hash,
+                         &ip6_fib_table[IP6_FIB_TABLE_FWDING].ip6_hash,
                          detail);
         return (NULL);
     }
@@ -728,7 +734,7 @@
 	/* Show summary? */
 	if (! verbose)
 	{
-	    clib_bihash_24_8_t * h = &im6->ip6_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash;
+	    clib_bihash_24_8_t * h = &ip6_fib_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash;
 	    int len;
 
 	    vlib_cli_output (vm, "%=20s%=16s", "Prefix length", "Count");
@@ -862,3 +868,55 @@
     .function = ip6_show_fib,
 };
 /* *INDENT-ON* */
+
+static clib_error_t *
+ip6_config (vlib_main_t * vm, unformat_input_t * input)
+{
+  uword heapsize = 0;
+  u32 nbuckets = 0;
+
+  while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
+    {
+      if (unformat (input, "hash-buckets %d", &nbuckets))
+          ;
+      else if (unformat (input, "heap-size %U",
+			 unformat_memory_size, &heapsize))
+	;
+      else
+	return clib_error_return (0, "unknown input '%U'",
+				  format_unformat_error, input);
+    }
+
+  ip6_fib_table_nbuckets = nbuckets;
+  ip6_fib_table_size = heapsize;
+
+  return 0;
+}
+
+VLIB_EARLY_CONFIG_FUNCTION (ip6_config, "ip6");
+
+static clib_error_t *
+ip6_fib_init (vlib_main_t * vm)
+{
+    if (ip6_fib_table_nbuckets == 0)
+        ip6_fib_table_nbuckets = IP6_FIB_DEFAULT_HASH_NUM_BUCKETS;
+
+    ip6_fib_table_nbuckets = 1 << max_log2 (ip6_fib_table_nbuckets);
+
+    if (ip6_fib_table_size == 0)
+        ip6_fib_table_size = IP6_FIB_DEFAULT_HASH_MEMORY_SIZE;
+
+    clib_bihash_init_24_8 (&(ip6_fib_table[IP6_FIB_TABLE_FWDING].ip6_hash),
+                           "ip6 FIB fwding table",
+                           ip6_fib_table_nbuckets, ip6_fib_table_size);
+    clib_bihash_init_24_8 (&ip6_fib_table[IP6_FIB_TABLE_NON_FWDING].ip6_hash,
+                           "ip6 FIB non-fwding table",
+                           ip6_fib_table_nbuckets, ip6_fib_table_size);
+
+    return (NULL);
+}
+
+VLIB_INIT_FUNCTION (ip6_fib_init) =
+{
+  .runs_before = VLIB_INITS("ip6_lookup_init"),
+};
