Skip to content
Snippets Groups Projects
Commit b96e1596 authored by Bob Lantz's avatar Bob Lantz
Browse files

Change to use Intf() class rather than string for interface.

Was broken in 2.0.0rc1
parent 35698385
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
from mininet.cli import CLI
from mininet.log import setLogLevel, info, error
from mininet.net import Mininet
from mininet.link import Intf
from mininet.topolib import TreeTopo
from mininet.util import quietRun
......@@ -27,16 +28,20 @@ def checkIntf( intf ):
if __name__ == '__main__':
setLogLevel( 'info' )
newIntf = 'eth1'
info( '*** Checking', newIntf, '\n' )
checkIntf( newIntf )
intfName = 'eth1'
info( '*** Checking', intfName, '\n' )
checkIntf( intfName )
info( '*** Creating network\n' )
net = Mininet( topo=TreeTopo( depth=1, fanout=2 ) )
switch = net.switches[ 0 ]
info( '*** Adding', newIntf, 'to switch', switch.name, '\n' )
switch.addIntf( newIntf )
info( '*** Adding hardware interface', intfName, 'to switch',
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()
CLI( net )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment