5

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

3

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 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

2
  • How do I know the subnet range of my wifi hotspot?
    – a06e
    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 192.168.1.153/24 so I would use 192.168.1.0/24 in my iptables command. Jan 5, 2019 at 17:57

You must log in to answer this question.

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