Ubuntu – How to share a wireless Internet connection as a wireless hotspot

internetnetworking

Without going into details, the machine I use connects to a wireless network to get Internet access. Other devices aren't allowed on this network. Also, I do not have administrator access.

I can already run a wireless hotspot using NetworkManager, and switch to my Internet connection and back, but I can't do the two at the same time.

I want to create a wireless hotspot simultaneously with my wireless Internet connection (single adapter). I'm pretty sure this is possible, since I have a Qualcomm/Atheros card.

I'm very familiar with Linux commands so I have no problem getting directions involving use of iptables, route, etc.

Best Answer

Iptables and manual routing aren't necessary when using Ubuntu's provided defaults.

You would need two Network Interface Adapters to provide a Hotspot via Ubuntu.

NIC #1

This will be used for your connection to the internet. While both NICs could be wireless, this NIC (the connection NIC) is usually a wired NIC. For your particular case, I used a wireless NIC for testing these steps.

NIC#2

The second NIC (in the case of your question details, a Wireless adapter) will be used for configuring as a Hotspot to share the connection (the Hotspot NIC).

Configuring one NIC won't affect the other.

You can setup your Ubuntu Hotspot connection using three parts:

  • Part 1: Create the Hotspot network
  • Part 2: Edit/Configure the Hotspot network
  • Part 3: Start the Hotspot service

Create the Hotspot Network

-> (From the System Settings menu (click) Network)
-> (Select the desired Wireless Device) -> (click) Use as Hotspot
-> (The Hotspot is Network is created) -> (Click the ON/OFF button to turn it off)
-> (Exit the Network Window)

Edit/Configure the new Hotspot network

-> (From the Connection Icon of the Ubuntu Top Panel click) Edit Connection
-> (Select the new Hotspot connection that has been created) -> (click) Edit
-> (fillin Connection name) My Hotspot (the name can be any name including spaces
-> (fillin SSID) My Hotspot (This is what appears in the hotspot connections)
-> (Mode: select) Hotspot
-> (Device: select the NIC #2... not the already NIC connected to the Internet)
-> (The other items can be left at default) -> (click the tab) WiFi Security
-> (From the drop-down slect and fillin the preferred access code type)
-> (click) Save -> (click) Save

(Important:
To make changes to the Hotspot configuration, the Hotspot has to be turned off first in Part 1
)

Activate the Hotspot

-> (Go back to the Network icon in the top panel)
-> (click) Create New Wi-Fi Network
-> (Wi-Fi Adapter: Select the desired Wi-Fi adapter (the NIC #2)
-> (Connection: Select the Network Name you configured in part 2 above.
-> (click) Create

Your new network will now show availability in the list of wireless networks. These connections are handled by your Hotspot and are invisible to your original provider. I tested the steps on an internet Hotspot that has a web interface for the computer connection. The Ubuntu Hotspot provides access without having to connect to the Web interface.

To turn off your Ubuntu Hotspot perform Part 1... click the ON/OFF button to OFF

Related Question