LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Directing port traffic from interface to localhost (https://www.linuxquestions.org/questions/linux-networking-3/directing-port-traffic-from-interface-to-localhost-4175532992/)

jpresto 02-03-2015 10:09 PM

Directing port traffic from interface to localhost
 
I have a mongodb process which I'm unable to change the config on and it's bound to localhost only. I'd like to connect to it from another system.

I may have exhausted my options for trying to change the config file - is there any way to route tcp a single port's traffic from eth1 over to localhost?

Thanks in advance - Joe

Miati 02-03-2015 11:36 PM

Quote:

route tcp a single port's traffic from eth1 over to localhost?
Might try ssh forwarding. You will need ssh access with TCPForwarding set to yes for this to work.

Code:

ssh -R remoteip:remoteport:localip:localport hostname
This will forward all traffic going to the remote port to the local port you specifiy.

Quote:

I may have exhausted my options for trying to change the config file
Do you own the system? Generally, subverting security is not a way to get on people's good side.
Just saying ;)

jpresto 02-04-2015 12:50 PM

My systems. Background is this is a unifi controller and it launches mongodb without any way to change the bind address. I want it on an IP so I can connect to it via an ODBC driver on a windows box.

I'd rather avoid using SSH on the remote side.. and forgive linux ignorance, but perhaps iptables??

Miati 02-04-2015 02:08 PM

You could likely port forward using iptables so that external devices can connect

But if the process is localhost bound, then a connection by a external ip will not work. Since you can't seem to change that behavior, the only way I know would be to "trick" it, using ssh.
If windows is involved though, I can't say whether it would work or not.

However, someone else may have an idea.


All times are GMT -5. The time now is 08:05 AM.