A small utility to fetch current network interface IP and show details about its subnet.
Run for all interfaces which are connected:
$ ./subnetranger
Interface 2: wlp0s20f3 - 10.5.173.38/20
IP Address 10.5.173.38
Subnet IP 10.5.160.0
Subnet Mask fffff000
Broadcast address 10.5.175.255
Subnet range 10.5.160.0 - 10.5.175.255
Run for a given IP with its CIDR notation:
$ ./subnetranger 192.168.1.38/24
IP Address 192.168.1.38
Subnet IP 192.168.1.0
Subnet Mask ffffff00
Broadcast address 192.168.1.255
Subnet range 192.168.1.0 - 192.168.1.255
Help on usage:
$ ./subnetranger --help
Usage:
subnetranger <ip address in CIDR notation>
For example:
subnetranger 10.5.173.38/20
subnetranger
This will evaluate details for all your network interfaces that are up and not loopback
subnetranger [-h|--help]
Prints this help message