个人工具

“UbuntuHelp:WifiDocs/NetworkManager”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(New page: {{From|https://help.ubuntu.com/community/WifiDocs/NetworkManager}} {{Languages|php5}} == Network Manager == Network Manager aims for Network Connectivity which "Just Works". The compute...)
 
第15行: 第15行:
 
==== Ubuntu 6.06 LTS (Dapper), Ubuntu 6.10 (Edgy), Ubuntu 7.04 (Feisty) ====
 
==== Ubuntu 6.06 LTS (Dapper), Ubuntu 6.10 (Edgy), Ubuntu 7.04 (Feisty) ====
  
1. Applications, Add/Remove Programs
+
# Applications, Add/Remove Programs
1. Find Network Manager in the Internet section
+
# Find Network Manager in the Internet section
1. Check the adjacent box to select Network Manager for installation
+
# Check the adjacent box to select Network Manager for installation
1. Click OK
+
# Click OK
1. Log out and back in again
+
# Log out and back in again
1. If you don't see the Network Manager icon you may need to add the Notification Area to your panel
+
# If you don't see the Network Manager icon you may need to add the Notification Area to your panel
  
 
===== Kubuntu 6.10 (Edgy) =====
 
===== Kubuntu 6.10 (Edgy) =====
第27行: 第27行:
 
==== Ubuntu 5.10 (Breezy) ====
 
==== Ubuntu 5.10 (Breezy) ====
  
1. Enable Universe (AddingRepositoriesHowto)
+
# Enable Universe (AddingRepositoriesHowto)
1. Install Network Manager and its dependencies by <code><nowiki>network-manager</nowiki></code>
+
# Install Network Manager and its dependencies by <code><nowiki>network-manager</nowiki></code>
1. Log out and back in again
+
# Log out and back in again
  
 
==== Configuring Devices ====
 
==== Configuring Devices ====

2007年5月13日 (日) 16:37的版本


Network Manager

Network Manager aims for Network Connectivity which "Just Works". The computer should use the wired network connection when it's plugged in, but automatically switch to a wireless connection when the user unplugs it and walks away from the desk. Likewise, when the user plugs the computer back in, the computer should switch back to the wired connection. The user should, most times, not even notice that their connection has has been managed for them; they should simply see uninterrupted network connectivity.

More information about Network Manager is available here .

Network Manager is beta software. You can find packages in breezy/universe, dapper/universe, edgy/universe, feisty/main.

Installation

Ubuntu 6.06 LTS (Dapper), Ubuntu 6.10 (Edgy), Ubuntu 7.04 (Feisty)

  1. Applications, Add/Remove Programs
  2. Find Network Manager in the Internet section
  3. Check the adjacent box to select Network Manager for installation
  4. Click OK
  5. Log out and back in again
  6. If you don't see the Network Manager icon you may need to add the Notification Area to your panel
Kubuntu 6.10 (Edgy)

Have a look at UbuntuHelp:WifiDocs/WPAHowTo/Kubuntu for a tutorial.

Ubuntu 5.10 (Breezy)

  1. Enable Universe (AddingRepositoriesHowto)
  2. Install Network Manager and its dependencies by network-manager
  3. Log out and back in again

Configuring Devices

Any already configured devices that you want to be available in Network Manager will need to de-configured, as otherwise they will be ignored.

The easiest way to do this is by going to System -> Administration -> Networking and then going to "Properties" of each connection. In Properties, just untick the "Enable this connection" checkbox. Logout then log back in again. These connections should now be available in Network Manager.

OR, the harder way, is to backup and then edit the `/etc/network/interfaces` file to remove the configuration of these devices (except for lo which is needed for the loopback interface). You will have to save the file and reboot for the changes to take effect (or don't reboot and run `/etc/init.d/networking restart` instead). For example, if you wanted Network Manager to be able to control all of your devices, your `/etc/network/interfaces` file would look somewhat like the following:

auto lo
iface lo inet loopback

Anchor(Suspend)

Suspend support

At this point your connection won't survive suspend or hibernate. You have to create two files for that:

  • /etc/acpi/suspend.d/07-network-manager.sh
#!/bin/sh
/etc/dbus-1/event.d/25NetworkManager stop
  • /etc/acpi/resume.d/63-network-manager.sh
#!/bin/sh
/etc/dbus-1/event.d/25NetworkManager start

Anchor(Keyring)

Automatic Keyring

To bypass having to enter the keyring password at every login when your keyring password is the same as your login password, follow the following instructions:

naaman@freddo:~$ sudo apt-get install libpam-keyring
naaman@freddo:~$ echo "@include common-pamkeyring" | sudo tee -a /etc/pam.d/gdm

To change keyring password, install libpam-keyring as above then run:

naaman@freddo:~$ /usr/lib/libpam-keyring/pam-keyring-tool -c

VPN support

Network Manager VPN support is based on a plug-in system. You can download some plugins (cisco vpn, openvpn, pptp) form here. They are built for Debian but they work very well on my Ubuntu 6.06, no warning, no errors... just be sure to restart your Network Manager daemon. Edgy has the network-manager-pptp package which provides the Network Manager pptp plugin.

Notes

Gnome

Go to System -> Preferences -> Sessions In the Startup Programs tab, click Add type "nm-applet", click OK. log out of your gnome session, and log back in again.

Other Window Managers/Desktop Environments

add nm-applet to your startup

Note: nm-applet is now part of the network-manager-gnome package which is recommended when you install the network-manager package but may not have been installed.

Not showing wireless network using Ndiswrapper.

You must add Ndiswrapper to /etc/modules so it loads correctly

gksudo gedit /etc/modules

Add on a new line: "ndiswrapper" Save and reboot.

Compiling from cvs

If you know what you are doing and want to compile from CVS you can get build dependencies, checkout CVS and compile it by running:

sudo apt-get build-dep network-manager
cvs -d :pserver:[email protected]:/cvs/gnome login
cvs -d :pserver:[email protected]:/cvs/gnome co NetworkManager
cd NetworkManager
./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
make
sudo make install

Issues

If nm-applet gives this error message

WARNING **: <WARNING>   (): nmwa_dbus_init() could not acquire its service.  dbus_bus_acquire_service() says: 'Connection ":1.26" is not allowed to own the service "org.freedesktop.NetworkManagerInfo" due to security policies in  the configuration file'

try launching nm-applet with

nm-applet --sm-disable

If it still dosen't work you'd have to edit the dbus-1 configuration files for both Network``Manager and nm-applet (this might be a security compromise, if there's another way to get nm-applet to work, please add it here).

Change the default policy context in both /etc/dbus-1/system.d/NetworkManager.conf and /etc/dbus-1/system.d/nm-applet.conf so it says 'allow' instead of 'deny'.

<policy context="default">
        <allow own="org.freedesktop.NetworkManager"/>
        <allow send_destination="org.freedesktop.NetworkManager"/>
        <allow send_interface="org.freedesktop.NetworkManager"/>
</policy>

Then restart dbus

sudo /etc/init.d/dbus restart

and launch the applet

nm-applet

Note: if you upgraded from Breezy to Dapper and you had modified files in /etc/pam.d/ it is possible that they were not altered properly to include a reference to the pam_foreground module. /etc/pam.d/common-session should look like this:

session required        pam_foreground.so
session required        pam_unix.so

This will also affect Gnome Power Manager and Gnome Volume Manager. See this bug for more info. Anchor(dapper)

Ubuntu 6.06 (Dapper)

If it is not managing your network connections after upgrading to Dapper, you'll need to comment out the references to all interfaces (except lo) in /etc/network/interfaces to let Network Manager handle them.

sudo cp /etc/network/interfaces /etc/network/interfaces.bak
sudo nano /etc/network/interfaces

It should look similar to this when you are done:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
# auto eth1

# iface eth1 inet dhcp

Then reboot and you should be good to go!

Alternative Version (no BIND dependency)

There is an alternative version of Network Manager (for Breezy) that has no BIND dependency. Some people have DNS troubles with the version in the repos, and removing the BIND dependency eliminates a possible security hole (not that BIND is insecure, but eliminating it only improves security). Look at this page for more information and to download necessary packages. Additional information is available here.

WPASupplicant Problems in Ubuntu 6.06

Network Manager 0.6 started to use WPAsupplicant for all encrypted connection. This can be a problem as a number of drivers do not support all needed interfaces for WPAsupplicant yet. If you do not need WPA, then you can downgrade to NM 0.5. You need to download the following packages.

x86

https://launchpad.net/distros/ubuntu/dapper/i386/network-manager/0.5.1-0ubuntu19 https://launchpad.net/distros/ubuntu/dapper/i386/nm-applet/0.5.1-0ubuntu19

amd64

https://launchpad.net/distros/ubuntu/dapper/amd64/network-manager/0.5.1-0ubuntu19 https://launchpad.net/distros/ubuntu/dapper/amd64/nm-applet/0.5.1-0ubuntu19

powerpc

https://launchpad.net/distros/ubuntu/dapper/powerpc/network-manager/0.5.1-0ubuntu19 https://launchpad.net/distros/ubuntu/dapper/powerpc/nm-applet/0.5.1-0ubuntu19

these can be installed by double clicking, or using dpkg -i packagename.deb

Disabling NetworkManager

According to this bug here's how to disable Network Manager without uninstalling it:

Stop network manager

sudo /etc/dbus-1/event.d/26NetworkManagerDispatcher stop
sudo /etc/dbus-1/event.d/25NetworkManager stop

Create two files with only the word 'exit' in them. These files are:

/etc/default/NetworkManager
/etc/default/NetworkManagerDispatcher

Advanced Network Troubleshooting in GConf

Navigating gconf-editor

Once you have connect to a network, even unintentionally, it's configuration details will have been stored in the GConf registry. This means that Network Manager will automatically reconnect to any network it finds nearby that is stored in GConf. The order of preference is based on the time you last connected. To access these details open gconf-editor.

gconf-editor

Now navigate to system -> networking -> wireless -> networks. There you will find separate directories for each network under it's network name (essid).

Preventing automatic connection to particular networks

In gconf-editer select the essid of the network you wish to edit. For each of the keys, right-click the key and select Unset Key... Once done quit gconf-editor. If you reopen gconf-editor, you will now see that the network has been removed. This will only prevent automatic connection to a network, you can manually re-connect at any time.

Ensuring connection to particular access points

In gconf-editer select the essid of the network you wish to edit. Right-click on the bssids key and choose Edit Key... Remove the bssid values of the access points that you do not wish to connect to, leaving the ones that you do wish to connect to. Click OK and then quit Gconf-editor.

For further information see the Network Manager FAQ

User comments

1) An interesting thing happens if you combine Network Manager with UbuntuHelp:Wifidocs/Driver/Ndiswrapper. Since the command "ndiswrapper -m" only creates an alias, eg. "alias wlan0 ndiswrapper", the module will only be loaded when the interface wlan0 is used. But since Network Manager requires an empty interfaces list, ndiswrapper never gets loaded. A possible fix is to add a line "ndiswrapper" to /etc/modules. I hope this is the right place for this comment, YungChinOei

2) If you get the error.. "The Network``Manager applet could not find some required resources. It cannot continue."

Open up a terminal & type in .. sudo gtk-update-icon-cache -f /usr/share/icons/hicolor/

I've only come across this error once, & this fixed it straight up :D

3) I have problems connecting to a hidden access point. Switching the SSID broadcast on solves the problem, but it's a security issue.

Try going to "connect to another network" or something like that in the applet menu, then enter the SSID.
-- Ubuntu:PeterWhittaker, 20070326: Cloaking the SSID serves little purpose because it is easily discoverable: Anyone who wants to access your network illicitly will be able to discover your SSID using commonly available tools, with minimum effort. While an SSID is not quite analogous to an IP address, the analogy is good: The SSID appears outside the security envelope in communications between the client and the access point. If you are concerned with security, use WPA, preferably WPA2 (RSN), with a strong cipher (AES). I would argue that SSID cloaking capabilities are a hold-over hack from the "bad old days" of WEP, when there was no effective wireless security and people were scrambling to at least achieve the "appearance" of security (while doing very little to become secure).

4) I could not connect to a Windows VPN (PPTP) unless I manually set the MTU and MRU to 1500. No error message other than "Could not connect" was reported. So try this easy change if you can't connect.

5) I'd love to be able to set manually an ip for a given ESSID, but still autodetect other networks while I move.


CategoryDocumentation CategoryCleanup