Monday, August 15, 2011

Wireless sharing with Plasma NM 0.9

During Desktop Summit in Berlin some people asked me how to make wireless sharing work. Connection sharing allows to use a computer as gateway for other computers, NM does that by routing all IP packages from one network interface to the default route of your computer (yes, that is a Masquerate configuration). For example, you can configure your notebook to access Internet through ethernet cable and create a wifi shared connection to allow other computers to access Internet using your notebook's default route. Your notebook will act like an access point.

Here are the steps I use with NM-0.9:
  1. Create an ad-hoc connection:
  2. Go to IPv4 tab and change the method to "shared":
  3. If you prefer you can also use WEP encrytion, just go to "Wireless Security" tab, fill in the hexadecimal key or passphrase and click Ok:

  4. Go to the main window, click on the connection, and wait a few seconds until it is activated:

Sometimes my connection does not activate and NetworkManager shows this warning in its log:

NetworkManager[25305]: Activation (wlan0/wireless): association took too long, failing activation.

rmmod'ing the wifi's kernel module and loading it again usually solves this problem for me.

To use WPA instead of WEP in shared connections NM must change wireless card mode to "master", which is only possible when using hostapd (AFAIK). Unfortunately NM does not support using hostapd yet, so it is also not possible to use WPA in shared connections.

People also asked me to simplify the steps to create shared connections. Well, I am open to suggestions. Adding a checkbox or combobox in connection edit dialog is not a good idea. We already have too many options there, I really do not want to add one more widget to do just the only two required configuration changes (in ethernet case it is just one change) to convert a normal connection to a shared connection.

No comments:

Post a Comment