Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - redirection based on destination ip/network #6

Closed
jirib opened this issue Feb 8, 2011 · 5 comments
Closed

Feature request - redirection based on destination ip/network #6

jirib opened this issue Feb 8, 2011 · 5 comments

Comments

@jirib
Copy link

jirib commented Feb 8, 2011

Hi,

thanks for your redsocks first!

But can there be a feature to define "parent" tcp-port of proxy-server based on destination ip, network as there are probably multiple redsocks block allowed?

Current:

redsocks {
local_ip = 0.0.0.0;
local_port = 12345;
ip = 127.0.0.1;
port = 1081;
type = socks5;
}

We would like:

redsocks {
local_ip = 0.0.0.0;
local_port = 12345;
dest_ip = 192.168.1.10
ip = 127.0.0.1;
port = 1081;
type = socks5;
}

redsocks {
local_ip = 0.0.0.0;
local_port = 12345;
dest_net = 10.3.37.0/24
ip = 127.0.0.1;
port = 1082;
type = socks5;
}

It would be great! Thanks.

@przemoc
Copy link
Contributor

przemoc commented Feb 8, 2011

It's already possible, but you have to use iptables for proper filtering. You can find an example in the script from my Making SOCKS proxy transparent tip.

@darkk
Copy link
Owner

darkk commented Feb 8, 2011

Yes, przemoc have already answered the question — you can solve the task with two redsocks blocks and select one of them using iptables rules. You should have two different local_port settings in the blocks in this case.

@jirib
Copy link
Author

jirib commented Feb 8, 2011

OK I agree it can be done by this way but copying way how for example dante is doing it (based on destination) would be nice :) thanks anyway.

@darkk
Copy link
Owner

darkk commented Feb 8, 2011

iptables is much more powerful than simple destination-based filter.
I see no good reason to implement this logic in redsocks, anyway, running additional redsocks { local_post = xxx } block should not induce performance penalty unless you have too much destinations. :-)

cappiewu pushed a commit to cappiewu/redsocks that referenced this issue May 9, 2015
@darkk
Copy link
Owner

darkk commented Apr 13, 2016

So current solution is to use several redsocks { local_port = ***; } sections and redirect different traffic to different ports at firewall level.

@darkk darkk closed this as completed Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants