I'm working on a setup that requires redirecting request coming on one of the server's port to other server's port in a NATed environment (example: all request coming on 192.168.1.100:843 should be redirected to 192.168.1.200:8443 - both servers are behind a dedicated firewall & communicate each other all ports.)
A service is running on server 192.168.1.200's port 8443. I've configured port-forwarding on server 192.168.1.100 via xinetd as follows.
service serv1
{
bind = 192.168.1.100
protocol = tcp
flags = REUSE
socket_type = stream
port = 843
wait = no
user = root
redirect = 192.168.1.200 8443
}
Now when I'm doing telnet to 192.168.1.100 843 within LAN I'm able to connect the service on 192.168.1.200:8443
-> telnet 192.168.1.100 843
Trying 192.168.1.100...
Connected to 192.168.1.100.
Escape character is '^]'.
But when I'm trying to connect via 192.168.1.100's public IP I'm getting "connection closed"
-> telnet 1.2.3.4 843
Trying 1.2.3.4...
Connected to 1.2.3.4.
Escape character is '^]'.
Connection closed by foreign host.
On doing tcpdump I found in later case request is not coming to server 192.168.1.200 itself.
I'm having similar setup working in one of our DC & its working fine. Any idea if anything could go wrong here.
Thanks, Meghanand