what is the best way to configure Ubuntu to use a SOCKS5 proxy for all network traffic? Server is ubuntu server. I want to push all outbound traffic through the proxy (apt-get, http, https, etc). Everything but ssh should hit the proxy server.
Configuring Ubuntu for Global SOCKS5 proxy
linux-networkingPROXYtransparent-proxyubuntu-10.04
Best Answer
Each command has its own configuration parameters and/or configuration files to use proxy servers. For example,
w3m
recognizes theHTTP_PROXY
environment variable and uses it as a proxy if defined.wget
also has options related to proxy settings.apt-get
can be configured also to use a proxy server (or better apt-cacher to cache your downloaded packages for future installs/upgrades).At the very least, you can use
iptables
to redirect all you outgoing traffic to a specific proxy.Adding a rules such as the above is enough to transparently redirect all outgoing traffic to your proxy server. Of course, you can customize the rule according to your needs like forwarding other ports.