#NEWLINE# def start( self ) : #NEWLINE# #INDENT# neighbor_list = [ ] #NEWLINE# local_list = [ ] #NEWLINE# cmd = [ 'netserver' , '-D' ] #NEWLINE# for i in range ( 0 , num_neighbors ) : #NEWLINE# #INDENT# ipaddr = ( '172.16.1.%d/24' % ( i + 100 ) ) #NEWLINE# ret = self . _create_ns ( ( 'neighbor%d' % i ) , ipaddr = ipaddr , fn = neighbor_fn , cmd = cmd ) #NEWLINE# neighbor_list . append ( ret ) #NEWLINE# #UNINDENT# for i in range ( 0 , num_locals ) : #NEWLINE# #INDENT# ipaddr = ( '172.16.1.%d/24' % ( i + 150 ) ) #NEWLINE# ret = self . _create_ns ( ( 'local%d' % i ) , ipaddr = ipaddr , fn = pass_fn , cmd = cmd ) #NEWLINE# local_list . append ( ret ) #NEWLINE# #UNINDENT# with ipdb . create ( ifname = 'br100' , kind = 'bridge' ) as br100 : #NEWLINE# #INDENT# for x in neighbor_list : #NEWLINE# #INDENT# br100 . add_port ( x [ 1 ] ) #NEWLINE# #UNINDENT# for x in local_list : #NEWLINE# #INDENT# br100 . add_port ( x [ 1 ] ) #NEWLINE# #UNINDENT# br100 . add_port ( self . wan_if ) #NEWLINE# br100 . up ( )