[Solved] How to get a list of available gateways? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- loaded · 2022-04-09 07:01 Hi All, Is there a method other than ipconfig where we can find out all the gateway addresses available in the windows operating system? ---------------------------------------------------------------------- paweld · 2022-04-09 08:33 from: https://stackoverflow.com/questions/18378630/get-information- about-the-installed-network-adapters Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  jwawindows; procedure TForm1.Button1Click(Sender: TObject);var  pAdapterInfo: PIP_ADAPTER_INFO;  AdapterInfo: IP_ADAPTER_INFO;  BufLen: DWORD;  Status: DWORD;  strMAC: String;  i: Integer;begin  BufLen:= sizeof(AdapterInfo);  pAdapterInfo:= @AdapterInfo;  Status:= GetAdaptersInfo(nil, BufLen);  pAdapterInfo:= AllocMem(BufLen);  try  Status:= GetAdaptersInfo(pAdapterInfo, BufLen);    if (Status <> ERROR_SUCCESS) then    begin      case Status of        ERROR_NOT_SUPPORTED: Memo1.Lines.Add('GetAdaptersInfo is not supported by the operating ' +          'system running on the local computer.');        ERROR_NO_DATA: Memo1.Lines.Add('No network adapter on the local computer.');      else        Memo1.Lines.Add('GetAdaptersInfo failed with error #' + IntToStr(Status));      end;      Dispose(pAdapterInfo);      exit;  end;     while (pAdapterInfo <> nil) do    begin      memo1.Lines.Add('----------------------------------------------');    memo1.Lines.Add('Description: ' + pAdapterInfo^.Description);      memo1.Lines.Add('Name: ' + pAdapterInfo^.AdapterName);      //strMAC := '';      //for i := 0 to pAdapterInfo^.AddressLength - 1 do      //   strMAC := strMAC + '-' + IntToHex(pAdapterInfo^.Address[i], 2);    //memo1.Lines.Add('MAC address: ' + Copy(strMAC, 2, Length(strMAC) - 1));      //memo1.Lines.Add('IP address: ' + pAdapterInfo^.IpAddressList.IpAddress.S);      //memo1.Lines.Add('IP subnet mask: ' + pAdapterInfo^.IpAddressList.IpMask.S);      memo1.Lines.Add('Gateway: ' + pAdapterInfo^.GatewayList.IpAddress.S);      //memo1.Lines.Add('DHCP enabled: ' + IntTOStr(pAdapterInfo^.DhcpEnabled));      //memo1.Lines.Add('DHCP: ' + pAdapterInfo^.DhcpServer.IpAddress.S);      //memo1.Lines.Add('Have WINS: ' + BoolToStr(pAdapterInfo^.HaveWins,True));      //memo1.Lines.Add('Primary WINS: ' + pAdapterInfo^.PrimaryWinsServer.IpAddress.S);      //memo1.Lines.Add('Secondary WINS: ' + pAdapterInfo^.SecondaryWinsServer.IpAddress.S);      pAdapterInfo:= pAdapterInfo^.Next;    end;  finally    Dispose(pAdapterInfo);  end;end; ---------------------------------------------------------------------- loaded · 2022-04-09 08:41 Thank you so much paweld for the reply. Yes this solution was what I was looking for.