https://wiki.archlinux.org/api.php?action=feedcontributions&user=Klexur&feedformat=atomArchWiki - User contributions [en]2024-03-28T14:58:36ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Wicd&diff=247218Wicd2013-02-13T21:19:30Z<p>Klexur: /* Scripts */</p>
<hr />
<div>[[de:Wicd]]<br />
[[es:Wicd]]<br />
[[fr:Wicd]]<br />
[[it:Wicd]]<br />
[[tr:Wicd]]<br />
[[zh-CN:Wicd]]<br />
[[Category:Networking]]<br />
[[Category:Wireless Networking]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of Wicd &ndash; an open source wired and wireless network manager for Linux which aims to provide a simple interface to connect to networks with a wide variety of settings.}}<br />
{{Article summary heading|Overview}}<br />
{{Article summary text|{{Networking overview}}}}<br />
{{Article summary end}}<br />
<br />
[http://www.wicd.net/ Wicd] is a network connection manager that can manage wireless and wired interfaces, similar and an alternative to [[NetworkManager]]. Wicd is written in [[Python]] and [[GTK+]], requiring fewer dependencies than other network managers. Alternatively, a version of Wicd for [[KDE]], written in [[Qt]], is available from the [[Arch User Repository]]. Wicd can also run from the terminal in a curses interface, requiring no X server session or task panel (see [[#Running Wicd]]).<br />
<br />
==Installation==<br />
<br />
=== Base package ===<br />
[[pacman|Install]] {{Pkg|wicd}}, available in the [[Official Repositories]]. It includes everything needed to run the wicd daemon and the {{ic|wicd-cli}} and {{ic|wicd-curses}} interfaces.<br />
<br />
=== GTK client ===<br />
For a GTK front-end, install {{Pkg|wicd-gtk}}, available in the [[Official Repositories|official repositories]]. It includes everything needed to run the GTK interface of wicd and the autostart file for the client to appear in the system tray.<br />
<br />
=== KDE client ===<br />
For a KDE front-end, install {{AUR|wicd-kde}}, available in the [[Arch User Repository]]. <br />
<br />
=== Notifications ===<br />
To enable visual notifications about network status, you need to install the {{Pkg|notification-daemon}}.<br />
<br />
If you are not using [[GNOME]], you will want to install {{Pkg|xfce4-notifyd}} instead of the notification-daemon, because it pulls a lot of unnecessary GNOME packages.<br />
<br />
=== Alternative ===<br />
The {{AUR|wicd-bzr}} buildscript is available in the [[AUR]], which should build the latest development branch.<br />
If you need an alternative version or you just want to roll your own package, you can easily build it using [[ABS]].<br />
<br />
==Getting Started==<br />
<br />
===Initial Setup===<br />
Wicd provides a daemon that must be started. <br />
<br />
{{Warning | Running multiple network managers ''will'' cause problems, so it is important to ''disable all other network management daemons''.}}<br />
<br />
First, stop all previously running network daemons:<br />
<br />
# systemctl stop netcfg<br />
# systemctl stop dhcpcd<br />
# systemctl stop NetworkManager<br />
<br />
Disable any existing network management services, including {{ic|netcfg}}, {{ic|dhcpcd}}, and {{ic|networkmanager}}. Refer to [[Systemd#Using_units]].<br />
<br />
{{Note | You might need to stop and disable the '''network''' daemon instead of '''netcfg''', which is a current replacement for '''network''' service. If unsure, try disabling both.}}<br />
<br />
Start the wicd service:<br />
# systemctl start wicd<br />
<br />
Enable the service at system start up:<br />
# systemctl enable wicd.service<br />
<br />
Add your account to '''network''' group:<br />
<br />
# gpasswd -a USERNAME network<br />
<br />
{{Note | The Unix group that dbus allows to access '''wicd''' is subject to change, and may be different than ''network''. Check which policy group is specified in {{ic|/etc/dbus-1/system.d/wicd.conf}}, and add your user to that group.}}<br />
<br />
If you added your user to a new group, log out and then log in.<br />
<br />
===Running Wicd===<br />
<br />
To load Wicd, run:<br />
<br />
$ wicd-client<br />
<br />
To force it to start minimized in the notification area, run:<br />
<br />
$ wicd-client --tray<br />
<br />
If your desktop environment does not have a notification area, run:<br />
<br />
$ wicd-client -n<br />
<br />
The above commands will only work if you have installed the {{pkg|wicd-gtk}}. If you did not install {{pkg|wicd-gtk}} then use wicd-cli or wicd-curses:<br />
<br />
$ wicd-curses<br />
<br />
{{Note | Wicd does not prompt you for a passkey. To use encrypted connections (WPA/WEP), expand the network you want to connect to, click '''Advanced''' and enter the needed info.}}<br />
<br />
==== Autostart ====<br />
The {{pkg|wicd-gtk}} package puts a file in {{ic|/etc/xdg/autostart/wicd-tray.desktop}}, which will autostart {{ic|wicd-client}} upon login to your DE/WM. If so, enabling the service with {{ic|systemctl}} is sufficient. <br />
<br />
If {{ic|/etc/xdg/autostart/wicd-tray.desktop}} does not exist, you can add '''wicd-client''' to your DE/WM startup to have the application start when you log in.<br />
<br />
{{Note|If '''wicd-client''' is added to DE/WM startup when {{ic|/etc/xdg/autostart/wicd-tray.desktop}} exists, you will have an issue of two {{ic|wicd-client}} instances running.}}<br />
<br />
===Scripts===<br />
Wicd has the ability to run scripts during all stages of the connection process (post/pre connect/disconnect).<br />
Simply place a script inside the relevant stage folder within {{ic|/etc/wicd/scripts/}} and make it executable.<br />
<br />
The scripts are able to receive three parameters, these being: <br />
$1 - the connection type (wireless/wired).<br />
$2 - the ESSID (network name).<br />
$3 - the BSSID (gateway MAC).<br />
<br />
====Stop ARP spoofing attacks====<br />
<br />
The script below can be used to set a static ARP, to stop ARP spoofing attacks.<br />
Simply change the values within the case statement to match those of the networks you want to set static ARP entries for.<br />
<br />
#!/bin/bash<br />
#Set the parameters passed to this script to meaningful variable names.<br />
connection_type="$1"<br />
essid="$2"<br />
bssid="$3"<br />
<br />
if [ "${connection_type}" == "wireless" ]; then<br />
<br />
#Change below to match your networks.<br />
case "$essid" in<br />
YOUR-NETWORK-NAME-ESSID)<br />
sudo arp -s 192.168.0.1 00:11:22:33:44:55<br />
;;<br />
Netgear01923)<br />
sudo arp -s 192.168.0.1 10:11:20:33:40:50<br />
;;<br />
ANOTHER-ESSID)<br />
sudo arp -s 192.168.0.1 11:33:55:77:99:00<br />
;;<br />
*)<br />
echo "Static ARP not set. No network defined."<br />
;;<br />
esac<br />
fi<br />
<br />
====Change MAC using macchanger====<br />
<br />
The script below can be used to change the MAC address of your network interfaces.<br />
<br />
To change the MAC whenever you connect to a network, place this script under {{ic|/etc/wicd/scripts/preconnect/}}<br />
<br />
Take a look at {{ic|macchanger --help}} to adjust the macchanger command to your liking.<br />
<br />
{{bc|<nowiki><br />
#!/usr/bin/env bash<br />
<br />
connection_type="$1"<br />
<br />
if [[ "${connection_type}" == "wireless" ]]; then<br />
ip link set wlan0 down<br />
macchanger -A wlan0<br />
ip link set wlan0 up<br />
elif [[ "${connection_type}" == "wired" ]]; then<br />
ip link set eth0 down<br />
macchanger -A eth0<br />
ip link set eth0 up<br />
fi<br />
</nowiki>}}<br />
<br />
==Troubleshooting==<br />
<br />
=== Failed to get IP address ===<br />
If wicd repeatedly fails to get an IP address using the default dhcpcd client, try installing and using '''dhclient''' instead:<br />
# pacman -S dhclient<br />
Do not forget to select dhclient as the primary dhcp client in wicd options afterwards!<br />
<br />
If wicd can get an IP address for a wired interface and is unable to get an IP address for a wireless interface, try disabling the wireless card's powersaving features:<br />
# iwconfig wlan0 power off<br />
<br />
=== Random disconnecting ===<br />
<br />
====Cause #1====<br />
If dmesg says {{ic|1=wlan0: deauthenticating from MAC by local choice (reason=3)}} and you lose your Wi-Fi connection, it is likely that you have a bit too aggressive power-saving on your Wi-Fi card[http://us.generation-nt.com/answer/gentoo-user-wireless-deauthenticating-by-local-choice-help-204640041.html]. Try disabling the wireless card's power-saving features:<br />
# iwconfig wlan0 power off<br />
<br />
If you have the package {{pkg|pm-utils}} installed, it may be the reason power-saving is on in your system[http://uselessuseofcat.com/?p=67]. You can put {{bc|#!/bin/sh<br />
/sbin/iwconfig wlan0 power off}} into the file {{ic|/etc/pm/power.d/wireless}} (create it if it does not exist and make it executable) and see if things get better.<br />
<br />
If your card does not support {{ic|iwconfig wlan0 power off}}, check the '''BIOS''' for power management options. Disabling PCI-Express power management in the BIOS of a Lenovo W520 resolved this issue.<br />
<br />
====Cause #2====<br />
If you are experiencing frequent disconnections with wireless and dmesg shows messages such as <br />
<br />
{{ic|1=ieee80211 phy0: wlan0: No probe response from AP xx:xx:xx:xx:xx:xx after 500ms, disconnecting}}<br />
<br />
try changing the channel bandwidth to {{ic|20MHz}} through your router's settings page.<br />
<br />
=== Importing pynotify failed, notifications disabled ===<br />
In case the {{pkg|python2-notify}} package did not get installed automatically. You can [[pacman|install]] it from [[Official Repositories]].<br />
<br />
=== Dbus connection error message ===<br />
<br />
Otherwise you will get dbus error messages and not be able to connect to networks.<br />
<br />
* '''NOTE:''' If wicd suddenly stopped working and it complains about dbus, it is quite likely that you just need to remove wicd fully, including and all its configuration files, and re-install it from scratch:<br />
pacman -R wicd<br />
rm -Rf /etc/wicd /var/log/wicd /etc/dbus-1/system.d/wicd*<br />
pacman -S wicd<br />
Check this link for more details: https://bbs.archlinux.org/viewtopic.php?pid=577141#p577141<br />
<br />
Wicd-client also throws a dbus connection error message ("Could not connect to wicd's D-Bus interface.") when wicd is not running due to a problem with a config file. It seems that sometimes an empty account gets added to /etc/wicd/wired-settings.conf in which case you simply have to remove the<br />
[] <br />
and restart wicd.<br />
<br />
When running wicd daemon with `rc.d` it won't print error that `pid` file is created. If you are sure wicd isn't running remove this file:<br />
rm /var/run/wicd/wicd.pid<br />
<br />
===Problems after package update===<br />
Sometimes the wicd client fails to load after a package update due to D-Bus errors. <br />
<br />
A solution is to remove the config files in the {{ic|/etc/wicd/}} directory. <br />
# systemctl stop wicd<br />
# rm /etc/wicd/*.conf<br />
# systemctl start wicd<br />
<br />
===Note about graphical sudo programs===<br />
If you are receiving an error about wicd failing to find a graphical sudo program, run one of the following commands:<br />
$ ktsuss wicd-client -n<br />
<br />
$ gksudo wicd-client -n<br />
<br />
$ kdesu wicd-client -n<br />
<br />
These programs require the ktsuss (found in the AUR), gksu, and kdesu packages, respectively.<br />
<br />
===Making eduroam work with wicd===<br />
<br />
{{Note|You may try the AUR package {{AUR|wicd-eduroam}} first. It will appear in wicd as "eduroam". If it does not work for you, try the following.}}<br />
<br />
This profile will only work for eduroam institutions which use TTLS and will not work for PEAP.<br />
<br />
Save the following as {{ic|/etc/wicd/encryption/templates/ttls-80211}}<br />
{{hc|/etc/wicd/encryption/templates/ttls-80211|<nowiki><br />
name = TTLS for Wireless<br />
author = Alexander Clouter<br />
version = 1<br />
require anon_identity *Anonymous_Username identity *Identity password *Password <br />
optional ca_cert *Path_to_CA_Cert cert_subject *Certificate_Subject<br />
-----<br />
ctrl_interface=/var/run/wpa_supplicant<br />
network={<br />
ssid="$_ESSID"<br />
scan_ssid=$_SCAN<br />
<br />
key_mgmt=WPA-EAP<br />
eap=TTLS<br />
<br />
ca_cert="$_CA_CERT"<br />
subject_match="$_CERT_SUBJECT"<br />
<br />
phase2="auth=MSCHAPv2 auth=PAP"<br />
<br />
anonymous_identity="$_ANON_IDENTITY"<br />
identity="$_IDENTITY"<br />
password="$_PASSWORD"<br />
}<br />
</nowiki>}}<br />
<br />
Open a terminal<br />
<br />
cd /etc/wicd/encryption/templates<br />
echo ttls-80211 >> active<br />
<br />
Open wicd, choose TTLS for Wireless in the properties of eduroam, and enter the appropriate settings for your institution. The format of the subject match should be something like "/CN=server.example.com".<br />
<br />
NB. This only works in my institution by commenting {{ic|subject_match}}, which is not secure, but at least it connects.<br />
<br />
===Two instances of wicd-client (and possibly two icons in tray)===<br />
See the note in [[Wicd#Running_Wicd]] about the autostart file in {{ic|/etc/xdg/autostart}} and the forum post and bug report provided in [[Wicd#External_Links]]. Essentially, if {{ic|/etc/xdg/autostart/wicd-tray.desktop}} exists, you only need the {{ic|wicd}} service enabled in systemd and should remove it from your DE/WM autostart file.<br />
<br />
===Bad password using PEAP with TKIP/MSCHAPV2===<br />
The connection template PEAP with TKIP/MSCHAPV2 requires the user to enter the path to a CA certificate besides entering username and password. However this can cause troubles resulting in a error message of a bad password [https://bbs.archlinux.org/viewtopic.php?pid=990385 *]. A possible solution is the usage of PEAP with GTC instead of TKIP/MSCHAPV2 which does not require to enter the path of the CA cert.<br />
<br />
===Wicd skips obtaining IP address on WLAN===<br />
This can be caused by dhcpcd running alongside wicd as systemd service. A solution would be to stop/disable dhcpcd.<br />
# systemctl stop dhcpcd<br />
# systemctl disable dhcpcd<br />
<br />
==External links==<br />
*[http://www.wicd.net/download.php Note on interfaces at the official site]<br />
*[https://bbs.archlinux.org/viewtopic.php?id=114803 Forum post about two instances of wicd-client and /etc/xdg/autostart]<br />
*[https://bugs.archlinux.org/task/22423 Bug report mentioning /etc/xdg/autostart and wicd-client behavior]</div>Klexur