Internet Connection Sharing Over Wifi With Fedora
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
- 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
- Network Manager
- dnsmasq
Doing the Work
- Install dnsmasq.
su -c "yum install dnsmasq"
and enter your root password when prompted
- Right click the NetworkManager icon in the top right corner of the desktop and make sure both "Enable Networking" and "Enable Wireless" are checked.
- 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)


4. Click apply and close the window.
5. Now connect your client machines to the newly created ad-hoc network.
Troubleshooting
How to test
- 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.
- 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
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
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 dnsmasqSometimes, 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 wlan0if 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

