Personal tools
You are here: Home Team Members Dave Riches Internet Connection Sharing Over Wifi With Fedora

Internet Connection Sharing Over Wifi With Fedora

by Dave Riches last modified May 20, 2010 11:34 AM
— filed under: ,

Sometimes it is desirable to share the internet connection of one pc with the other pc's on your network, Fedora 12 not only makes it easy to share your internet connection - but to share it over wifi by creating an AdHoc network.

Applicable to Fedora Versions

  • Fedora 12
  • Fedora 13

Requirements


  1. Two network cards, in this example - one facing the internet and a WLAN card for creating the ad-hoc network. In this article the internet facing ethernet will be called eth0 and the client facing WLAN card will be called wlan0
  2. Network Manager
  3. dnsmasq

Doing the Work

 

  1. Install dnsmasq.
    su -c "yum install dnsmasq"
    and enter your root password when prompted
  2. Right click the NetworkManager icon in the top right corner of the desktop and make sure both "Enable Networking" and "Enable Wireless" are checked.
  3. Left click the NetworkManager icon in the top right corner and select "Create New Wireless Network". Choose a network name, security protocol and key (where appropriate)
Create Wireless Network
   
     3. Next, right click the NetworkManager icon again, and this time select "Edit Connections...", select the Wireless Tab and Edit the Ad-Hoc network you just created. Click the IPv4 settings tab:
 
IP4 Settings
 
Make sure the method is set to "Shared To Other Computers"
 
This is an important step, because the interface that you are sharing to other computers is actually the interface you will be distributing the internet via, it is a common mistake to share eth0.
 

    4. Click apply and close the window.

    5. Now connect your client machines to the newly created ad-hoc network.

 

Troubleshooting

How to test


  1. Ensure that once your client computers are connected, that you can ping them from the gateway machine. In this example, we will assume the client machine has the ip address 192.168.1.100.
  2. ping 192.168.1.100

    If successful, you should get replies from the client machine:

    PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.

    64 bytes from 192.168.1.100: icmp_seq=1 ttl=64 time=4.70 ms

    64 bytes from 192.168.1.100: icmp_seq=2 ttl=64 time=1.92 ms

    64 bytes from 192.168.1.100: icmp_seq=3 ttl=64 time=1.25 ms

  3. From the client machine you should be able to ping both the gateway and the internet, in this example we will assume the gateway has an ip of 192.168.1.1
  4. ping 192.168.1.1
    ping www.google.co.uk

    Both examples should return ping replies.

Common problems and fixes

Usually, the gateway and dns configuration is incorrect on the client machines. In this case, dnsmasq may not be running, you may want to check..

ps aux | grep dnsmasq
Sometimes, Network Manager is unable to set the wlan card's mode to Ad-Hoc due to firmware/driver issues. This can be seen by running:
iwconfig wlan0
if the result still shows Mode:Managed , you may need to download additional kernel modules/firmwares.

More Information

Disclaimer

We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #fedora on irc.freenode.net

Added Reading

Document Actions
Log in


Forgot your password?
New user?