I have Ubuntu installed on my notebook computer(from now onwards, I will call it host computer in this post) which has a wired ethernet connection to a broadband internet service provider. I want to have a WiFi network broadcast in my room using my host computer so that any other notebook(guest) or smart phone with WiFi capability in the vicinity can connect to the broadband internet with host notebook working as a gateway.
I had this problem from long ago since I wanted my broadband to be shared on my Sony Ericsson P1i. and I searched whole of the internet to find a solution but none actually worked.
Today after some fiddling I finally made my P1i to hook to the broadband with Ubuntu notebook working as a gateway.
This tutorial I am presenting has been tested on Ubuntu 10.04 Lucid Lynx and works perfectly fine. I can't guarantee it to work on earlier distributions because I myself had seen funny characters in WiFi network search list in P1i on 9.10 Karmic Koala and it never worked for me.
So, lets proceed.
1. Turn on your notebook's WiFi if there's a dedicated switch to turn it on. On my Fujitsu Siemens Amilo Si 3655 notebook, WiFi can be turned on using Fn+F1 key combination.
2. Click on the Network Manager icon(which looks like ) in the notification area and click Create New Wireless Network...
3. In the dialog box that pops up, put the network name as anything(I put WLAN). Set Wireles Security as WEP 40/128-bit key. In the Key box, enter any five digit number(I entered 31323). Click Create.
4. Now right click on the Network Manager icon and click Edit Connections... In the Network Connections dialog box that pops up, go to the Wireless tab. Click WLAN(or the network name you had provided) and click Edit.
5. In the Edit WLAN dialog box that opens up, set the Mode as Ad-hoc. Make sure the Connect Automatically checkbox is checked and in the IPv4 Settings tab, and Method is set to Shared to other computers. Now click Apply.
Your network is ready!!! Congrats!!! But thats only 50 percent of the hurdle complete. You might have reached this far several times using other tutorials and how tos available on the net. Lets proceed through to get the configuration details for the client pc/notebook/smart phone.
6. Open a terminal(for eg. by pressing Alt+F2 then typing xterm and pressing enter). In the terminal type ifconfig and press enter. Scroll down tothe place where wlan0 is written. Beside that, in the second line you will see three things viz. inet addr, Bcast and Mask. Note these things somewhere safely. In my case inet addr is 10.42.43.1 and Mask is 255.255.255.0. No need to note Bcast.
7. Use the following manual configuration details for the client system:
IPv4 Addr: 10.42.43.2(for a yet another machine use 10.42.43.3 and so on...)
Subnet Mask: 255.255.255.0
DNS Address1: 126.96.36.199
DNS Address2: 188.8.131.52
After doing all this above you may notice that the client computer connects to net successfully but the host computer isn't able to access any website. Thats because the network manager blanks the DNS records set in /etc/resolv.conf
To solve this, type
sudo gedit /etc/resolv.conf
in any terminal and there append
and save the file. Afterwards you will be able to surf the web on gateway computer as well, normally.
You may notice that the network manager blanks out /etc/resolv.conf every now and then and you've to manually edit it and add nameservers. This is a very common problem faced by GNOME users. To get rid of this just type the following command in terminal and press enter.
chattr +i /etc/resolv.conf
Now I am going to explain how did I connect my P1i to this network to use the broadband internet.
1. Turn on Wireless LAN
2. Touch Scan for scanning for new networks You will see the newly created network WLAN listed there with a lock icon.
3. Now go to Internet Accounts by tapping More in the WLAN page and tapping Internet Accounts.
4. There tap More>New account>WLAN
5. Fill in the details as shown in the screenshot and create the connection.
6. Now in the Internet Accounts tab highlight WLAN and tap Edit, then tap More>TCP/IP>IP Config and fill in the details as shown in the screenshot. Similarly fill in the details for the DNS address. Press Done and come back to Wireless LAN. There scan for networks. You will notice a yellow star beside th network name WLAN. Hit the Connect button after highlighting WLAN.