Advertisement
xtiansimon

StepByStep-Wifi_on_Arch

Mar 16th, 2014
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 16.06 KB | None | 0 0
  1. CONTENTS:
  2. [1] Reenable Netctl profile
  3. [2] List directories
  4. [3] Start netctl profile
  5. [4] Start fails, print systemctl output
  6. NEW [4.1] Other error check output
  7. [5] Output says wifi is already up. Maybe the device is up, but the network connection is not!
  8. [6] My Netctl Profile for MyWifi3
  9. [7] Start up wireless using manual means via #wpa_supplicant
  10. NEW [8] Recommendation to manually bring the interface down and back up with netctl
  11. [9] Search on "Failed to connect to non-global ctrl_ifname: wlp3s0  error: No such file or directory"
  12. [9.1] Check if dhcpcd is already up.
  13. [9.2] Ok. According to the advice @9, disable dhcpcd
  14. [9.3] Set the link down
  15. [9.4] Try to bring it back up with netctl
  16. [9.5] Check error log
  17. [10] More systemctl commands
  18.  
  19. ---
  20. [1] Reenable Netctl profile
  21. # netctl reenable MyWifi3_wireless_dhcp_wpa
  22. rm '/etc/systemd/system/multi-user.target.wants/netctl@MyWifi3_wireless_dhcp_wpa.service'
  23. ln -s '/etc/systemd/system/netctl@MyWifi3_wireless_dhcp_wpa.service' '/etc/systemd/system/multi-user.target.wants/netctl@MyWifi3_wireless_dhcp_wpa.service'
  24.  
  25. [2] List directories
  26. # ll netctl/
  27. total 40
  28. drwxr-xr-x  6 root root 4096 Mar 16 11:54 .
  29. drwxr-xr-x 68 root root 4096 Mar 13 12:19 ..
  30. -rw-r--r--  1 root root  189 Dec 16 12:55 MyWifi1_ethernet_dhcp
  31. -rwxr-xr-x  1 root root  187 Dec 23 15:06 MyWifi1_wireless_dhcp_wpa
  32. -rw-------  1 root root  142 Dec 23 15:07 MyWifi2_wireless_dhcp
  33. drwxr-xr-x  2 root root 4096 Nov 17 04:37 examples
  34. drwxr-xr-x  2 root root 4096 Nov 17 04:37 hooks
  35. drwxr-xr-x  2 root root 4096 Nov 17 04:37 interfaces
  36. drwxr-xr-x  2 root root 4096 Mar  8 03:20 save
  37. -rw-r--r--  1 root root  193 Mar 16 10:28 MyWifi3_wireless_dhcp_wpa
  38. -rw-------  1 root root  159 Mar 16 12:07 wlp3s0-MyWifi3
  39.  
  40. # ll /etc/systemd/system
  41. total 20
  42. drwxr-xr-x 4 root root 4096 Mar 16 10:28 .
  43. drwxr-xr-x 6 root root 4096 Mar 12 13:42 ..
  44. drwxr-xr-x 2 root root 4096 Dec 16 12:28 getty.target.wants
  45. drwxr-xr-x 2 root root 4096 Mar 16 10:28 multi-user.target.wants
  46. -rw------- 1 root root  236 Mar 16 10:28 netctl@MyWifi3_wireless_dhcp_wpa.service
  47.  
  48. # ll /etc/systemd/system/multi-user.target.wants/
  49. total 12
  50. drwxr-xr-x 2 root root 4096 Mar 16 10:28 .
  51. drwxr-xr-x 4 root root 4096 Mar 16 10:28 ..
  52. lrwxrwxrwx 1 root root   38 Dec 16 12:51 dhcpcd.service -> /usr/lib/systemd/system/dhcpcd.service
  53. lrwxrwxrwx 1 root root   65 Mar 16 10:28 netctl@MyWifi3_wireless_dhcp_wpa.service -> /etc/systemd/system/netctl@MyWifi3_wireless_dhcp_wpa.service
  54. lrwxrwxrwx 1 root root   40 Mar  6 17:21 remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
  55. lrwxrwxrwx 1 root root   36 Dec 18 11:45 sshd.service -> /usr/lib/systemd/system/sshd.service
  56.  
  57. [3] Start netctl profile
  58. # netctl start MyWifi3_wireless_dhcp_wpa
  59. Job for netctl@MyWifi3_wireless_dhcp_wpa.service failed. See 'systemctl status netctl@MyWifi3_wireless_dhcp_wpa.service' and 'journalctl -xn' for details.
  60.  
  61. [4] Start fails, print systemctl output
  62. # systemctl status netctl@MyWifi3_wireless_dhcp_wpa.service
  63. netctl@MyWifi3_wireless_dhcp_wpa.service - MyWifi3 wpa_supplicant configuration file based wireless connection
  64.    Loaded: loaded (/etc/systemd/system/netctl@MyWifi3_wireless_dhcp_wpa.service; enabled)
  65.    Active: failed (Result: exit-code) since Sun 2014-03-16 12:03:26 EST; 20s ago
  66.      Docs: man:netctl.profile(5)
  67.   Process: 766 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)
  68.  Main PID: 766 (code=exited, status=1/FAILURE)
  69.  
  70. Mar 16 12:03:26 MasterShake network[766]: Starting network profile 'MyWifi3_wireless_dhcp_wpa'...
  71. Mar 16 12:03:26 MasterShake systemd[1]: netctl@MyWifi3_wireless_dhcp_wpa.service: main process exited, code=exited, status=1/FAILURE
  72. Mar 16 12:03:26 MasterShake systemd[1]: Failed to start MyWifi3 wpa_supplicant configuration file based wireless connection.
  73. Mar 16 12:03:26 MasterShake systemd[1]: Unit netctl@MyWifi3_wireless_dhcp_wpa.service entered failed state.
  74. Mar 16 12:03:26 MasterShake network[766]: The interface of network profile 'MyWifi3_wireless_dhcp_wpa' is already up
  75.  
  76.  
  77. [4.1] Other error check output
  78. # journalctl -xn
  79. -- Logs begin at Tue 2013-12-17 13:19:59 EST, end at Mon 2014-03-17 10:43:2
  80. Mar 17 10:42:37 MasterShake systemd[489]: Starting Default.
  81. -- Subject: Unit UNIT has begun with start-up
  82. -- Defined-By: systemd
  83. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  84. --
  85. -- Unit UNIT has begun starting up.
  86. Mar 17 10:42:37 MasterShake systemd[489]: Reached target Default.
  87. -- Subject: Unit UNIT has finished start-up
  88. -- Defined-By: systemd
  89. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  90. --
  91. -- Unit UNIT has finished starting up.
  92. --
  93. -- The start-up result is done.
  94. Mar 17 10:42:37 MasterShake systemd[489]: Startup finished in 114ms.
  95. -- Subject: System start-up is now complete
  96. -- Defined-By: systemd
  97. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  98. --
  99. -- All system services necessary queued for starting at boot have been
  100. -- successfully started. Note that this does not mean that the machine is
  101. -- now idle as services might still be busy with completing start-up.
  102. --
  103. -- Kernel start-up required KERNEL_USEC microseconds.
  104. --
  105. -- Initial RAM disk start-up required INITRD_USEC microseconds.
  106. --
  107. -- Userspace start-up required 114994 microseconds.
  108. Mar 17 10:42:37 MasterShake login[346]: ROOT LOGIN ON tty1
  109. Mar 17 10:43:25 MasterShake systemd[1]: Starting MyWifi3 wpa_supplicant configuration file based wireless connection...
  110. -- Subject: Unit netctl@MyWifi3_wireless_dhcp_wpa.service has begun with start-up
  111. -- Defined-By: systemd
  112. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  113. --
  114. -- Unit netctl@MyWifi3_wireless_dhcp_wpa.service has begun starting up
  115. Mar 17 10:43:25 MasterShake network[549]: Starting network profile 'MyWifi3_wireless_dhcp_wpa'...
  116. Mar 17 10:43:25 MasterShake systemd[1]: netctl@MyWifi3_wireless_dhcp_wpa.service: main process exited, code=exited, status=1/FAILURE
  117. Mar 17 10:43:25 MasterShake systemd[1]:  Failed to start MyWifi3 wpa_supplicant configuration file based wireless connection.
  118. -- Subject: Unit netctl@MyWifi3_wireless_dhcp_wpa.service has failed
  119. -- Defined-By: systemd
  120. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  121. --
  122. -- Unit netctl@MyWifi3_wireless_dhcp_wpa.service has failed.
  123. --
  124. -- The result is failed.
  125. Mar 17 10:43:25 MasterShake systemd[1]: Unit netctl@MyWifi3_wireless_dhcp_wpa.service entered failed state.
  126. Mar 17 10:43:25 MasterShake network[549]: The interface of network profile 'MyWifi3_wireless_dhcp_wpa' is already up
  127.  
  128.  
  129. [5] Output says wifi is already up. Maybe the device is up, but the network connection is not!
  130. //NOTE: This step [5] output is the same after both [4] and the new steps [4.1] [4.2]
  131.  
  132. # ping 206.13.31.12     //Check for network connection, easiest for me to remember :)
  133. connect: Network is unreachable
  134.  
  135. # ip addr   //Verify the link is up
  136. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
  137.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  138.     inet 127.0.0.1/8 scope host lo
  139.        valid_lft forever preferred_lft forever
  140.     inet6 ::1/128 scope host
  141.        valid_lft forever preferred_lft forever
  142. 2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
  143.     link/ether 00:22:68:1c:fb:cc brd ff:ff:ff:ff:ff:ff
  144. 3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
  145.     link/ether 00:26:c6:8a:11:b6 brd ff:ff:ff:ff:ff:ff
  146.  
  147. # iw dev wlp3s0 link     //Check link status
  148. Not connected.
  149.  
  150.  
  151. [6] My Netctl Profile for MyWifi3
  152. # cat MyWifi3_wireless_dhcp_wpa
  153. Description='MyWifi3 wpa_supplicant configuration file based wireless connection'
  154. Interface=wlp3s0
  155. Connection=wireless
  156. Security=wpa-config
  157. WPAConfigFile='/etc/wpa_supplicant.conf'
  158. IP=dhcp
  159.  
  160. [7] Start up wireless using manual means via #wpa_supplicant
  161. # wpa_supplicant -i wlp3s0 -c /etc/wpa_supplicant.conf
  162. Successfully initialized wpa_supplicant
  163. wlp3s0: CTRL-EVENT-SCAN-STARTED
  164. wlp3s0: SME: Trying to authenticate with 00:22:55:de:52:60 (SSID='MyWifi3' freq=2427 MHz)
  165. wlp3s0: Trying to associate with 00:22:55:de:52:60 (SSID='MyWifi3' freq=2427 MHz)
  166. wlp3s0: Associated with 00:22:55:de:52:60
  167. wlp3s0: WPA: Key negotiation completed with 00:22:55:de:52:60 [PTK=TKIP GTK=TKIP]
  168. wlp3s0: CTRL-EVENT-CONNECTED - Connection to 00:22:55:de:52:60 completed [id=0 id_str=]
  169. [...]
  170.  
  171. # ip addr
  172. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
  173.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  174.     inet 127.0.0.1/8 scope host lo
  175.        valid_lft forever preferred_lft forever
  176.     inet6 ::1/128 scope host
  177.        valid_lft forever preferred_lft forever
  178. 2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
  179.     link/ether 00:22:68:1c:fb:cc brd ff:ff:ff:ff:ff:ff
  180. 3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
  181.     link/ether 00:26:c6:8a:11:b6 brd ff:ff:ff:ff:ff:ff
  182.     inet 10.0.0.11/24 brd 10.0.0.255 scope global wlp3s0
  183.        valid_lft forever preferred_lft forever
  184.     inet6 fe80::226:c6ff:fe8a:11b6/64 scope link
  185.        valid_lft forever preferred_lft forever
  186.  
  187.  
  188. # ping 206.13.31.12
  189. PING 206.13.31.12 (206.13.31.12) 56(84) bytes of data.
  190. 64 bytes from 206.13.31.12: icmp_seq=1 ttl=237 time=85.3 ms
  191. 64 bytes from 206.13.31.12: icmp_seq=2 ttl=237 time=85.1 ms
  192.  
  193. [8] Try Recommendation to manually bring the interface DOWN then back up with Netctl
  194. # ip link set wlp3s0 down
  195. [root@MasterShake netctl]# netctl start MyWifi3_wireless_dhcp_wpa
  196. // THIS ACTUALLY TAKES SOME TIME... LIKE NORMAL, BUT STILL ENTERS FAILED STATE:
  197. Job for netctl@MyWifi3_wireless_dhcp_wpa.service failed. See 'systemctl status netctl@MyWifi3_wireless_dhcp_wpa.service' and 'journalctl -xn' for details.
  198.  
  199. # journalctl -xn
  200. -- Logs begin at Tue 2013-12-17 13:19:59 EST, end at Mon 2014-03-17 11:25:17 EST. --
  201. Mar 17 11:25:16 MasterShake network[634]: Failed to connect to non-global ctrl_ifname: wlp3s0  error: No such file or directory
  202. Mar 17 11:25:17 MasterShake kernel: wlp3s0: deauthenticating from 00:22:55:de:52:60 by local choice (reason=3)
  203. Mar 17 11:25:17 MasterShake kernel: cfg80211: Calling CRDA to update world regulatory domain
  204. Mar 17 11:25:17 MasterShake dhcpcd[323]: wlp3s0: carrier lost
  205. Mar 17 11:25:17 MasterShake dhcpcd[323]: wlp3s0: deleting route to 10.0.0.0/24
  206. Mar 17 11:25:17 MasterShake dhcpcd[323]: wlp3s0: deleting default route via 10.0.0.1
  207. Mar 17 11:25:17 MasterShake systemd[1]: netctl@MyWifi3_wireless_dhcp_wpa.service: main process exited, code=exited, status=1/FAILURE
  208. Mar 17 11:25:17 MasterShake systemd[1]: Failed to start MyWifi3 wpa_supplicant configuration file based wireless connection.
  209. -- Subject: Unit netctl@MyWifi3_wireless_dhcp_wpa.service has failed
  210. -- Defined-By: systemd
  211. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  212. --
  213. -- Unit netctl@MyWifi3_wireless_dhcp_wpa.service has failed.
  214. --
  215. -- The result is failed.
  216. Mar 17 11:25:17 MasterShake systemd[1]: Unit netctl@MyWifi3_wireless_dhcp_wpa.service entered failed state.
  217. Mar 17 11:25:17 MasterShake network[634]: Failed to bring the network up for profile 'MyWifi3_wireless_dhcp_wpa'
  218.  
  219.  
  220. [9] Search on "Failed to connect to non-global ctrl_ifname: wlp3s0  error: No such file or directory"
  221. [url=https://bbs.archlinux.org/viewtopic.php?id=173038]
  222.  
  223. "...I think you just need to decide how you want to manage it. Pick ONE management option: netctl etc. would be one option; wicd would be another option. I don't think merely disabling wicd's wired profile is really going to work - you still have two things trying to manage dhcpd etc. and it is just asking for trouble. Pick one and work with that. Disable everything else. (Including: do not start dhcpd directly with systemctl - let the tool you pick manage it as it will try to anyway..)
  224. The more is the miserable where wifi management is concerned. Less is more so enjoy."
  225.  
  226. [9.1] Check if dhcpcd is already up.
  227.  
  228. Show the status of a unit, including whether it is running or not:
  229. $ systemctl status unit
  230.  
  231. # systemctl status dhcpcd
  232. dhcpcd.service - dhcpcd on all interfaces
  233.    Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; enabled)
  234.    Active: active (running) since Mon 2014-03-17 11:42:49 EST; 2min 0s ago
  235.   Process: 315 ExecStart=/usr/bin/dhcpcd -q -b (code=exited, status=0/SUCCESS)
  236.  Main PID: 322 (dhcpcd)
  237.    CGroup: /system.slice/dhcpcd.service
  238.            └─322 /usr/bin/dhcpcd -q -b
  239.  
  240. Mar 17 11:42:51 MasterShake dhcpcd[322]: enp0s25: waiting for carrier
  241. Mar 17 11:42:51 MasterShake dhcpcd[322]: wlp3s0: waiting for carrier
  242. Mar 17 11:42:51 MasterShake dhcpcd[322]: wlp3s0: carrier acquired
  243. Mar 17 11:42:51 MasterShake dhcpcd[322]: wlp3s0: carrier lost
  244. Mar 17 11:42:58 MasterShake dhcpcd[322]: wlp3s0: waiting for carrier
  245.  
  246. [9.2] Ok. According to the advice @9, disable dhcpcd
  247.  
  248. # systemctl stop dhcpcd
  249. # systemctl status dhcpcd
  250. dhcpcd.service - dhcpcd on all interfaces
  251.    Loaded: loaded (/usr/lib/systemd/system/dhcpcd.service; enabled)
  252.    Active: failed (Result: exit-code) since Mon 2014-03-17 11:45:14 EST; 1s ago
  253.   Process: 552 ExecStop=/usr/bin/dhcpcd -x (code=exited, status=0/SUCCESS)
  254.   Process: 315 ExecStart=/usr/bin/dhcpcd -q -b (code=exited, status=0/SUCCESS)
  255.  
  256.  Main PID: 322 (code=exited, status=1/FAILURE)
  257.  
  258. Mar 17 11:42:51 MasterShake dhcpcd[322]: wlp3s0: waiting for carrier
  259. Mar 17 11:42:51 MasterShake dhcpcd[322]: wlp3s0: carrier acquired
  260. Mar 17 11:42:51 MasterShake dhcpcd[322]: wlp3s0: carrier lost
  261. Mar 17 11:42:58 MasterShake dhcpcd[322]: wlp3s0: waiting for carrier
  262. Mar 17 11:45:14 MasterShake systemd[1]: Stopping dhcpcd on all interfac....
  263. Mar 17 11:45:14 MasterShake systemd[1]: dhcpcd.service: main process ex...E
  264. Mar 17 11:45:14 MasterShake systemd[1]: Stopped dhcpcd on all interfaces.
  265. Mar 17 11:45:14 MasterShake systemd[1]: Unit dhcpcd.service entered fai....
  266. Mar 17 11:45:14 MasterShake dhcpcd[552]: dhcpcd[552]: sending signal 15...2
  267. Mar 17 11:45:14 MasterShake dhcpcd[552]: dhcpcd[552]: waiting for pid 3...t
  268. Hint: Some lines were ellipsized, use -l to show in full.
  269.  
  270. [9.3] Set the link down
  271. # ip link set wlp3s0 down
  272.  
  273.  
  274. [9.4] Try to bring it back up with netctl
  275. # netctl start TooterTurtle_wireless_dhcp_wpa
  276. Job for netctl@TooterTurtle_wireless_dhcp_wpa.service failed. See 'systemctl status netctl@TooterTurtle_wireless_dhcp_wpa.service' and 'journalctl -xn' for details.
  277.  
  278. [9.5] Check error log
  279. # journalctl -xn
  280. -- Logs begin at Tue 2013-12-17 13:19:59 EST, end at Mon 2014-03-17 11:46:23 EST. --
  281. Mar 17 11:46:21 MasterShake network[575]: Failed to connect to non-global ctrl_ifname: wlp3s0  error: No such file or directory
  282. Mar 17 11:46:21 MasterShake network[575]: WPA association/authentication failed for interface 'wlp3s0'
  283. Mar 17 11:46:21 MasterShake network[575]: Failed to connect to non-global ctrl_ifname: wlp3s0  error: No such file or directory
  284. Mar 17 11:46:21 MasterShake network[575]: Failed to connect to non-global ctrl_ifname: wlp3s0  error: No such file or directory
  285. Mar 17 11:46:22 MasterShake kernel: wlp3s0: deauthenticating from 00:22:55:de:52:60 by local choice (reason=3)
  286. Mar 17 11:46:22 MasterShake kernel: cfg80211: Calling CRDA to update world regulatory domain
  287. Mar 17 11:46:22 MasterShake network[575]: Failed to bring the network up for profile 'MyWifi3_wireless_dhcp_wpa'
  288. Mar 17 11:46:22 MasterShake systemd[1]: netctl@MyWifi3_wireless_dhcp_wpa.service: main process exited, code=exited, status=1/FAILURE
  289. Mar 17 11:46:22 MasterShake systemd[1]: Failed to start MyWifi3 wpa_supplicant configuration file based wireless connection.
  290. -- Subject: Unit netctl@MyWifi3_wireless_dhcp_wpa.service has failed
  291. -- Defined-By: systemd
  292. -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
  293. --
  294. -- Unit netctl@MyWifi3_wireless_dhcp_wpa.service has failed.
  295.  
  296.  
  297. [10] More systemctl commands
  298. [url=http://www.archlinux.org/systemctl]
  299.  
  300. Activate a unit immediately:
  301. # systemctl start unit
  302.  
  303. Deactivate a unit immediately:
  304. # systemctl stop unit
  305.  
  306. Enable a unit to be started on bootup:
  307. # systemctl enable unit
  308.  
  309. Disable a unit to not start during bootup:
  310. # systemctl disable unit
  311.  
  312. +++
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement