hmm - looking into it. Maybe check hosts file: "C:\Windows\System32\drivers\etc\hosts" (::1 is localhost for eg) or the zeros are compresses so it's actually 0: 0: 0: 0 or the gateway has no true ip address.
The method seems to return an arbitrary gateway. may I suggest some linq:
foreach (
GatewayIPAddressInformation d in
from f in NetworkInterface.GetAllNetworkInterfaces()
where f.OperationalStatus == OperationalStatus.Up
from d in f.GetIPProperties().GatewayAddresses
select d)
{
ip = d.Address.ToString();
}
NetworkInterface.GetAllNetworkInterfaces()
.Where(f => f.OperationalStatus == OperationalStatus.Up)
.SelectMany(f=>f.GetIPProperties().GatewayAddresses)
.Select(d=>d.Address)