• Port forwarding with xinetd Ask


    https://stackoverflow.com/questions/21716673/port-forwarding-with-xinetd

    ------------------------------------------------------------------------------------------------------------------------------------

    I want to forward xinetd connection to another local port (say 12345). I based my solution on CentOS/Redhat documentation Chapter 17. TCP Wrappers and xinetd, article 17.4.3.3. In the example the configuration starts a daemon and also redirects the traffic to a host:port. The doco say it should be able to forward to different port on the same system too.

    My current goal is to starts a daemon (say testsmpp) at any connection on port 12345 and redirect the stream to a particular port (say 54321). The tricky bit is I don't want the daemon (testsmpp) to read from STDIN, instead it should be able to read from the port where the xinetd is forwarding the traffic to.

    I created a service under /etc/service e.g

    testsmpp    12345/tcp
    

    And my xinetd configuration for the daemon is

    service testsmpp
    {
        sock_type =     stream
        protocol =      tcp
        wait =          no
        user =          root
        server =        /home/me/bin/testsmpp        
        redirect =      54321
    }
    

    testsmpp listens on port 54321. The problem is when a connection made from outside, xinetd starts the daemon but do not forward the traffic to 54321. Once the server started I can connect directly to 54321 port but the connection made via xinetd (at port 12345) is not forwarded.

    Is server and redirect tags are mutually exclusive? I looked at the discussion about xinet forking concurrent server but my motivation are slightly different. I want to listen for incoming connection on another port as the other application will communicate with the daemon on that port too in a distributed computing environment.

    Any clues much appreciated.

  • 相关阅读:
    一些$LCT$的瓜皮题目
    写点东西(关于背包问题)
    字符串算法总结
    常系数齐次线性递推
    原根算法与剩余定理
    问题集
    常用链接
    回形针PaperClip
    6.824拾遗
    杂项
  • 原文地址:https://www.cnblogs.com/oxspirt/p/8000025.html
Copyright © 2020-2023  润新知