Make all IPv6 ips on system to be used as a proxy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Make all IPv6 ips on system to be used as a proxy

xpro6000
I have multiple IPs on my Linux system and I need one of my programs to be able to choose which IP to use. One way to achieve this is to use a proxy server. But with Squid's default config file, the IP I connect to, is not the IP used for the outgoing connection. 

Is there anything I can do to enable Squid to use the same incoming IP for the outgoing IP?

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Aaron Turner
If you don't need a proxy server for other reasons, there are better
ways.  Example, per-process routing:

http://www.evolware.org/?p=369

Or if you have control over the source code of the software,
setsockopt() will do it for you as well.
--
Aaron Turner
https://synfin.net/         Twitter: @synfinatic
My father once told me that respect for the truth comes close to being
the basis for all morality.  "Something cannot emerge from nothing,"
he said.  This is profound thinking if you understand how unstable
"the truth" can be.  -- Frank Herbert, Dune


On Fri, Sep 29, 2017 at 2:01 PM, xpro6000 <[hidden email]> wrote:

> I have multiple IPs on my Linux system and I need one of my programs to be
> able to choose which IP to use. One way to achieve this is to use a proxy
> server. But with Squid's default config file, the IP I connect to, is not
> the IP used for the outgoing connection.
>
> Is there anything I can do to enable Squid to use the same incoming IP for
> the outgoing IP?
>
> _______________________________________________
> squid-users mailing list
> [hidden email]
> http://lists.squid-cache.org/listinfo/squid-users
>
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

xpro6000
The program is multithreaded so the process based routing won't work. There is no simple way to make Squid use the connecting IP for the outgoing IP?

On Fri, Sep 29, 2017 at 6:37 PM, Aaron Turner <[hidden email]> wrote:
If you don't need a proxy server for other reasons, there are better
ways.  Example, per-process routing:

http://www.evolware.org/?p=369

Or if you have control over the source code of the software,
setsockopt() will do it for you as well.
--
Aaron Turner
https://synfin.net/         Twitter: @synfinatic
My father once told me that respect for the truth comes close to being
the basis for all morality.  "Something cannot emerge from nothing,"
he said.  This is profound thinking if you understand how unstable
"the truth" can be.  -- Frank Herbert, Dune


On Fri, Sep 29, 2017 at 2:01 PM, xpro6000 <[hidden email]> wrote:
> I have multiple IPs on my Linux system and I need one of my programs to be
> able to choose which IP to use. One way to achieve this is to use a proxy
> server. But with Squid's default config file, the IP I connect to, is not
> the IP used for the outgoing connection.
>
> Is there anything I can do to enable Squid to use the same incoming IP for
> the outgoing IP?
>
> _______________________________________________
> squid-users mailing list
> [hidden email]
> http://lists.squid-cache.org/listinfo/squid-users
>


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Aaron Turner
Run multiple instances of squid, one per IP address?  I'm not aware of
some magic config option to do what you want.

Seriously though, using a proxy to control your outgoing IP address is
weird.    Use setsockopt(SO_BINDTODEVICE) in your code.
--
Aaron Turner
https://synfin.net/         Twitter: @synfinatic
My father once told me that respect for the truth comes close to being
the basis for all morality.  "Something cannot emerge from nothing,"
he said.  This is profound thinking if you understand how unstable
"the truth" can be.  -- Frank Herbert, Dune


On Fri, Sep 29, 2017 at 5:13 PM, xpro6000 <[hidden email]> wrote:

> The program is multithreaded so the process based routing won't work. There
> is no simple way to make Squid use the connecting IP for the outgoing IP?
>
> On Fri, Sep 29, 2017 at 6:37 PM, Aaron Turner <[hidden email]> wrote:
>>
>> If you don't need a proxy server for other reasons, there are better
>> ways.  Example, per-process routing:
>>
>> http://www.evolware.org/?p=369
>>
>> Or if you have control over the source code of the software,
>> setsockopt() will do it for you as well.
>> --
>> Aaron Turner
>> https://synfin.net/         Twitter: @synfinatic
>> My father once told me that respect for the truth comes close to being
>> the basis for all morality.  "Something cannot emerge from nothing,"
>> he said.  This is profound thinking if you understand how unstable
>> "the truth" can be.  -- Frank Herbert, Dune
>>
>>
>> On Fri, Sep 29, 2017 at 2:01 PM, xpro6000 <[hidden email]> wrote:
>> > I have multiple IPs on my Linux system and I need one of my programs to
>> > be
>> > able to choose which IP to use. One way to achieve this is to use a
>> > proxy
>> > server. But with Squid's default config file, the IP I connect to, is
>> > not
>> > the IP used for the outgoing connection.
>> >
>> > Is there anything I can do to enable Squid to use the same incoming IP
>> > for
>> > the outgoing IP?
>> >
>> > _______________________________________________
>> > squid-users mailing list
>> > [hidden email]
>> > http://lists.squid-cache.org/listinfo/squid-users
>> >
>
>
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Eliezer Croitoru
In reply to this post by xpro6000
Anyone mentioned tproxy?
It works for me...

Eliezer

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]


From: squid-users [mailto:[hidden email]] On Behalf Of xpro6000
Sent: Saturday, September 30, 2017 00:02
To: [hidden email]
Subject: [squid-users] Make all IPv6 ips on system to be used as a proxy

I have multiple IPs on my Linux system and I need one of my programs to be able to choose which IP to use. One way to achieve this is to use a proxy server. But with Squid's default config file, the IP I connect to, is not the IP used for the outgoing connection.

Is there anything I can do to enable Squid to use the same incoming IP for the outgoing IP?

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Amos Jeffries
Administrator
On 01/10/17 10:21, Eliezer Croitoru wrote:
> Anyone mentioned tproxy?
> It works for me...
>

It serves if none wants the same IP on both incoming and outgoing
traffic. But the question was only for determining static IPs on
outgoing based on Squids listening *ports*, ignoring client IP - more
like a NAT attempt than transparent proxy.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Eliezer Croitoru
Then he doesn't need Squid but a customized proxy for ipv6 and ipv4..
Right?

Eliezer

----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]



-----Original Message-----
From: squid-users [mailto:[hidden email]] On Behalf Of Amos Jeffries
Sent: Sunday, October 1, 2017 06:44
To: [hidden email]
Subject: Re: [squid-users] Make all IPv6 ips on system to be used as a proxy

On 01/10/17 10:21, Eliezer Croitoru wrote:
> Anyone mentioned tproxy?
> It works for me...
>

It serves if none wants the same IP on both incoming and outgoing
traffic. But the question was only for determining static IPs on
outgoing based on Squids listening *ports*, ignoring client IP - more
like a NAT attempt than transparent proxy.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

xpro6000
In reply to this post by Eliezer Croitoru
I did some research on tproxy, this is pretty much the Linux firewall right? There is not much documentation about it online

On Sat, Sep 30, 2017 at 5:21 PM, Eliezer Croitoru <[hidden email]> wrote:
Anyone mentioned tproxy?
It works for me...

Eliezer

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: <a href="tel:%2B972-5-28704261" value="+972528704261">+972-5-28704261
Email: [hidden email]


From: squid-users [mailto:[hidden email]] On Behalf Of xpro6000
Sent: Saturday, September 30, 2017 00:02
To: [hidden email]
Subject: [squid-users] Make all IPv6 ips on system to be used as a proxy

I have multiple IPs on my Linux system and I need one of my programs to be able to choose which IP to use. One way to achieve this is to use a proxy server. But with Squid's default config file, the IP I connect to, is not the IP used for the outgoing connection.

Is there anything I can do to enable Squid to use the same incoming IP for the outgoing IP?



_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Amos Jeffries
Administrator
On 02/10/17 18:03, xpro6000 wrote:
> I did some research on tproxy, this is pretty much the Linux firewall
> right? There is not much documentation about it online
>

No, netfilter/iptables is the Linux firewall.

TPROXY is a feature of the Linux TCP stack. BSD stacks have a different
name for it, but very similar behaviour.

The docs as relate to Squid can be found here:
<https://wiki.squid-cache.org/Features/Tproxy4>

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: Make all IPv6 ips on system to be used as a proxy

Eliezer Croitoru
In reply to this post by xpro6000
Hey,

Give try to give me some specs on what you need(maybe In pm) and I will see if I might sketch you a tiny NAT proxy.
Take a peek at:
https://github.com/LiamHaworth/go-tproxy

It's a very nice library which you might be able to use.

Eliezer

* There are more then one vendor out there which modified the kernel TCP stack and the TPROXY feature to make it 100% transparent which is similar to NAT.

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]


From: [hidden email] [mailto:[hidden email]] On Behalf Of xpro6000
Sent: Monday, October 2, 2017 08:04
To: Eliezer Croitoru <[hidden email]>
Cc: [hidden email]
Subject: Re: [squid-users] Make all IPv6 ips on system to be used as a proxy

I did some research on tproxy, this is pretty much the Linux firewall right? There is not much documentation about it online

On Sat, Sep 30, 2017 at 5:21 PM, Eliezer Croitoru <mailto:[hidden email]> wrote:
Anyone mentioned tproxy?
It works for me...

Eliezer

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: tel:%2B972-5-28704261
Email: mailto:[hidden email]


From: squid-users [mailto:mailto:[hidden email]] On Behalf Of xpro6000
Sent: Saturday, September 30, 2017 00:02
To: mailto:[hidden email]
Subject: [squid-users] Make all IPv6 ips on system to be used as a proxy

I have multiple IPs on my Linux system and I need one of my programs to be able to choose which IP to use. One way to achieve this is to use a proxy server. But with Squid's default config file, the IP I connect to, is not the IP used for the outgoing connection.

Is there anything I can do to enable Squid to use the same incoming IP for the outgoing IP?


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users