Use ad-hoc for Wifi sharing in Linux

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.