diff --git a/mininet/cli.py b/mininet/cli.py
index 42a4d3d7f1d6724d916475d3f17d6766098802a7..c684580475715333630850e1d9e265809efd5684 100644
--- a/mininet/cli.py
+++ b/mininet/cli.py
@@ -395,6 +395,12 @@ def waitForNode( self, node ):
                 # read data but before it has been printed.
                 node.sendInt()
 
+    def precmd( self, line ):
+        "allow for comments in the cli"
+        if '#' in line:
+            line = line.split( '#' )[ 0 ]
+        return line
+
 
 # Helper functions