LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-09-2014, 05:28 AM   #1
swulff
LQ Newbie
 
Registered: Jun 2007
Posts: 21

Rep: Reputation: 0
Set up rules for proxies to use only for certain destinations (possibly via iptables)


Hi

I have a small problem that I am currently solving by using multiple configuration files for proxychains, but it is somewhat tedious and I would like to have et simplified a bit

The problem is, I have multiple servers for clients that I have to connect to, but each client have their own SOCKS5 Proxy that I need to go through in order to connect to their network (the proxies allow anonymous access) - I would like somehow to set up rules on machine somewhat like:

- Any outbound traffic to host-1 is routed through SOCKS5 proxy-1
- Any outbound traffic to host-2 is routed through SOCKS5 proxy-2
- Any outbound traffic to host-3 is routed through SOCKS5 proxy-3
- All other traffic - no rules

Is that possible, fx. via IPTables ?

I realize many many posts have been made and many articles written about IPTables, but I have not been able to find any that can solve my problem, so if you know of a post that could it would be helpful - or maybe you know how to solve this :-)..

I have two bonus questions, which are not essential
1: Would it be possible to set up two rules for 1 destination (two proxies) and set it to randomly use one over the other ? for example: "Any outbound traffic to host-4 is either routed through SOCKS5 proxy-4 or SOCKS5 proxy-4x"

2: Would it be possible to route traffic through multiple proxies with IPTables ? For example "Any outbound traffic to host-4 is routed through SOCKS5 proxy-4 AND SOCKS5 proxy-4x"

Thanks in advance

Last edited by swulff; 04-09-2014 at 06:22 AM.
 
Old 04-09-2014, 09:57 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by swulff View Post
Hi

I have a small problem that I am currently solving by using multiple configuration files for proxychains, but it is somewhat tedious and I would like to have et simplified a bit

The problem is, I have multiple servers for clients that I have to connect to, but each client have their own SOCKS5 Proxy that I need to go through in order to connect to their network (the proxies allow anonymous access) - I would like somehow to set up rules on machine somewhat like:

- Any outbound traffic to host-1 is routed through SOCKS5 proxy-1
- Any outbound traffic to host-2 is routed through SOCKS5 proxy-2
- Any outbound traffic to host-3 is routed through SOCKS5 proxy-3
- All other traffic - no rules

Is that possible, fx. via IPTables ?
[...]
bonus questions:
1: Would it be possible to set up two rules for 1 destination (two proxies) and set it to randomly use one over the other ? for example: "Any outbound traffic to host-4 is either routed through SOCKS5 proxy-4 or SOCKS5 proxy-4x"

2: Would it be possible to route traffic through multiple proxies with IPTables ? For example "Any outbound traffic to host-4 is routed through SOCKS5 proxy-4 AND SOCKS5 proxy-4x"
Very interesting question, and sorry, I am not at all an expert in this matter, but perhaps instead of looking for an iptables solution you are luckier with proxifiers. Or ssh -D might fit your requirement.
 
  


Reply

Tags
iptables, proxy


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to permanently set iptables rules austinramsay Slackware 12 10-13-2013 12:29 PM
Problems with iptables > Rules set but not working effektive tiuz Linux - Security 5 08-28-2013 03:55 PM
[SOLVED] VPS server possibly locked after adding non-adequate iptables rules warez74 Linux - Security 4 04-14-2013 12:13 PM
Set iptables rules from Kernel Module saurabhchokshi Programming 5 05-02-2009 12:10 AM
startup script to set up iptables rules doesn't run alexfittyfives Debian 2 06-01-2004 08:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration