I understand how subnet masks work mechanically and how to convert from the mask to the CIDR bits notation, and I understand the concept of a default gateway. What I don't understand is what setting the subnet mask or default gateway on a device does and/or how it affects the ability to connect to the device.
For more context, I am developing a network device and I have a requirement that the device's IP address, subnet mask, and default gateway need to be configurable. I have learned how to set all these things in Linux, but I don't know how to test that they are working.
For the IP address, I can:
- Successfully connect to the device on its current IP address.
- Set a different (static) IP address.
- Disconnect.
- Fail to connect on the old address.
- Connect successfully on the new address.
Those steps verify that my process for changing the IP address works.
For the subnet mask and default gateway, I can set them and my machine tells me that they are set, but now I want to verify that these settings are working properly.
What basic test can I perform that will verify that the subnet mask and default gateway are getting changed?