<p>I need to forward an exposed port of a Docker container to a remote port of a remote server. There are two approaches. One is with IP tables, but this wouldn't work for me since I'm not able to give NET_ADMIN access to my containers, which will be running on a cloud provider's Kubernete hosting platform.
The second approach would be to utilize SOCAT, but that has it's own problems since it forks a process for each connection, reaching the maximum allowed open files in no time since I have thousands of concurrent connections.</p>
<p>Are there any alternatives, which can forward a port like iptables does, but without NET_ADMIN requirements, and without needing to create a process for each connection?</p>

wsh25
<p><strong>Check below options :</strong></p>
<p>1)If you want to connect to a port on a specific IP address without the use of netcat.</p>
<p>Try this <code>telnet host.example.com port</code> (e. g. <code>telnet www.example.com 80</code>).</p>
<p>Another possibility is <code>/dev/tcp:</code></p>
<p><code>$ echo &quot;HEAD / HTTP/1.0&quot; &gt;/dev/tcp/[www.example.com/80][1]</code>.</p>
<p>2)There's a tiny, light resources program called <code>redir</code> which is pretty configurable.</p>
<p><code>apt-get install redir</code> to install on Debian-based distributions.</p>
<p><code>redir :SRC :DEST</code> will run in the background as a daemon.</p>
<p>3)<code>Rinetd</code>, It's a daemon that redirects TCP connections. Have a look at the man page to see if it suits your needs: <a href="https://manpages.debian.org/unstable/rinetd/rinetd.8.en.html" rel="nofollow noreferrer">https://manpages.debian.org/unstable/rinetd/rinetd.8.en.html</a></p>
<p>4)<code>portfwd</code>, (TCP and UDP forwarding) https://<a href="https://portfwd.sourceforge.net/" rel="nofollow noreferrer">portfwd.sourceforge.net</a>/, (it latest release is 2007, and it works on 2.6 kernel).</p>
