You are not logged in.

#1 2013-05-26 19:31:49

StR@ng3r
Member
Registered: 2011-11-12
Posts: 65

Proxy Server with Port Forwarding?

Hello archers,

I got two servers, A and B. I want B to run an application with outgoing and incoming taffic and I want it to tunnel all that traffic through A.

I know I could archive this with OpenVPN. Port forwarding would be easy. But to my knowledge that would mean that ALL traffic from B is routed thorugh A. Exceptions can only be specified by IP-ranges, not ports nor applications. That's not a feasable solution, as B is also running a webserver that need's to be accessable directly and I don't want those connections to be routed through A aswell.

To my understanding there is no way of using OpenVPN to route all traffic from B thtough A but not traffic on port 80.

That's why I am looking at proxy servers. Well, is there a proxy server that supports port forwarding?


Basically all I want is traffic on one Port to be routed completly from B thtough A (both directions) and traffic on another port to be direct connecitons to B.

Hope anybody can point me in a direction to archive this. Thanks.

Last edited by StR@ng3r (2013-05-26 19:32:20)

Offline

#2 2013-05-26 19:52:05

Tarqi
Member
From: Ixtlan
Registered: 2012-11-27
Posts: 179
Website

Re: Proxy Server with Port Forwarding?

If you stay on OpenVPN, you may use iptables mangle table to mark the packets from the used port and then install a new route based on these packets.

Last edited by Tarqi (2013-05-26 21:22:06)


Knowing others is wisdom, knowing yourself is enlightenment. ~Lao Tse

Offline

#3 2013-05-26 23:58:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Proxy Server with Port Forwarding?

What you need is Policy Based Routing. I wrote a script to help achieve this [1] but a Google/DDG search should help point you in the right directions.

[1] https://github.com/fukawi2/pb-route/

Offline

#4 2013-05-27 08:59:08

StR@ng3r
Member
Registered: 2011-11-12
Posts: 65

Re: Proxy Server with Port Forwarding?

Holy shit, that stuff is complicated. Isn't there like an SOCKS-Proxy or something that allows port forwarding?

That way I could just sockify the application that traffic I want to route through A. But that will only work if A can also route incoming connections to B. So I would require a port forwarding setup. Just havn't found an answer to wether thhis can be achieved with a SOCKS-Proxy.

Offline

#5 2013-05-27 22:57:49

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Proxy Server with Port Forwarding?

Yes it is complicated, but you can't make an application use a SOCKS proxy if it doesn't know how to so you have to get the kernel to handle the routing instead.

Offline

Board footer

Powered by FluxBB