def ifacestartswith(cidr):
 net_list = interfaces()
 intfnames = []
 pattern = str(cidr)
 size = len(pattern)
 for (ifname, ifval) in six.iteritems(net_list):
  if ('inet' in ifval):
   for inet in ifval['inet']:
    if (inet['address'][0:size] == pattern):
     if ('label' in inet):
      intfnames.append(inet['label'])
     else:
      intfnames.append(ifname)
 return intfnames

def ifacestartswith ( cidr ) : net_list = interfaces ( ) intfnames = [ ] pattern = str ( cidr ) size = len ( pattern ) for ( ifname , ifval ) in six . iteritems ( net_list ) : if ( 'inet' in ifval ) : for inet in ifval [ 'inet' ] : if ( inet [ 'address' ] [ 0 : size ] == pattern ) : if ( 'label' in inet ) : intfnames . append ( inet [ 'label' ] ) else : intfnames . append ( ifname ) return intfnames
retrieve the interface name from a specific cidr .