title: How to run sudo mn --custom option in Mininet?
body: <p>I am trying to run .py script in Mininet with --custom option. My code is as follows:</p>
  
  <pre><code>from mininet.topo import Topo
  from mininet.net import Mininet
  from mininet.util import dumpNodeConnections
  from mininet.log import setLogLevel
  from mininet.util import irange
  
  class LinearTopo( Topo ):
      "Linear topology of k switches, with n hosts per switch."
  
      def build( self, k=2, n=1, **_opts):
          """k: number of switches
             n: number of hosts per switch"""
          self.k = k
          self.n = n
  
          if n == 1:
              genHostName = lambda i, j: 'h%s' % i
          else:
              genHostName = lambda i, j: 'h%ss%d' % ( j, i )
  
          lastSwitch = None
          for i in irange( 1, k ):
              # Add switch
              switch = self.addSwitch( 's%s' % i )
              # Add hosts to switch
              for j in irange( 1, n ):
                  host = self.addHost( genHostName( i, j ) )
                  self.addLink( host, switch )
              # Connect switch to previous
              if lastSwitch:
                  self.addLink( switch, lastSwitch )
              lastSwitch = switch
  
  
  def simpleTest():
          "Create and test a simple network"
          topo = LinearTopo(k=4,n=8)
          net = Mininet(topo)
          net.start()
          print "Dumping host connections"
          dumpNodeConnections(net.hosts)
          print "Testing network connectivity"
          net.pingAll()
          net.stop()
  
  if __name__ == '__main__':
          # Tell mininet to print useful information
          setLogLevel('info')
          simpleTest()
  </code></pre>
  
  <p>When i try:</p>
  
  <pre><code>sudo mn --custom topo.py --topo LinearTopo
  </code></pre>
  
  <p>i get the following error:</p>
  
  <pre><code>*** Cleanup complete.
  mininet@mininet-vm:~$ sudo mn --custom topo.py --topo LinearTopo
  --------------------------------------------------------------------------------
  Caught exception. Cleaning up...
  
  Exception: Invalid topo name LinearTopo
  --------------------------------------------------------------------------------
  *** Removing excess controllers/ofprotocols/ofdatapaths/pings/noxes
  killall controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2&gt; /dev/null
  killall -9 controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2&gt; /dev/null
  pkill -9 -f "sudo mnexec"
  *** Removing junk from /tmp
  rm -f /tmp/vconn* /tmp/vlogs* /tmp/*.out /tmp/*.log
  *** Removing old X11 tunnels
  *** Removing excess kernel datapaths
  ps ax | egrep -o 'dp[0-9]+' | sed 's/dp/nl:/'
  ***  Removing OVS datapaths
  ovs-vsctl --timeout=1 list-br
  ovs-vsctl --timeout=1 list-br
  *** Removing all links of the pattern foo-ethX
  ip link show | egrep -o '([-_.[:alnum:]]+-eth[[:digit:]]+)'
  ip link show
  *** Killing stale mininet node processes
  pkill -9 -f mininet:
  *** Shutting down stale tunnels
  pkill -9 -f Tunnel=Ethernet
  pkill -9 -f .ssh/mn
  rm -f ~/.ssh/mn/*
  *** Cleanup complete.
  </code></pre>
  
  <p>Could you please tell me why a get error: Invalid topo name? </p>