diff --git a/src/vnet/buffer.h b/src/vnet/buffer.h
index 5d1b1c4..ec5e2f7 100644
--- a/src/vnet/buffer.h
+++ b/src/vnet/buffer.h
@@ -176,8 +176,7 @@
       u16 bd_index;		/* bridge-domain index */
       u8 l2_len;		/* ethernet header length */
       u8 shg;			/* split-horizon group */
-      u8 bd_sn;			/* bridge domain seq# */
-      u8 int_sn;		/* interface seq# */
+      u16 l2fib_sn;		/* l2fib bd/int seq_num */
     } l2;
 
     /* l2tpv3 softwire encap, only valid there */
diff --git a/src/vnet/l2/l2.api b/src/vnet/l2/l2.api
index db42d63..e9a1f36 100644
--- a/src/vnet/l2/l2.api
+++ b/src/vnet/l2/l2.api
@@ -76,6 +76,16 @@
   u32 context;
 };
 
+/** \brief L2 FIB flush all  entries
+    @param client_index - opaque cookie to identify the sender
+    @param context - sender context, to match reply w/ request
+*/
+autoreply define l2fib_flush_all
+{
+  u32 client_index;
+  u32 context;
+};
+
 /** \brief L2 FIB flush bridge domain entries
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
diff --git a/src/vnet/l2/l2_api.c b/src/vnet/l2/l2_api.c
index 8cc7c79..5f371cc 100644
--- a/src/vnet/l2/l2_api.c
+++ b/src/vnet/l2/l2_api.c
@@ -48,6 +48,7 @@
 _(L2_XCONNECT_DUMP, l2_xconnect_dump)                       \
 _(L2_FIB_CLEAR_TABLE, l2_fib_clear_table)                   \
 _(L2_FIB_TABLE_DUMP, l2_fib_table_dump)                     \
+_(L2FIB_FLUSH_ALL, l2fib_flush_all)                         \
 _(L2FIB_FLUSH_INT, l2fib_flush_int)                         \
 _(L2FIB_FLUSH_BD, l2fib_flush_bd)                           \
 _(L2FIB_ADD_DEL, l2fib_add_del)                             \
@@ -106,11 +107,8 @@
   int rv = 0;
   vl_api_l2_fib_clear_table_reply_t *rmp;
 
-  /* DAW-FIXME: This API should only clear non-static l2fib entries, but
-   *            that is not currently implemented.  When that TODO is fixed
-   *            this call should be changed to pass 1 instead of 0.
-   */
-  l2fib_clear_table (0);
+  /* Clear all MACs including static MACs  */
+  l2fib_clear_table ();
 
   REPLY_MACRO (VL_API_L2_FIB_CLEAR_TABLE_REPLY);
 }
@@ -259,6 +257,16 @@
 }
 
 static void
+vl_api_l2fib_flush_all_t_handler (vl_api_l2fib_flush_all_t * mp)
+{
+  int rv = 0;
+  vl_api_l2fib_flush_all_reply_t *rmp;
+
+  l2fib_flush_all_mac (vlib_get_main ());
+  REPLY_MACRO (VL_API_L2FIB_FLUSH_ALL_REPLY);
+}
+
+static void
 vl_api_l2fib_flush_bd_t_handler (vl_api_l2fib_flush_bd_t * mp)
 {
   int rv = 0;
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c
index 028a732..d4207e3 100644
--- a/src/vnet/l2/l2_fib.c
+++ b/src/vnet/l2/l2_fib.c
@@ -54,7 +54,6 @@
 
 l2fib_main_t l2fib_main;
 
-
 /** Format sw_if_index. If the value is ~0, use the text "N/A" */
 u8 *
 format_vnet_sw_if_index_name_with_NA (u8 * s, va_list * args)
@@ -198,7 +197,7 @@
 				   key.fields.bd_index,
 				   result.fields.sw_if_index == ~0
 				   ? -1 : result.fields.sw_if_index,
-				   result.fields.bd_sn, result.fields.int_sn,
+				   result.fields.sn.bd, result.fields.sn.swif,
 				   s, result.fields.static_mac ? "*" : "-",
 				   result.fields.filter ? "*" : "-",
 				   result.fields.bvi ? "*" : "-",
@@ -259,22 +258,14 @@
 
 /* Remove all entries from the l2fib */
 void
-l2fib_clear_table (uint keep_static)
+l2fib_clear_table (void)
 {
   l2fib_main_t *mp = &l2fib_main;
 
-  if (keep_static)
-    {
-      /* TODO: remove only non-static entries */
-    }
-  else
-    {
-      /* Remove all entries */
-      BV (clib_bihash_free) (&mp->mac_table);
-      BV (clib_bihash_init) (&mp->mac_table, "l2fib mac table",
-			     L2FIB_NUM_BUCKETS, L2FIB_MEMORY_SIZE);
-    }
-
+  /* Remove all entries */
+  BV (clib_bihash_free) (&mp->mac_table);
+  BV (clib_bihash_init) (&mp->mac_table, "l2fib mac table",
+			 L2FIB_NUM_BUCKETS, L2FIB_MEMORY_SIZE);
   l2learn_main.global_learn_count = 0;
 }
 
@@ -285,7 +276,7 @@
 clear_l2fib (vlib_main_t * vm,
 	     unformat_input_t * input, vlib_cli_command_t * cmd)
 {
-  l2fib_clear_table (0);
+  l2fib_clear_table ();
   return 0;
 }
 
@@ -308,14 +299,25 @@
 };
 /* *INDENT-ON* */
 
+static inline l2fib_seq_num_t
+l2fib_cur_seq_num (u32 bd_index, u32 sw_if_index)
+{
+  l2_input_config_t *int_config = l2input_intf_config (sw_if_index);
+  l2_bridge_domain_t *bd_config = l2input_bd_config (bd_index);
+  /* *INDENT-OFF* */
+  return (l2fib_seq_num_t) {
+    .swif = int_config->seq_num,
+    .bd = bd_config->seq_num,
+  };
+  /* *INDENT-ON* */
+}
 
 /**
  * Add an entry to the l2fib.
  * If the entry already exists then overwrite it
  */
 void
-l2fib_add_entry (u64 mac,
-		 u32 bd_index,
+l2fib_add_entry (u64 mac, u32 bd_index,
 		 u32 sw_if_index, u32 static_mac, u32 filter_mac, u32 bvi_mac)
 {
   l2fib_entry_key_t key;
@@ -334,14 +336,7 @@
   result.fields.filter = filter_mac;
   result.fields.bvi = bvi_mac;
   if (!static_mac)
-    {
-      l2_input_config_t *int_config = l2input_intf_config (sw_if_index);
-      l2_bridge_domain_t *bd_config =
-	vec_elt_at_index (l2input_main.bd_configs,
-			  bd_index);
-      result.fields.int_sn = int_config->seq_num;
-      result.fields.bd_sn = bd_config->seq_num;
-    }
+    result.fields.sn = l2fib_cur_seq_num (bd_index, sw_if_index);
 
   kv.key = key.raw;
   kv.value = result.raw;
@@ -620,8 +615,8 @@
  * Delete an entry from the l2fib.
  * Return 0 if the entry was deleted, or 1 if it was not found
  */
-u32
-l2fib_del_entry (u64 mac, u32 bd_index)
+static u32
+l2fib_del_entry_by_key (u64 raw_key)
 {
 
   l2fib_entry_result_t result;
@@ -629,7 +624,7 @@
   BVT (clib_bihash_kv) kv;
 
   /* set up key */
-  kv.key = l2fib_make_key ((u8 *) & mac, bd_index);
+  kv.key = raw_key;
 
   if (BV (clib_bihash_search) (&mp->mac_table, &kv, &kv))
     return 1;
@@ -651,6 +646,16 @@
 }
 
 /**
+ * Delete an entry from the l2fib.
+ * Return 0 if the entry was deleted, or 1 if it was not found
+ */
+u32
+l2fib_del_entry (u64 mac, u32 bd_index)
+{
+  return l2fib_del_entry_by_key (l2fib_make_key ((u8 *) & mac, bd_index));
+}
+
+/**
  * Delete an entry from the L2FIB.
  * The CLI format is:
  *    l2fib del <mac> <bd-id>
@@ -735,30 +740,43 @@
 }
 
 /**
-    Flush all learned MACs from an interface
+    Flush all non static MACs from an interface
 */
 void
 l2fib_flush_int_mac (vlib_main_t * vm, u32 sw_if_index)
 {
-  l2_input_config_t *int_config;
-  int_config = l2input_intf_config (sw_if_index);
+  l2_input_config_t *int_config = l2input_intf_config (sw_if_index);
   int_config->seq_num += 1;
   l2fib_start_ager_scan (vm);
 }
 
 /**
-    Flush all learned MACs in a bridge domain
+    Flush all non static MACs in a bridge domain
 */
 void
 l2fib_flush_bd_mac (vlib_main_t * vm, u32 bd_index)
 {
-  l2_bridge_domain_t *bd_config;
-  bd_config = l2input_bd_config (bd_index);
+  l2_bridge_domain_t *bd_config = l2input_bd_config (bd_index);
   bd_config->seq_num += 1;
   l2fib_start_ager_scan (vm);
 }
 
 /**
+    Flush all non static MACs - flushes all valid BDs
+*/
+void
+l2fib_flush_all_mac (vlib_main_t * vm)
+{
+  l2_bridge_domain_t *bd_config;
+  vec_foreach (bd_config, l2input_main.bd_configs)
+    if (bd_is_valid (bd_config))
+    bd_config->seq_num += 1;
+
+  l2fib_start_ager_scan (vm);
+}
+
+
+/**
     Flush MACs, except static ones, associated with an interface
     The CLI format is:
     l2fib flush-mac interface <if-name>
@@ -784,6 +802,35 @@
   return error;
 }
 
+/**
+    Flush all MACs, except static ones
+    The CLI format is:
+    l2fib flush-mac all
+*/
+static clib_error_t *
+l2fib_flush_mac_all (vlib_main_t * vm,
+		     unformat_input_t * input, vlib_cli_command_t * cmd)
+{
+  l2fib_flush_all_mac (vm);
+  return 0;
+}
+
+/*?
+ * This command kick off ager to delete all existing MAC Address entries,
+ * except static ones, associated with an interface from the L2 FIB table.
+ *
+ * @cliexpar
+ * Example of how to flush MAC Address entries learned on an interface from the L2 FIB table:
+ * @cliexcmd{l2fib flush-mac interface GigabitEthernet2/1/0}
+?*/
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (l2fib_flush_mac_all_cli, static) = {
+  .path = "l2fib flush-mac all",
+  .short_help = "l2fib flush-mac all",
+  .function = l2fib_flush_mac_all,
+};
+/* *INDENT-ON* */
+
 /*?
  * This command kick off ager to delete all existing MAC Address entries,
  * except static ones, associated with an interface from the L2 FIB table.
@@ -872,17 +919,8 @@
 {
   uword event_type, *event_data = 0;
   l2fib_main_t *msm = &l2fib_main;
-  l2_input_config_t *int_config;
-  l2_bridge_domain_t *bd_config;
-  BVT (clib_bihash) * h = &msm->mac_table;
-  clib_bihash_bucket_t *b;
-  BVT (clib_bihash_value) * v;
-  l2fib_entry_key_t key;
-  l2fib_entry_result_t result;
-  int i, j, k;
   bool enabled = 0;
   f64 start_time, last_run_duration = 0, t;
-  i16 delta;
 
   while (1)
     {
@@ -911,6 +949,9 @@
 	  ASSERT (0);
 	}
       last_run_duration = start_time = vlib_time_now (vm);
+
+      BVT (clib_bihash) * h = &msm->mac_table;
+      int i, j, k;
       for (i = 0; i < h->nbuckets; i++)
 	{
 	  /* Allow no more than 10us without a pause */
@@ -923,20 +964,22 @@
 
 	  if (i < (h->nbuckets - 3))
 	    {
-	      b = &h->buckets[i + 3];
+	      clib_bihash_bucket_t *b = &h->buckets[i + 3];
 	      CLIB_PREFETCH (b, CLIB_CACHE_LINE_BYTES, LOAD);
 	      b = &h->buckets[i + 1];
 	      if (b->offset)
 		{
-		  v = BV (clib_bihash_get_value) (h, b->offset);
+		  BVT (clib_bihash_value) * v =
+		    BV (clib_bihash_get_value) (h, b->offset);
 		  CLIB_PREFETCH (v, CLIB_CACHE_LINE_BYTES, LOAD);
 		}
 	    }
 
-	  b = &h->buckets[i];
+	  clib_bihash_bucket_t *b = &h->buckets[i];
 	  if (b->offset == 0)
 	    continue;
-	  v = BV (clib_bihash_get_value) (h, b->offset);
+	  BVT (clib_bihash_value) * v =
+	    BV (clib_bihash_get_value) (h, b->offset);
 	  for (j = 0; j < (1 << b->log2_pages); j++)
 	    {
 	      for (k = 0; k < BIHASH_KVP_PER_PAGE; k++)
@@ -944,37 +987,32 @@
 		  if (v->kvp[k].key == ~0ULL && v->kvp[k].value == ~0ULL)
 		    continue;
 
-		  key.raw = v->kvp[k].key;
-		  result.raw = v->kvp[k].value;
+		  l2fib_entry_key_t key = {.raw = v->kvp[k].key };
+		  l2fib_entry_result_t result = {.raw = v->kvp[k].value };
 
 		  if (result.fields.static_mac)
 		    continue;
 
-		  int_config =
-		    l2input_intf_config (result.fields.sw_if_index);
-		  bd_config =
-		    vec_elt_at_index (l2input_main.bd_configs,
-				      key.fields.bd_index);
-
-		  if ((result.fields.int_sn != int_config->seq_num) ||
-		      (result.fields.bd_sn != bd_config->seq_num))
+		  u32 bd_index = key.fields.bd_index;
+		  u32 sw_if_index = result.fields.sw_if_index;
+		  u16 sn = l2fib_cur_seq_num (bd_index, sw_if_index).as_u16;
+		  if (result.fields.sn.as_u16 != sn)
 		    {
-		      void *p = &key.fields.mac;
-		      l2fib_del_entry (*(u64 *) p, key.fields.bd_index);
+		      l2fib_del_entry_by_key (key.raw);
 		      continue;
 		    }
+		  l2_bridge_domain_t *bd_config =
+		    vec_elt_at_index (l2input_main.bd_configs, bd_index);
 
 		  if (bd_config->mac_age == 0)
 		    continue;
 
-		  delta = (u8) (start_time / 60) - result.fields.timestamp;
+		  i16 delta =
+		    (u8) (start_time / 60) - result.fields.timestamp;
 		  delta += delta < 0 ? 256 : 0;
 
 		  if (delta > bd_config->mac_age)
-		    {
-		      void *p = &key.fields.mac;
-		      l2fib_del_entry (*(u64 *) p, key.fields.bd_index);
-		    }
+		    l2fib_del_entry_by_key (key.raw);
 		}
 	      v++;
 	    }
diff --git a/src/vnet/l2/l2_fib.h b/src/vnet/l2/l2_fib.h
index 7e49d74..e571a21 100644
--- a/src/vnet/l2/l2_fib.h
+++ b/src/vnet/l2/l2_fib.h
@@ -50,6 +50,20 @@
 
 STATIC_ASSERT_SIZEOF (l2fib_entry_key_t, 8);
 
+
+typedef struct
+{
+  union
+  {
+    struct
+    {
+      u8 swif;
+      u8 bd;
+    };
+    u16 as_u16;
+  };
+} l2fib_seq_num_t;
+
 /*
  * The l2fib entry results
  */
@@ -66,8 +80,7 @@
       u8 filter:1;		/* drop packets to/from this mac */
       u8 unused1:5;
       u8 timestamp;		/* timestamp for aging */
-      u8 int_sn;		/* interface seq num */
-      u8 bd_sn;			/* bridge domain seq num */
+      l2fib_seq_num_t sn;	/* bd/int seq num */
     } fields;
     u64 raw;
   };
@@ -314,7 +327,7 @@
     }
 }
 
-void l2fib_clear_table (uint keep_static);
+void l2fib_clear_table (void);
 
 void
 l2fib_add_entry (u64 mac,
@@ -329,6 +342,8 @@
 
 void l2fib_flush_bd_mac (vlib_main_t * vm, u32 bd_index);
 
+void l2fib_flush_all_mac (vlib_main_t * vm);
+
 void
 l2fib_table_dump (u32 bd_index, l2fib_entry_key_t ** l2fe_key,
 		  l2fib_entry_result_t ** l2fe_res);
diff --git a/src/vnet/l2/l2_input.c b/src/vnet/l2/l2_input.c
index fe65e69..41a93f5 100644
--- a/src/vnet/l2/l2_input.c
+++ b/src/vnet/l2/l2_input.c
@@ -202,8 +202,14 @@
       /* Get config for the bridge domain interface */
       bd_config = vec_elt_at_index (msm->bd_configs, bd_index0);
 
-      /* Save bridge domain seq_num */
-      vnet_buffer (b0)->l2.bd_sn = bd_config->seq_num;
+      /* Save bridge domain and interface seq_num */
+      /* *INDENT-OFF* */
+      l2fib_seq_num_t sn = {
+        .swif = config->seq_num,
+	.bd = bd_config->seq_num,
+      };
+      /* *INDENT-ON* */
+      vnet_buffer (b0)->l2.l2fib_sn = sn.as_u16;;
 
       /*
        * Process bridge domain feature enables.
@@ -218,9 +224,6 @@
   /* mask out features from bitmap using packet type and bd config */
   feature_bitmap = config->feature_bitmap & feat_mask;
 
-  /* Save interface seq_num */
-  vnet_buffer (b0)->l2.int_sn = config->seq_num;
-
   /* save for next feature graph nodes */
   vnet_buffer (b0)->l2.feature_bitmap = feature_bitmap;
 
diff --git a/src/vnet/l2/l2_learn.c b/src/vnet/l2/l2_learn.c
index faed0d6..adc5e70 100644
--- a/src/vnet/l2/l2_learn.c
+++ b/src/vnet/l2/l2_learn.c
@@ -141,10 +141,8 @@
       if (PREDICT_FALSE (result0->fields.timestamp != timestamp))
 	result0->fields.timestamp = timestamp;
       if (PREDICT_FALSE
-	  (result0->fields.int_sn != vnet_buffer (b0)->l2.int_sn))
-	result0->fields.int_sn = vnet_buffer (b0)->l2.int_sn;
-      if (PREDICT_FALSE (result0->fields.bd_sn != vnet_buffer (b0)->l2.bd_sn))
-	result0->fields.bd_sn = vnet_buffer (b0)->l2.bd_sn;
+	  (result0->fields.sn.as_u16 != vnet_buffer (b0)->l2.l2fib_sn))
+	result0->fields.sn.as_u16 = vnet_buffer (b0)->l2.l2fib_sn;
     }
   else if (result0->raw == ~0)
     {
@@ -171,8 +169,7 @@
 	  result0->raw = 0;	/* clear all fields */
 	  result0->fields.sw_if_index = sw_if_index0;
 	  result0->fields.timestamp = timestamp;
-	  result0->fields.bd_sn = vnet_buffer (b0)->l2.bd_sn;
-	  result0->fields.int_sn = vnet_buffer (b0)->l2.int_sn;
+	  result0->fields.sn.as_u16 = vnet_buffer (b0)->l2.l2fib_sn;
 	  kv.key = key0->raw;
 	  kv.value = result0->raw;
 
@@ -210,8 +207,7 @@
 	  result0->raw = 0;	/* clear all fields */
 	  result0->fields.sw_if_index = sw_if_index0;
 	  result0->fields.timestamp = timestamp;
-	  result0->fields.bd_sn = vnet_buffer (b0)->l2.bd_sn;
-	  result0->fields.int_sn = vnet_buffer (b0)->l2.int_sn;
+	  result0->fields.sn.as_u16 = vnet_buffer (b0)->l2.l2fib_sn;
 
 	  kv.key = key0->raw;
 	  kv.value = result0->raw;
