Esempio n. 1
0
                         help="turn forth into a simple tree topology with four hosts and a switch")  # TODO split line
    args, unknown = parser.parse_known_args( argv )
    
    lg.setLogLevel( 'info' )
    
    # Create net
    if (not args.switch):
        forth = Forth()
    else:
        forth = Forth(Mode.SWITCH)
    net = Mininet(topo=forth)

    # Create itable.conf for student's r0 code, if requested
    if (args.itable is not None):
        info( '*** Creating itable for r0\n' )
        itable = Itable()
        itable.add('r0-eth0', '10.0.1.1', '00:00:00:00:01:01', '255.255.255.0') 
        itable.add('r0-eth1', '10.0.2.1', '00:00:00:00:01:02', '255.255.255.0') 
        itable.add('r0-eth2', '10.0.3.1', '00:00:00:00:01:03', '255.255.255.0') 
        itable.add('r0-eth3', '10.0.4.1', '00:00:00:00:01:04', '255.255.255.0')
        itable.createFile(args.itable) 

    # Start mininet and configure each of the hosts
    # (order in list is alphabetical)
    info( '*** Starting mininet\n' )
    net.start()
    
    # Do router mode configuration
    if (not args.switch):
        r0, h0, h1, h2, h3 = net.hosts[4], net.hosts[0], net.hosts[1], \
                             net.hosts[2], net.hosts[3] 
Esempio n. 2
0
                         help="don't connect to the internet")
    args, unknown = parser.parse_known_args(argv)

    lg.setLogLevel('info')

    # Create net
    if (not args.switch):
        humber = Humber()
    else:
        humber = Humber(Mode.SWITCH)
    net = Mininet(topo=humber)

    # Create itable.conf for student's router code, if requested
    if (args.itable is not None):
        info('*** Creating itable for r0\n')
        r0_itable = Itable()
        r0_itable.add('r0-eth0', '10.0.1.1', '00:00:00:00:00:01 ',
                      '255.255.255.0')
        r0_itable.add('r0-eth1', '10.0.2.1', '00:00:00:00:00:02 ',
                      '255.255.255.0')
        r0_itable.add('r0-eth2', '10.0.3.1', '00:00:00:00:00:03 ',
                      '255.255.255.0')
        r0_itable.createFile('r0-' + args.itable)
        info('*** Creating itable for r1\n')
        r1_itable = Itable()
        r1_itable.add('r1-eth0', '10.0.2.2', '00:00:00:00:01:01 ',
                      '255.255.255.0')
        r1_itable.add('r1-eth1', '10.0.4.1', '00:00:00:00:01:02 ',
                      '255.255.255.0')
        r1_itable.add('r1-eth2', '10.0.6.1', '00:00:00:00:01:03 ',
                      '255.255.255.0')
Esempio n. 3
0
                         help="don't connect to the internet")
    args, unknown = parser.parse_known_args( argv )
    
    lg.setLogLevel( 'info' )
    
    # Create net
    if (not args.switch):
        humber = Humber()
    else:
        humber = Humber(Mode.SWITCH)
    net = Mininet(topo=humber)

    # Create itable.conf for student's router code, if requested
    if (args.itable is not None):
        info( '*** Creating itable for r0\n' )
        r0_itable = Itable()
        r0_itable.add('r0-eth0', '10.0.1.1', '00:00:00:00:00:01 ', '255.255.255.0')
        r0_itable.add('r0-eth1', '10.0.2.1', '00:00:00:00:00:02 ', '255.255.255.0')
        r0_itable.add('r0-eth2', '10.0.3.1', '00:00:00:00:00:03 ', '255.255.255.0')
        r0_itable.createFile('r0-'+args.itable) 
        info( '*** Creating itable for r1\n' )
        r1_itable = Itable()
        r1_itable.add('r1-eth0', '10.0.2.2', '00:00:00:00:01:01 ', '255.255.255.0')
        r1_itable.add('r1-eth1', '10.0.4.1', '00:00:00:00:01:02 ', '255.255.255.0')
        r1_itable.add('r1-eth2', '10.0.6.1', '00:00:00:00:01:03 ', '255.255.255.0')
        r1_itable.createFile('r1-'+args.itable) 
        info( '*** Creating itable for r2\n' )
        r2_itable = Itable()
        r2_itable.add('r2-eth0', '10.0.3.2', '00:00:00:00:02:01 ', '255.255.255.0')
        r2_itable.add('r2-eth1', '10.0.5.1', '00:00:00:00:02:02 ', '255.255.255.0')
        r2_itable.add('r2-eth2', '10.0.6.2', '00:00:00:00:02:03 ', '255.255.255.0')