{"id":319,"date":"2010-01-20T16:54:49","date_gmt":"2010-01-20T23:54:49","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=319"},"modified":"2010-01-20T16:54:49","modified_gmt":"2010-01-20T23:54:49","slug":"using-xinetd-directives-to-manage-two-instances-of-the-same-service-on-different-interfaces","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=319","title":{"rendered":"Using xinetd directives to manage two instances of the same service on different interfaces."},"content":{"rendered":"<p>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 192.168.0.1, and my Internet interface has IP address 10.10.10.10.  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.<\/p>\n<p>The first thing I did was create a new entry in the \/etc\/services file.  I will use telnet as an example.<\/p>\n<p>vi \/etc\/services<br \/>\n&#8230;<br \/>\ntelnetnew          23\/tcp<br \/>\n&#8230;<\/p>\n<p>Create new service configuation file:<\/p>\n<p>vi \/etc\/xinetd.d\/telnetnew<\/p>\n<p>service telnetnew<br \/>\n{<br \/>\n        disable                    = no<br \/>\n        flags                        = REUSE<br \/>\n        wait                         = no<br \/>\n        user                        = root<br \/>\n        server                    = \/usr\/sbin\/in.telnetd<br \/>\n        socket_type            = stream<br \/>\n        protocol                  = tcp<br \/>\n        log_on_failure        += USERID<br \/>\n        log_on_success     += USERID<br \/>\n        only_from               = 192.168.0.0\/24<br \/>\n        instances               = 100<br \/>\n        bind                       = 192.168.0.1<br \/>\n}<\/p>\n<p>Modify the existing \/etc\/xinetd.d\/telnet configuration file with new directives:<\/p>\n<p>vi \/etc\/xinetd.d\/telnet<br \/>\n&#8230;<br \/>\n        no_access             = 192.168.0.0\/24<br \/>\n        instances               = 1<br \/>\n        bind                       = 10.10.10.10<br \/>\n&#8230;<\/p>\n<p>Create the new service and enable it:<\/p>\n<p>chkconfig &#8211;add telnetnew<br \/>\nchkconfig telnetnew on<\/p>\n<p>Reload xinetd to implement the new configuration and the start the new service.<\/p>\n<p>service xinetd reload<\/p>\n<p>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. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 192.168.0.1, and my Internet interface has IP address 10.10.10.10. I used procedures very similar to these to configure to use two different sets [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[47,45,46],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-directives","tag-rhel5","tag-xinetd"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions"}],"predecessor-version":[{"id":320,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions\/320"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}