I used the following configuration to use different xinetd directives for a service depending on which interface the connection was initiated on. In the following example, my LAN interface has IP address, and my Internet interface has IP address I used procedures very similar to these to configure to use two different sets of directives for an SMTP server on a system running RHEL5.

The first thing I did was create a new entry in the /etc/services file. I will use telnet as an example.

vi /etc/services

telnetnew 23/tcp

Create new service configuation file:

vi /etc/xinetd.d/telnetnew

service telnetnew
disable = no
flags = REUSE
wait = no
user = root
server = /usr/sbin/in.telnetd
socket_type = stream
protocol = tcp
log_on_failure += USERID
log_on_success += USERID
only_from =
instances = 100
bind =

Modify the existing /etc/xinetd.d/telnet configuration file with new directives:

vi /etc/xinetd.d/telnet

no_access =
instances = 1
bind =

Create the new service and enable it:

chkconfig –add telnetnew
chkconfig telnetnew on

Reload xinetd to implement the new configuration and the start the new service.

service xinetd reload

This configuration will enable only one telnet connection from the Internet and 100 from the LAN segment. I used this type of configuration for an SMTP server to reduced the number of connections from the Internet.