Difference between revisions of "Netcfg Troubleshooting"

From ArchWiki
Jump to: navigation, search
(linked related pages)
 
m (not a warning, as defined in Help:Style#Notes, Warnings, Tips)
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Lowercase title}}
 
{{Lowercase title}}
 
[[Category:Networking]]
 
[[Category:Networking]]
 +
[[zh-CN:Netcfg Troubleshooting]]
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|Collection of troubleshooting for netcfg.}}
 
{{Article summary text|Collection of troubleshooting for netcfg.}}
 
{{Article summary heading|Resources}}
 
{{Article summary heading|Resources}}
{{Article summary wiki|netcfg}} - Main article for netcfg.
+
{{Article summary wiki|netcfg}}
{{Article summary wiki|Netcfg_Tips}} - Tips and Tricks for netcfg.
+
{{Article summary wiki|Netcfg Tips}}
 
{{Article summary end}}
 
{{Article summary end}}
  
==Troubleshooting==
+
{{Note|Netcfg has been superseded by [[netctl]]}}
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Debugging ===
  
===Debugging===
 
 
To run netcfg with debugging output, set the {{ic|NETCFG_DEBUG}} environment variable to {{ic|"yes"}}, for example:
 
To run netcfg with debugging output, set the {{ic|NETCFG_DEBUG}} environment variable to {{ic|"yes"}}, for example:
  
Line 21: Line 25:
 
Whatever is entered here will be added to the command when {{ic|wpa_supplicant}} is called.
 
Whatever is entered here will be added to the command when {{ic|wpa_supplicant}} is called.
  
===Network unavailable===
+
=== Network unavailable ===
 +
 
 
This error is typically due to:
 
This error is typically due to:
 +
 
* Out of range; or
 
* Out of range; or
 
* Driver issue.
 
* Driver issue.
  
===Wireless association failed===
+
=== Wireless association failed ===
 +
 
 
This error is typically due to:
 
This error is typically due to:
 +
 
* Out of range/reception;
 
* Out of range/reception;
 
* Incorrect configuration;
 
* Incorrect configuration;
Line 35: Line 43:
  
 
If the connection problem is due to poor reception, increase the {{ic|TIMEOUT}} variable in {{ic|/etc/network.d/mynetwork}}, such as:
 
If the connection problem is due to poor reception, increase the {{ic|TIMEOUT}} variable in {{ic|/etc/network.d/mynetwork}}, such as:
 +
 
  TIMEOUT=60
 
  TIMEOUT=60
  
 
If an AP with a hidden SSID is used, try:
 
If an AP with a hidden SSID is used, try:
 +
 
  PRE_UP='iwconfig $INTERFACE essid $ESSID'
 
  PRE_UP='iwconfig $INTERFACE essid $ESSID'
  
===Unable to get IP address with DHCP===
+
=== Unable to get IP address with DHCP ===
This error is typically due to:
+
 
* Out of range/reception
+
This error is typically due to out of range/bad reception.
  
 
Try increasing {{ic|DHCP_TIMEOUT}} variable in your network {{ic|/etc/network.d/profile}}.
 
Try increasing {{ic|DHCP_TIMEOUT}} variable in your network {{ic|/etc/network.d/profile}}.
  
===Not a valid connection, check spelling or look at examples===
+
=== Not a valid connection, check spelling or look at examples ===
 +
 
 
You must set {{ic|CONNECTION}} to one of the connection types listed in the {{ic|/usr/lib/network/connections}} directory. Alternatively, use one of the provided configuration examples in {{ic|/etc/network.d/examples}}.
 
You must set {{ic|CONNECTION}} to one of the connection types listed in the {{ic|/usr/lib/network/connections}} directory. Alternatively, use one of the provided configuration examples in {{ic|/etc/network.d/examples}}.
  
===No Connection===
+
=== No Connection ===
====Carrier Timeout====
+
 
 +
==== Carrier Timeout ====
 +
 
 
If you get a set of debug messages similar to the following (remembering that profile names and interface names may be different), it could be that the process of bringing up the interface is taking too long.  
 
If you get a set of debug messages similar to the following (remembering that profile names and interface names may be different), it could be that the process of bringing up the interface is taking too long.  
  
Line 64: Line 77:
 
   [FAIL]
 
   [FAIL]
  
The default is 2 seconds.
+
The default is 2 seconds. To lengthen the timeout, set the {{ic|CARRIER_TIMEOUT}} variable before calling netcfg.
To lengthen the timeout, set the CARRIER_TIMEOUT variable before calling netcfg.
+
  
This thread shows one example of this issue:
+
This thread shows one example of this issue: https://bbs.archlinux.org/viewtopic.php?id=138615
https://bbs.archlinux.org/viewtopic.php?id=138615
+
  
====Skip no carrier====
+
==== Skip no carrier ====
When you can manually bring up an interface but the journal says „No connection“ during boot, it might be that the physical connection cannot be detected fast enough. Try adding
+
  
  SKIPNOCARRIER='yes'
+
When you can manually bring up an interface but the journal says „No connection“ during boot, it might be that the physical connection cannot be detected fast enough. Try adding this to your profile:
  
to your profile. Netcfg will then assign the IP address regardless of whether there is a cable actually attached.
+
SKIPNOCARRIER='yes'
 +
 
 +
Netcfg will then assign the IP address regardless of whether there is a cable actually attached.
 +
 
 +
=== Driver quirks ===
  
===Driver quirks===
 
 
{{Note|You most likely do '''not''' need quirks; ensure your configuration is correct before considering them. Quirks are intended for a small range of drivers with unusual issues, many of them older versions. These are workarounds, not solutions.}}
 
{{Note|You most likely do '''not''' need quirks; ensure your configuration is correct before considering them. Quirks are intended for a small range of drivers with unusual issues, many of them older versions. These are workarounds, not solutions.}}
  
Line 89: Line 102:
 
; {{ic|postscan}}: Run {{ic|iwlist scan}} after associating  
 
; {{ic|postscan}}: Run {{ic|iwlist scan}} after associating  
  
Add the required quirks to the netcfg configuration file {{ic|/etc/network.d/mynetwork}}, for example:
+
Add the required quirks to the netcfg configuration file {{ic|/etc/network.d/mynetwork}}. For example:
 +
 
 
  QUIRKS=(prescan preessid)
 
  QUIRKS=(prescan preessid)
  
 
If you receive "Wireless network not found", "Association failed" errors and have tried the above, or if an AP with a hidden SSID is used, see the above section [[#Wireless association failed]].
 
If you receive "Wireless network not found", "Association failed" errors and have tried the above, or if an AP with a hidden SSID is used, see the above section [[#Wireless association failed]].
  
===Ralink legacy drivers rt2500, rt2400 that use iwpriv===
+
=== Ralink legacy drivers rt2500, rt2400 that use iwpriv ===
 +
 
 
There is no plans to add WPA support to these drivers. rt2x00 is supported, however, and will replace these.
 
There is no plans to add WPA support to these drivers. rt2x00 is supported, however, and will replace these.
  
 
If you must use them, create a shell script that runs the needed {{ic|iwpriv}} commands and put its path in {{ic|PRE_UP}}.
 
If you must use them, create a shell script that runs the needed {{ic|iwpriv}} commands and put its path in {{ic|PRE_UP}}.
  
===find: "/var/run/network//suspend/":  No such file or directory===
+
=== "find: '/var/run/network/suspend/':  No such file or directory" ===
 +
 
 
If you get this error message, then do not bother because it is a known bug. Create the directory by hand.
 
If you get this error message, then do not bother because it is a known bug. Create the directory by hand.
  
===It still does not work, what do I do?===
+
=== wlan0 does not exist ===
If this article did not help solve your problem, the next best places to ask for help are the forums, the mailing list, and the #archlinux IRC channel.
+
 
 +
In order to make sure the network hardware is initialised before a network connection attempt is made, add the "After" and "BindTo" lines to the appropriate netcfg or netcfg@ file found in /etc/systemd/system/*/
 +
 
 +
  After=sys-devices-xxx-net-wlan0.device
 +
  BindTo=sys-devices-xxx-net-wlan0.device
 +
 
 +
where "sys-devices-xxx-net-wlan0.device" can be seen in
 +
 
 +
{{ic|systemctl --full}}
 +
 
 +
=== Help ===
 +
 
 +
If this article did not help solve your problem, the next best places to ask for help are the forums, the mailing list, and the [[IRC Channel]].
  
 
To be able to determine the problem, we need information. When you ask, provide the following output:
 
To be able to determine the problem, we need information. When you ask, provide the following output:
 +
 
* '''ALL OUTPUT FROM netcfg'''
 
* '''ALL OUTPUT FROM netcfg'''
 
** This is absolutely crucial to be able determine what went wrong. The message might be short or non-existent, but it can mean a great deal.  
 
** This is absolutely crucial to be able determine what went wrong. The message might be short or non-existent, but it can mean a great deal.  

Revision as of 16:04, 3 May 2013

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary end

Note: Netcfg has been superseded by netctl

Troubleshooting

Debugging

To run netcfg with debugging output, set the NETCFG_DEBUG environment variable to "yes", for example:

# NETCFG_DEBUG="yes" netcfg <arguments>

Debugging information for wpa_supplicant can be logged using WPA_OPTS within a profile, for example:

WPA_OPTS="-f/path/to/log"

Whatever is entered here will be added to the command when wpa_supplicant is called.

Network unavailable

This error is typically due to:

  • Out of range; or
  • Driver issue.

Wireless association failed

This error is typically due to:

  • Out of range/reception;
  • Incorrect configuration;
  • Invalid key;
  • Driver problem; or
  • Trying to connect to a hidden network.

If the connection problem is due to poor reception, increase the TIMEOUT variable in /etc/network.d/mynetwork, such as:

TIMEOUT=60

If an AP with a hidden SSID is used, try:

PRE_UP='iwconfig $INTERFACE essid $ESSID'

Unable to get IP address with DHCP

This error is typically due to out of range/bad reception.

Try increasing DHCP_TIMEOUT variable in your network /etc/network.d/profile.

Not a valid connection, check spelling or look at examples

You must set CONNECTION to one of the connection types listed in the /usr/lib/network/connections directory. Alternatively, use one of the provided configuration examples in /etc/network.d/examples.

No Connection

Carrier Timeout

If you get a set of debug messages similar to the following (remembering that profile names and interface names may be different), it could be that the process of bringing up the interface is taking too long.

 DEBUG: Loading profile eth0-dhcp
 DEBUG: Configuring interface eth0
 :: eth0-dhcp up
 DEBUG: status reported to profile_up as:
 DEBUG: Loading profile eth0-dhcp
 DEBUG: Configuring interface eth0
 DEBUG: ethernet_iproute_up ifup
   > No connection
 DEBUG: profile_up connect failed
  [FAIL]

The default is 2 seconds. To lengthen the timeout, set the CARRIER_TIMEOUT variable before calling netcfg.

This thread shows one example of this issue: https://bbs.archlinux.org/viewtopic.php?id=138615

Skip no carrier

When you can manually bring up an interface but the journal says „No connection“ during boot, it might be that the physical connection cannot be detected fast enough. Try adding this to your profile:

SKIPNOCARRIER='yes'

Netcfg will then assign the IP address regardless of whether there is a cable actually attached.

Driver quirks

Note: You most likely do not need quirks; ensure your configuration is correct before considering them. Quirks are intended for a small range of drivers with unusual issues, many of them older versions. These are workarounds, not solutions.

Some drivers behave oddly and need workarounds to connect. Quirks must be enabled manually. They are best determined by reading the forums, seeing what others have used, and, if that fails, trial and error. Quirks can be combined.

prescan
Run iwlist $INTERFACE scan before attempting to connect (Broadcom)
preessid
Run iwconfig $INTERFACE essid $ESSID before attempting to connect (ipw3945, Broadcom and Intel PRO/Wireless 4965AGN)
wpaessid
Same as previous, run before starting wpa_supplicant. Not supported anymore - use IWCONFIG="essid $ESSID" instead. (ath9k)
predown
Take interface down before association and then restore it after (madwifi)
postsleep
Sleep one second before checking if the association was successful
postscan
Run iwlist scan after associating

Add the required quirks to the netcfg configuration file /etc/network.d/mynetwork. For example:

QUIRKS=(prescan preessid)

If you receive "Wireless network not found", "Association failed" errors and have tried the above, or if an AP with a hidden SSID is used, see the above section #Wireless association failed.

Ralink legacy drivers rt2500, rt2400 that use iwpriv

There is no plans to add WPA support to these drivers. rt2x00 is supported, however, and will replace these.

If you must use them, create a shell script that runs the needed iwpriv commands and put its path in PRE_UP.

"find: '/var/run/network/suspend/': No such file or directory"

If you get this error message, then do not bother because it is a known bug. Create the directory by hand.

wlan0 does not exist

In order to make sure the network hardware is initialised before a network connection attempt is made, add the "After" and "BindTo" lines to the appropriate netcfg or netcfg@ file found in /etc/systemd/system/*/

 After=sys-devices-xxx-net-wlan0.device
 BindTo=sys-devices-xxx-net-wlan0.device

where "sys-devices-xxx-net-wlan0.device" can be seen in

systemctl --full

Help

If this article did not help solve your problem, the next best places to ask for help are the forums, the mailing list, and the IRC Channel.

To be able to determine the problem, we need information. When you ask, provide the following output:

  • ALL OUTPUT FROM netcfg
    • This is absolutely crucial to be able determine what went wrong. The message might be short or non-existent, but it can mean a great deal.
  • /etc/network.d network profiles
    • This is also crucial as many problems are simple configuration issues. Feel free to censor your wireless key.
  • netcfg version
  • lsmod
  • iwconfig