Ubuntu – Create Wifi Hotspot for sharing SOCKS Proxy on Ubuntu Server

networkingPROXYsocksUbuntuwifi-hotspot

I'm using Ubuntu Server and I have a SOCKS Proxy server on my client which is created with ssh -D command.
I want to create a Wifi Hotspot on this computer which passes the traffic through this SOCKS Proxy. I'm connected to Internet through ethernet, so Wifi is idle.

Is this possible? How can I achieve this?

Best Answer

TCP traffic from the hotspot can be passed through the ssh -D socks proxy using redsocks. With redsocks installed and configured one can use iptables to redirect all traffic from the wifi hotspot to redsocks which then passes it through the socks proxy.

For instance if your wifi hotspot is on the 10.42.0.1/24 subnet and the incoming redsocks port is 12345 issue:

sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t nat -A PREROUTING -s 10.42.0.0/24 -p tcp -j REDIRECT --to-ports 12345

For a detailed set of instructions visit http://abidmujtaba.blogspot.com/2016/07/ubuntu-create-wifi-hotspot-access-point.html

Related Question