How To Install TCP Discard Service

by lifeLinux on July 28, 2011

What’s Discard Protocol ?

The Discard Protocol is a service in the Internet Protocol Suite defined in RFC 863. It is intended for testing, debugging, and measurement purposes.
A host may send data to a host that supports the Discard Protocol on either Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) port number 9. The data sent to the server is simply discarded. No response is returned.

Install Discard on Centos

What we need is the TCP Discard service on port 9. Xinetd has it built-in, so we can just use that. Make sure that the following definition is available in xinetd’s configuration file(s), usually /etc/xinetd.d/discard. It should contain a service like the following:

service discard
{
    type            = INTERNAL
    id              = discard-stream
    socket_type     = stream
    protocol        = tcp
    user            = root
    wait            = no
    disable         = no
    FLAGS           = IPv6 IPv4
}

Note: socket_type = stream using for TCP and socket_type = dgram using for UDP

Restart xinetd to reread the configuration files and activate the new discard service. Type the following command:

# /etc/init.d/xinetd restart

Related Posts:

Previous post:

Next post: