I have been searching for Ubuntu for a long time and cannot find a software that can use wireless network cards as AP. I tried many methods on the Internet and found some hot spots, however, when my Android phone is connected, the ip address cannot be obtained. After studying for a few days, I spent one night last night writing a script and successfully connected it. I hope this script can help you solve the problem.
The iwconfig Wireless Configuration tool is used to set NAT rules using iptable and assign IP addresses using dnsmasq.
Complete script:Https://gist.github.com/1117004
The following describes how to use the script:
# Add the executable permission first. XXX indicates the script path.
Chmod + x/XXX/adhoc
# Run the script
Sudo/XXX/adhoc
# Stop sharing
Sudo/XXX/adhoc-s
# Restarting sharing
Sudo/XXX/adhoc-r
Note:
If you cannot find your shares on your phone or computer after running the script, run the restart sharing command.
Sudo/XXX/adhoc-r
You can do it several times.
Update: According to Aenon prompts, the simpler method is to directly use NetworkManager and "Create a new wireless network ".
Original article: http://wowubuntu.com/ad-hoc.html