Revision 47e26cce examples/scratchnet.py
examples/scratchnet.py | ||
---|---|---|
26 | 26 |
createLink( node1=h1, port1=0, node2=switch, port2=1 ) |
27 | 27 |
|
28 | 28 |
info( "*** Configuring hosts\n" ) |
29 |
h0.setIP( h0.intfs[ 0 ], '192.168.123.1', '/24' )
|
|
30 |
h1.setIP( h1.intfs[ 0 ], '192.168.123.2', '/24' )
|
|
29 |
h0.setIP( h0.intfs[ 0 ], '192.168.123.1', 24 )
|
|
30 |
h1.setIP( h1.intfs[ 0 ], '192.168.123.2', 24 )
|
|
31 | 31 |
info( str( h0 ) + '\n' ) |
32 | 32 |
info( str( h1 ) + '\n' ) |
33 | 33 |
|
... | ... | |
46 | 46 |
controller.cmd( 'kill %' + cname) |
47 | 47 |
switch.cmd( 'dpctl deldp nl:0' ) |
48 | 48 |
switch.cmd( 'kill %ofprotocol' ) |
49 |
|
|
49 |
switch.deleteIntfs() |
|
50 |
info( '\n' ) |
|
51 |
|
|
50 | 52 |
if __name__ == '__main__': |
53 |
lg.setLogLevel( 'info' ) |
|
51 | 54 |
info( '*** Scratch network demo (kernel datapath)\n' ) |
52 | 55 |
init() |
53 |
lg.setLogLevel( 'info' ) |
|
54 | 56 |
scratchNet() |
Also available in: Unified diff