I know I can use ap-hotspot to configure a wifi hotspot in normal connection. But what is I'm connected to internet via a socks proxy? How can I share internet to my mobile devices then?

1 Answer 1


The ap-hotspot solution is slightly out of date and has the added disadvantages of being complicated and incompatible with socks proxies. A simpler solution is to use ubuntu's built in network-manager to create the hotspot as detailed by http://ubuntuhandbook.org/index.php/2014/09/3-ways-create-wifi-hotspot-ubuntu/

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 subnet and the incoming redsocks port is 12345 issue:

sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t nat -A PREROUTING -s -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

  • How do I know the subnet range of my wifi hotspot?
    – becko
    Jan 4, 2019 at 16:41
  • ip addr show dev <interface> will have an inet field giving you the address and subnet. For interface wlo1 running this command on my computer gives inet so I would use in my iptables command. Jan 5, 2019 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.