The latest version is 1.2 transproxy-1.2.tgz.
to install the binary and man page.
# make install
tproxy81/tcp# Transparent Proxy
tproxystream tcp nowaitnobody /usr/sbin/tcpd/usr/local/sbin/tproxy proxy.yourdomain 8080
This tells inetd to accept requests on port 81, and the transparent proxy server to pass these on to the host 'proxy' at port 8080.
# Converted by inetdconvert
service tproxy
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/local/sbin/tproxy
server_args = proxy.yourdomain 8080
}
Example when a httpd is running on port 80.
# cd /usr/src/linux
# make menuconfig
If no httpd is running on the local network you may want to reject connections quickly instead of accepting them.
# ipchains -A input -p tcp -d localhost 80 -j ACCEPT
# ipchains -A input -p tcp -d 192.168.1.0/24 80 -j ACCEPT
# ipchains -A input -p tcp -d 202.144.157.208/28 80 -j ACCEPT
# ipchains -A input -p tcp -d 0.0.0.0/0 80 -j REDIRECT 81
These rules allow port 80 requests direct at the local network to pass (or get rejected). Then any requests to the outside world get redirected to port 81 and hence get handled by the transparent proxy.
# ipchains -A input -p tcp -d localhost 80 -j REJECT
# ipchains -A input -p tcp -d 192.168.1.0/24 80 -j REJECT
# ipchains -A input -p tcp -d 202.144.157.208/28 80 -j REJECT
# ipchains -A input -p tcp -d 0.0.0.0/0 80 -j REDIRECT 81
Copyright © [- SroNey / JohN -]. All rights reserved