0

How to easily forward/redirect all network traffics through local socks port 1080? I did google this before asking question. I found this link and this link and others too. But there is no simple solution. (The system preferences network proxy setup just don't work for all apps. ) Is that so hard to do it? I think just some iptables rules should do it. (although I don't know what is the equivalent iptables command in macos, maybe pfctl?). Can anyone show me some simple shell scripts which can achieve this? Thank you very much.

  • This sounds like an XY Problem. Consider editing your question to describe the initial issue that is causing you to look for this particular solution. – Allan Sep 12 '18 at 15:17
  • @Allan this is not an XY Problem to me. I just want to redirect all network traffics through local socks proxy port 1080. That is my problem and I don't know how to achieve it. Thanks. – sgon00 Sep 13 '18 at 2:16
1

Since nobody posts a shell script (or easy way) to solve my question, I posted my current workaround solution:

  1. Install virtualbox
  2. Install openwrt as the guest OS to virtualbox
  3. Configure the openwrt to become a router which has the lan IP of 192.168.56.2. The lan interface is a Host-only adapter. The wan interface is Bridged adapter.
  4. Configure the openwrt router to do the transparent proxy job that I want.
  5. Change both gateway and DNS to 192.168.56.2 in the host.
    • to change the gateway: sudo route change default 192.168.56.2
    • to change the DNS: must use the UI way. System Preferences --> Network --> Adavanced --> DNS

That's all. So far so good.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .