Enabling desired disagnotic protocols
provided by xinetd as "internal services"
There are several quite simple old protocols that are useful for diagnostic purposes but deprecated for practical ones. These include discard, echo, and chargen. In most unixes they are not installed any longer by default. If you want them, in Fedora they come with xinetd. While traditionally they were implemented as separate binary executables like most services, they are so minor that these days they are manifested as internal services of xinetd. That is, the code for the xinetd program, whose job is to manage other servers, takes on the jobs of these services on the side. If you want one of them, you turn it on like any other xinetd service by editing the xinetd configuration file for it in /etc/xinetd.
The assignment for you to perform
The well-known ports these services use are
Find out which ones are currently running.
Look for output lines indicating xinetd listening on their ports. For example, something like this from netstat:
tcp 0 0 :::9 :::* LISTEN 2450/xinetd udp 0 0 :::7 :::* 2450/xinetd
would indicate discard (port 9) running as a TCP service on port 9 where it is in TCP's LISTEN state, and echo (port 7) running as a UCP service on port 7. Note that these services run as TCP services on one hand, and/or UDP services on the other, independently. For those services of interest that are not running, you will configure xinetd so that they will. The services of interest, and the xinetd configuration files wherein you turn them on, are:
|Service||Protocol||xinetd configuration file|
For any of these cases where netstat indicated the service already running, you need to do nothing. For all the others, turn them on by editing into their xinetd config files a line that reads:
disable = no
(you will find an existing line reading "disable = yes"; change it). Then to give it effect, restart xinetd:
service xinetd restart
Check with netstat to see that they are all running now. Also, exercise each of them to confirm for sure. You could do so with either sock or nc (remaining syntax, as below, invariant in this case). Run this:
nc 127.0.0.1 7
Type a line followed by the enter key. What you typed should be echoed back to you. Run this:
nc 127.0.0.1 9
Type a line followed by the enter key. What you typed should not be echoed back to you now, nor anything else. It got discarded. Run this:
nc 127.0.0.1 19
Don't bother to type anything, just press ctrl-C to stanch the flow of generated characters.