IPv4 addresses are basically Int64 with a different notation. So you can do the following:
for (var i = fromAddress.Address; i <= toAddress.Address; i++) { Console.WriteLine(new IPAddress(i)); }
The Address property is deprecated, but this may not bother you.
source share