Routing all internet traffic through a proxy
Can anyone assist me to route all internet traffic trough a specific proxy (192.168.0.1).
Thanks, |
that's not possible. routing is *not* proxying... it just doesn't make sense... if by "internet traffic" you actually mean web http traffic then you could use a transparent proxy redirecting port 80, but that's absolutely not a case of routing through a proxy.
http://www.faqs.org/docs/Linux-mini/...rentProxy.html |
youre right i just want to forward all internet based requests to a proxy since i cant make direct connections to the internet.
|
is this the only way to redirect internet traffic to the internet?
|
192.168.0.1 is a private IP that is used by many local area networks. If you're connected to a router, and the address of the router is 192.168.0.1, the router itself should give all the machines connected to it an IP address by DHCP. The router automatically routes traffic to and from the Internet if there is a modem plugged into it, and the Internet connection is active.
|
What???? im not talking about a router. i need to redirect all traffic through a proxy. 192.168.0.1 is the address of the proxy
|
I suggest you go to wikipedia and read up on the words router and proxy,
then find out what 192.168.0.1 *really* is, and then come back with a well-formed and thought-through question .... Cheers, Tink |
all traffic != proxy.
|
Tink,
Thanks but i dont need the re-education. I simply cannot make a direct connection to the internet and need to use a proxy for all traffic destined to the internet. So, again how do you do this in linux (debain). In my example 192.168.0.1 is the IP address of the proxy. |
So, again you can NOT send "all traffic destined to the internet" through a proxy. that would include, ssh, ntp, imap, smtp, icmp and all sorts of stuff that goes on. I've already given you a reference to setting up a transparent web proxy filter, which will allow http and https traffic to go through a proxy, but you've said nothing whatsoever about your infrastructure, so i've no idea if it's the right thing to do or not. you've not even mentioned Linux at all...
|
ok let me try again,
I have a machine that needs to use the internet for getting various things: rss feeds(http), http, https,etc ---mostly web traffic i am using an app on my linux box called e107 for my web site. This site needs internet access for various things and since i dont have a direct connection nothing works. I also have debain and like to use apt-get. So i would like to pass everything through the proxy (http, ftp, https). I understand that some protocols will not work through the proxy (ssh, snmp, etc). On top of this i would also like to specify a specific user-agent that needs to be used to use the proxy. Does that make sense? |
Quote:
You apparently fail to distinguish between "ALL TRAFFIC" and "ALL WEB-TRAFFIC", which makes all the difference on this. The big deal will be whether name-resolution is going to magically work, and whether that proxy (OS, Software, ... ?) will be happy to let you through. Also depends on the application you're intending to use, and whether it's proxy aware or not. If it's just after a direct route and has no knowledge of proxies, and you're not in charge of the gateway machine, you're screwed. Quote:
What do you mean by user-agent in this context? Cheers, Tink |
look up user-agent string. Yes i could reconfigure the proxy but thats not the case. i need to leave the proxy as it is a use a predefined user agent. I think i might just have to tunnel my traffic to another machine that has a direct internet connection. I think that might be the only way to complete this task.
BTW, my DNS works so there is no resolve problem. The proxies also have DNS capabilities. |
Guys, i figured out how to direct all traffic through a proxy. This is probably not the only way but a way that i found useful. This is setting up a proxy setting in your environment variables.
First type env to see your environment. After this is complete you will need to type in export http_proxy=http://192.168.0.1:9021 or whatever ip and port you are using. If anyone finds other ways please let me know. I would also like to know how to spoof a user agent if anyone knows. |
yet again that is *NOT* all traffic by a long long way.... that is HTTP traffic only.
|
acid_kewpie, youre right i just keep writing these posts too fast.
BTW, do you know a way to set the global environment so everything uses this? So far i have edited the following with no luck: /etc/profile /etc/environment I have an apache server that has rss fees setup and it needs to get those pages (http traffic). I have read other posts with no effective answers on implementing global environments so everyone will use it (www-data). Again sorry for the all traffic |
Quote:
Code:
HTTP_PROXY="hostname:port" httpd Luckily you should be able to load mod_proxy.so and maybe a few other modules (mod_proxy_http.so?) and set up proxy directives in httpd.conf. Check apache's documentation for this. |
Quote:
In terms that might be more understood: I have a computer with 2 NIC's I have dhcpd and a switch... I want all traffic passing through this computer to be 'proxified' whether it's via tor, via vpn, or w/e, I want the traffic to not originate from my ISP. How do I do this transparently with no configuration on the client side? |
Quote:
|
This post is the first or second hit in google for questions like this so it might be nice to have it answered here rather than in another post...
http://www.google.com/search?q=route...hrough+a+proxy |
Discouraged
As a person of authority within the UNIX / linux community, I believe it is moderator responsibility to help those with a lesser understanding of the subject than themselves. I was surprised in reading this form, I found the responses to be more degrading than educational. We need to get over our superiority complex, individual knowledge may vary and not everyone will be as educated as yourself. It is our responsibility as members of the UNIX / linux community to help educate those around us. Such behavior is counter-productive to those who wish to further their understanding.
|
Here's the answer :
https://samtinkers.wordpress.com/my-glossary-of-useful-commands/
sudo route add -net <network-address-to-bypass:172.22.0.0> netmask <as per netwok address : 255.255.0.0> gw <router/gateway-address :10.0.0.1> – to edit iptables to let packets addressed to a certain network go through the normal gateway, (useful for VPN where all traffic is routed through an external gateway) hey, here's an answer. I used to use this in my college time. Basically the gateway is where you enter the local IP of the thing you wanna direct your traffic to. If you have a basic knowledge of networks, you'd figure out the first two parts. That's for directing only a part of your traffic through a gateway. In order to direct ALL the traffic : sudo route add default gw 192.168.0.1 |
Clarification
Quote:
Quote:
This means a proxy can be used for *any* traffic you like. What the quoted person (and probably also the thread poster) was likely referring to is an under-category of a proxy: A HTTP(s) or SOCKS Proxy which indeed is only meant for specific HTTP traffic. I know this post is 15 years old but I could not resist clarifying this, as this is still the first result appearing if someone searches "linux proxy route all traffic". |
Here's something else acid_kewpie wrote - 11 years ago:
Quote:
|
Quote:
|
All times are GMT -5. The time now is 10:23 PM. |