code: def get_internal_ip():
      
      nics = {}
      for interface_name in interfaces():
          addresses = ifaddresses(interface_name)
          try:
              nics[interface_name] = {
                  'ipv4': addresses[AF_INET],
                  'link_layer': addresses[AF_LINK],
                  'ipv6': addresses[AF_INET6],
              }
          except KeyError:
              pass
  
      return nics
docs: Get the local IP addresses.