Search code examples
http-redirectsshremote-accessfreebsdnetwork-traffic

All traffic forwarding using SSH tunnel in FreeBSD


I connect to my remote VPS like that:

ssh -f -C2qTnN -D 1080 username@xxx.xxx.xxx.xxx

Then setup Firefox proxy setting to SOCKS5 and 127.0.0.1:1080. That's work.

Now I try to redirect all traffic from my FreeBSD to localhost:1080, but I have no idea. Can you help?


Solution

  • If you want to redirect all traffic, do not use SOCKS5 proxy, but rather use -w option in ssh, which creates something like VPN connection and its own TUN device, which is more suitable for tunnelling system-wide traffic.

    There are many examples on the internet, for example here. But this is really advanced use case.