Allow connections to an xinetd service only from IPv4 network 192.0.2.0/24.
Set the source restriction inside the service block.
Which line is appropriate?
xinetd only_from limits permitted source hosts or networks; no_access is the list of sources to reject.
Detailed explanation
no_access = 192.0.2.0/24Incorrect. no_access rejects the specified network, the opposite of the requirement.
Incorrect. no_access rejects the specified network, the opposite of the requirement.
only_from = 192.0.2.0/24Correct. It allows only the specified source network.
Correct. It allows only the specified source network.
bind = 192.0.2.0/24Incorrect. bind selects a local listening address, not a remote source restriction.
Incorrect. bind selects a local listening address, not a remote source restriction.
server_args = 192.0.2.0/24Incorrect. server_args passes arguments to the service process.
Incorrect. server_args passes arguments to the service process.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'only_from=allow listed sources' 'no_access=deny listed sources'Expected result
only_from=allow listed sources
no_access=deny listed sourcesKey points
- only_from is an allow list
- no_access is a deny list
- bind selects the local address
Notes
- Environment: xinetd access control対応表
- 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.