Change to use Intf() class rather than string for interface.
Was broken in 2.0.0rc1
This commit is contained in:
+10
-5
@@ -10,6 +10,7 @@ import re
|
|||||||
from mininet.cli import CLI
|
from mininet.cli import CLI
|
||||||
from mininet.log import setLogLevel, info, error
|
from mininet.log import setLogLevel, info, error
|
||||||
from mininet.net import Mininet
|
from mininet.net import Mininet
|
||||||
|
from mininet.link import Intf
|
||||||
from mininet.topolib import TreeTopo
|
from mininet.topolib import TreeTopo
|
||||||
from mininet.util import quietRun
|
from mininet.util import quietRun
|
||||||
|
|
||||||
@@ -27,16 +28,20 @@ def checkIntf( intf ):
|
|||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
setLogLevel( 'info' )
|
setLogLevel( 'info' )
|
||||||
|
|
||||||
newIntf = 'eth1'
|
intfName = 'eth1'
|
||||||
info( '*** Checking', newIntf, '\n' )
|
info( '*** Checking', intfName, '\n' )
|
||||||
checkIntf( newIntf )
|
checkIntf( intfName )
|
||||||
|
|
||||||
info( '*** Creating network\n' )
|
info( '*** Creating network\n' )
|
||||||
net = Mininet( topo=TreeTopo( depth=1, fanout=2 ) )
|
net = Mininet( topo=TreeTopo( depth=1, fanout=2 ) )
|
||||||
|
|
||||||
switch = net.switches[ 0 ]
|
switch = net.switches[ 0 ]
|
||||||
info( '*** Adding', newIntf, 'to switch', switch.name, '\n' )
|
info( '*** Adding hardware interface', intfName, 'to switch',
|
||||||
switch.addIntf( newIntf )
|
switch.name, '\n' )
|
||||||
|
intf = Intf( intfName, node=switch )
|
||||||
|
|
||||||
|
info( '*** Note: you may need to reconfigure the interfaces for '
|
||||||
|
'the Mininet hosts:\n', net.hosts, '\n' )
|
||||||
|
|
||||||
net.start()
|
net.start()
|
||||||
CLI( net )
|
CLI( net )
|
||||||
|
|||||||
Reference in New Issue
Block a user