Configure IPv4 network 192.168.40.0/24.
Convert the prefix length to dotted-decimal netmask notation.
Which netmask corresponds to /24?
/24 has 24 network bits and 8 host bits, so its dotted-decimal netmask is 255.255.255.0.
Detailed explanation
255.255.255.0Correct. 255.255.255.0 represents a /24 prefix.
Correct. 255.255.255.0 represents a /24 prefix.
255.255.0.0Incorrect. This netmask represents /16.
Incorrect. This netmask represents /16.
255.255.255.128Incorrect. This netmask represents /25.
Incorrect. This netmask represents /25.
255.255.255.255Incorrect. All 32 bits set represents /32.
Incorrect. All 32 bits set represents /32.
Try it yourself
An example you can run in a temporary verification environment.
python3 -c "import ipaddress; print(ipaddress.ip_network('192.168.40.0/24').netmask)"Expected result
255.255.255.0Key points
- The first 24 bits are one
- Eight bits remain for hosts
- Convert each octet to dotted notation
Notes
- Environment: Python 3 ipaddress / ローカル計算のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.