How to calculate the IP range when the IP address and the netmask is given?

Viewed 138158

When a IP-Range is written as aaa.bbb.ccc.ddd/netmask (CIDR Notation) I need to calculate the first and the last included ip address in this range with C#.

Example:

Input: 192.168.0.1/25

Result: 192.168.0.1 - 192.168.0.126

8 Answers
Related