How to setup a home network with Internet sharing on Linux - Ubuntu/Fedora using Network Manager
Have you ever been in a situation where you are boasting about Linux in front of all your windower friends and then after getting bored of your long lecture someone asks you to shut up and create a network with shared Internet so that they can work on their sucky systems(according to you) atleast then, leaving you staring at the roof wondering, "how the hell is this done"?
. If yes, then here is a solution. Next time(if you get any), don't forget to throw it on their faces - how easily and quickly could it be done on Linux.
Most people, even many linuxers, think that managing networks on Linux is like walking on a bed of nails. You need to have good linux networking and command skills. That's because they are not aware of the fact that the network manager makes it tremendously easy for a regular user, with minimal knowledge, to handle various such networks.
Scenario
- You are connected to Internet through a wired network
- You want to create a wireless home network with Internet sharing
Solution to setup Internet sharing on Linux
Just follow the steps below:
- Right click on the network manager and click "Edit connections"
- Since, we are going to create a wireless network, go to the wireless tab and click Add.
- Write the name of the wireless network. Please note that this is the connection name(for you), not the name by which your WLAN will appear. Fill the ssid. This will be the WLAN's name(the name which will appear on other systems) and set the mode to AdHoc. Select connect automatically, if you want this network to be up everytime you switch on wireless network. Leave the other settings as it is.
- Now, move to the wireless security tab and select the one you want. If its just a small home network (temporary) then there is no harm in using no security. But you are always recommended to use WPA type encryption, WEP can be easily broken.
- Now, move to the "IPv4 setting" tab and set the mode to "Shared to other computers".
Now, hit apply and it should be automatically connected. If not, then left click on the network manager applet and click "connect to a hidden wireless network". Select your network from the list and it should connect now.
That's it. Now, try connecting other computers to this network and they should be able to access internet through this network.


































10 Comments
Are you able to connect properly, i.e. do you get an IP for your wireless interface? Check it by running "ifconfig <your_wirelessinterface>" e.g. ifconfig wlan0. Try running "ping google.com". Do you see any replies?
Hi Chris. The IP for 2nd computer shouldn't be 10.42.43.1(this is computer 1's IP). The first 3 parts of the IP(10.42.43) should be common to both (because it signifies the network) and the 4th part defining the uniqueness should be something other than 1 for 2nd computer, anything from 2 to 254.
If you are getting the expected IP on 2nd computer, could you check if you don't have any firewall configured on 1, which is stopping the connection. Try turning the firewall off or if you don't use any specific firewall config then run "sudo iptables --flush". Bring the network on computer 1 up, connect 2 to 1 and then check if the problem still exists.
Hi Chris. Good to see that it worked. I am pretty sure it was firestarter. Things should work without any trouble from now.
Post new comment