Tag Info

New answers tagged

0

If you have no specific proxy defined, try this by default: webRequest.Proxy = WebRequest.DefaultWebProxy; webRequest.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;


1

The problem is when squid tries to connect to the web server (on port 8080) it's request is also redirected to itself. You must limit the scope of the REDIRECT rule (e.g. based on the incoming interface). If the outside interface on your server is eth0 change the rule like this: iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 8080 -j REDIRECT ...


0

Ok, answering my own question: Squid allows you to set the TOS on its outgoing packets. The setting is tcp_outgoing_tos . So, make an acl with the permitted IPs or domains and set, for example, tcp_outgoing_tos 0x10 whitelist The packets from other applications usually have TOS 0x0. Now follow the steps at squid's own tutorial ...


0

Why do you repeat all those filter criteria in the --mark 99 line? you mark a packet, that's it. If more criteria appear then you should change the marking but not check for more than the mark. BTW the chain name internet seems rather suboptimal to me. #!/bin/bash if iptables -L apache -n &>/dev/null; then iptables -t mangle -F apache else ...


0

I tried your answer. I added www1.caixa.gov.br besides caixa.gov.br because it was also showing on Squid log. Squid log: 1367165802.899 151455 192.168.1.1 TCP_MISS/503 4261 GET http://www.caixa.gov.br/ - DIRECT/www.caixa.gov.br text/html Result of iptables -t nat -L -nv on Tomato USB: Chain PREROUTING (policy ACCEPT 117 packets, 10457 bytes) pkts bytes ...


0

iptables -A ... puts the rule at the end of a chain. Thus your one never matches (or at least with no effect) because the second (-s ! $PROXY_SERVER) already got those packets / connections. Instead of iptables -A PREROUTING you need iptables -I PREROUTING 2. Or you create chains to make the structure easier to understand: #!/bin/bash ...


0

It looks like running $ socat tcp-listen:$port,fork,reuse tcp-connect:$db_host:$port on proxy box will do what you need. Add option "-v" to display/redirect/debug passing traffic. Socat is available in all major Linux distros, FreeBSD and also as Windows port. "man socat" will bring you some RTFMing for a whole evening about rich ability of this swiss army ...



Top 50 recent answers are included