Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[mininet-discuss] Python script get hang when using h1.cmd('dhclient '+h1.defaultIntf().name) API

Suresh skjaiswal79 at
Thu Dec 26 06:15:43 PST 2013

Hi All,
       I want to ping h1 virtual host to my physical host.
       and I have modified file as following 

 28 if __name__ == '__main__':
 29     setLogLevel( 'info' )
 31     # try to get hw intf from the command line; by default, use eth1
 32     intfName = sys.argv[ 1 ] if len( sys.argv ) > 1 else 'eth1'
 33     info( '*** Connecting to hw intf: %s' % intfName )
 35     info( '*** Checking', intfName, '\n' )
 36     checkIntf( intfName )
 38     info( '*** Creating network\n' )
 39     #net = Mininet( topo=TreeTopo( depth=1, fanout=2 ) )
 40     net = Mininet()
 41     c1 = net.addController( 'c1', ip='')
 42     #switch = net.switches[ 0 ]
 43     s1 = net.addSwitch('s1')
 44     h1= net.addHost('h1', ip='')
 45     net.addLink( h1, s1 )
 47     info( '*** Adding hardware interface', intfName, 'to switch',
 48           s1, '\n' )
 49     _intf = Intf( intfName, node=s1 )
 51     info( '*** Note: you may need to reconfigure the interfaces for '
 52           'the Mininet hosts:\n', net.hosts, '\n' )
 54     net.start()
 55     h1.cmd('dhclient '+h1.defaultIntf().name)
 56     CLI( net )
 57     net.stop()

When I ran this script using  sudo python
then this got hang for some time(5-8 minute) and after that I got my mininet prompt .
when I see detail using dump then I found h1 not getting any ip from DHCP.
mininet> dump
<Host h1: h1-eth0: pid=15110>
<OVSSwitch s1: lo:,s1-eth1:None,eth1:None pid=15103>
<Controller c1: pid=15095>
P.S I have added eth1 interface without any IP.
My mininet VM( on running windows desktop machine which have ip address in a same subnet.
Add my floodlight controller running on windows machine in forwarding enable mode no need to add any flow 
by default for ping.
can any one help me regarding this what I am doing wrong here.
Thanks in advance.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the mininet-discuss mailing list