There are a few wireless driver supports Master mode (infrastructure mode or AP mode), you can manage these interface with iw tools and provide network services for others, just like a wireless router do.
However, many of cards does not support this feature. But you still can use iwconfig to switch to ad-hoc mode, which most of cards support. With ad-hoc mode, the others can directly communicate with you when both agree on the same network name (SSID) and channel.
So, with properly setup, you can create a local wireless network for nearby nodes, or even share your network with others. What I am interested about it’s to share the network with others.
Actually, the modern linux distribution with Network Manager installed has already supported this kind of feature. It’s very easy to setup in Network Manager.
Basically, you just need to setup a ad-hoc network manually, and enable it when you are connected with ethernet or 3g network.
A quick tutorial –
Edit a network, left click the network-manager icon, and select Edit Connections, select Wireless and click on “Add” network.
In the connection editing window, change Mode to Ad-Hoc, and set the SSID you prefer to use.
Switch to IPv4 Settings tab of tab, and change method to “Shared to other computers”. Save the configs.
After you connect to the wan (like pppoe or 3g network), you need to create the ad-hoc network manually.
Left click the network-manager icon, and click on “Create New Wireless Network”.
Just select the connection profile we setup in the previous step, and click Create. That’s it. The network manager will setup your wireless interface and dnsmasq for you.
If you are not using Network Manager, here is my little script to setup an Ad-Hoc network. Use it at your own risk. This is a tips.