Routing in 2 seconds

Route the network for everybody when you are the only one to have the wireless connection.

# aptitude install ipmasq dnsmasq

/etc/network/interfaces

eth1 here is for the interface of the dhcp server. Wireless is on an other interface.

auto eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0

/etc/dnsmasq

Uncomment the following line in /etc/dnsmasq

# Uncomment this to enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
# a lease time. If you have more than one network, you will need to
# repeat this for each network on which you want to supply DHCP
# service.
#dhcp-range=192.168.0.50,192.168.0.150,12h

(watch that the network address (192.168.0.) is the same as the eth1 one)

and restart dnsmasq

# invoke-rc.d dnsmasq restart

and that's it.

Later

Never forget that you have ipmasq installed. If you encounter

sendmsg: Operation not permitted

then

# invoke-rc.d networking restart

Do not forget either that you have a dhcp server running when you connect randomly to other networks.