diff --git a/examples/vlanhost.py b/examples/vlanhost.py index 00f636905d833e0ba36dd04295dcc174d34829eb..97c6e8e300a2dce54adcd4cdb78a92db5373e471 100755 --- a/examples/vlanhost.py +++ b/examples/vlanhost.py @@ -26,6 +26,8 @@ from mininet.node import Host from mininet.topo import Topo +from mininet.util import quietRun +from mininet.log import error class VLANHost( Host ): @@ -107,6 +109,11 @@ def exampleCustomTags( vlan ): setLogLevel( 'info' ) + if not quietRun( 'which vconfig' ): + error( "Cannot find command 'vconfig'\nThe packge", + "'vlan' is required in Ubuntu or Debian,", + "or 'vconfig' in Fedora\n" ) + exit() try: vlan = int( sys.argv[ 1 ] ) except Exception: