|
|
|
|
com.lukasfeiler.ipconfig
|
Please download the package HERE.
Please see the documentation for details.
From the documentation:
To validate a network interface configuration on the command line run
java -jar com.lukasfeiler.ipconfig.jar
You will be prompted for IP address, netmask and default gateway.
com.lukasfeiler.ipconfig will verify the following:
- The IP addresses consist of 4 valid octets (numbers between 0 and 255).
- The netmask is continious - i.e. the netmask consists of a number of 1s followed by a number of 0s.
- The host part bits of the IP addresses are not all set to 0 - this would be a reference to the whole subnet (e.g. 192.168.1.0/255.255.255.0).
- The host part bits of the IP addresses are not all set to 1 - this would be a broadcast address (e.g. 192.168.1.255/255.255.255.0).
- Both IP addresses are within the same subnet - the network part is equal for both IP addresses.
Example:
Are the IP addresses 192.168.1.10 and 192.168.1.9 in the same subnet 255.255.255.252? Let's find out!
java -jar com.lukasfeiler.ipconfig.jar
IP Adress: 192.168.1.10
Netmask: 255.255.255.252
Gateway: 192.168.1.9
------------------ OUTPUT FOLLOWS ------------------
OK!
IP adress: 192.168.1.10
Netmask: 255.255.255.252
Gateway: 192.168.1.9
The reason for this is as follows:
| IP address | 192.168.1.10 | 11000000101010000000000100001011 |
| Netmask | 255.255.255.252 | 11111111111111111111111111111100 |
| Gateway | 192.168.1.9 | 11000000101010000000000100001010 |
As you can see the IP address and the gateway have the same host part (which is 30 bits long in this case).
Therefore they are in the same subnet and the network interface configuration is valid.
|
|