Difference between revisions of "Talk:Netctl"

From ArchWiki
Jump to: navigation, search
(Altering a currently enabled profile: reenable command readded)
(List known conflicting network managers: re)
 
(63 intermediate revisions by 19 users not shown)
Line 1: Line 1:
== Altering a currently enabled profile ==
+
== Explain WPAConfigSection ==
  
Concerning this note:
+
It would be nice if there were an additional example using {{ic|1=Security=wpa-configsection}} that explained each line in the example ({{ic|/etc/netctl/examples/wireless-wpa-configsection}}). I'd imagine I'm not the first person discouraged from using netctl-auto because of this. -- [[User:RyneEverett|Ryne Everett]] ([[User talk:RyneEverett|talk]]) 16:28, 21 June 2015 (UTC)
{{Note|
 
* If there is ever a need to alter a currently enabled profile, execute {{ic|netctl reenable <profile>}} to apply the changes.
 
* ''interface'' is hardware minus, e.g netctl-auto@wlan0.service or netctl-auto@enp2s0.service
 
}}
 
I find the second line in this note confusing, and the first line may be unnecessary. I found myself having to reboot my system to get any wireless profile changes to take effect. Through trial and error, I finally figured out the command {{ic|systemctl restart netctl-auto@<interface>.service}} allows the changes to take effect without requiring a reboot. Further, it appears that the command {{ic|netctl reenable <profile>}} is not necessary to achieve these results; although, some profile modifications did require that I issue the {{ic|systemctl restart netctl-auto@<interface>.service}} command twice before my wireless Internet connection would come back up. Has anyone else observed this?
 
[[User:Mc33|Mc33]] ([[User talk:Mc33|talk]]) 04:59, 17 July 2013 (UTC)
 
  
: From netctl(1):
+
:As stated in the [https://projects.archlinux.org/netctl.git/tree/docs/netctl.profile.5.txt#n281 netctl.profile(5)] man page, the {{ic|WPAConfigSection}} variable is an array of config lines passed to [[wpa_supplicant]]. See [http://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf example wpa_supplicant.conf] (shipped with the Arch package at {{ic|/etc/wpa_supplicant/wpa_supplicant.conf}}) for detailed explanation. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 19:20, 21 June 2015 (UTC)
:{{bc|<nowiki>reenable [PROFILE]
 
    Reenable the systemd unit for the profile specified. This is effectively a combination of ‘disable’ and ‘enable’.</nowiki>}}
 
: So I'd say the first line of the note is absolutely incorrect. I think your command {{ic|systemctl restart netctl-auto@<interface>.service}} should be listed instead, and we should probably add simple {{ic|netctl restart <profile>}} too in case people don't use {{ic|netctl-auto@.service}}. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:45, 17 July 2013 (UTC)
 
  
::On the contrary, the {{ic|reenable}} command is correct. But it applies to specific profiles, not to {{ic|netctl-auto}}. [[User:Halosghost|Halosghost]] ([[User talk:Halosghost|talk]]) 12:32, 17 July 2013 (UTC)
+
::Thanks, I wouldn't have guessed that would be the file to explain those values. If/When I figure it out I may add an additional example section explaining just the required values. (Surely all 10 in the example aren't required?) This is too common of a need (required for netctl-auto) to require so much studying. -- [[User:RyneEverett|Ryne Everett]] ([[User talk:RyneEverett|talk]]) 19:38, 21 June 2015 (UTC)
  
::: Right, it does not apply to {{ic|netctl-auto}}, my mistake... But my point is, that it does not manipulate currently running processes, it only deletes & re-creates some symlink. To actually apply changes to some profile, you need to {{ic|netctl restart <profile>}}. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 13:05, 17 July 2013 (UTC)
+
:::Remember that you are configuring ''wpa_supplicant'', not ''netctl'', so the info belongs to [[WPA supplicant]] (it may already be there). -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 20:27, 21 June 2015 (UTC)
  
::::I've re-added the ''reenable'' command: [https://wiki.archlinux.org/index.php?title=Netctl&diff=275702&oldid=275546] -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:18, 15 September 2013 (UTC)
+
== DHCP clients ==
  
: Regarding the second line, I have absolutely no idea of what does ''interface is hardware minus'' mean... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:45, 17 July 2013 (UTC)
+
I had the problem described under "Job for netctl@wlan(...).service failed", and changing my netctl profiles to use dhclient solved it. My {{ic|/etc/dhcpcd.conf}} was unchanged from the version in the package, and my {{ic|/etc/dhclient.conf}} was based on {{ic|/usr/share/dhclient/dhclient.conf.example}} from the dhclient client package. These request different options from the DHCP server:
 +
{{hc|/etc/dhcpcd.conf|
 +
...
 +
# Rapid commit support.
 +
# Safe to enable by default because it requires the equivalent option set
 +
# on the server to actually work.
 +
option rapid_commit
  
:I've removed the note as it's not related to that section, it's confusing etc. If someone wants it, feel free to expand and clarify it and put it back. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 16:49, 25 July 2013 (UTC)
+
# A list of options to request from the DHCP server.
 +
option domain_name_servers, domain_name, domain_search, host_name
 +
option classless_static_routes
 +
# Most distributions have NTP support.
 +
option ntp_servers
 +
# Respect the network MTU. This is applied to DHCP routes.
 +
option interface_mtu
  
== My working eduroam config (with TimeoutDHCP and anonymous identity) ==
+
# A ServerID is required by RFC2131.
 +
require dhcp_server_identifier}}
 +
and
 +
{{hc|/etc/dhclient.conf|
 +
...
 +
request subnet-mask, broadcast-address, time-offset, routers,
 +
domain-name, domain-name-servers, host-name;
 +
require subnet-mask, domain-name-servers;}}
 +
I removed {{ic|1=DHCPClient='dhclient'}} from my netctl profiles, and made dhcpcd request the extra options by adding
 +
{{bc|option subnet_mask, broadcast_address, time_offset, routers}}
 +
to {{ic|/etc/dhcpcd.conf}}, and netctl works O.K. with dhcpcd as the DHCP client.
  
 +
I don't know why requesting the extra options should make a difference, and I haven't tried any tests to see which of them are necessary.--[[User:Pdc|Pdc]] ([[User talk:Pdc|talk]]) 19:41, 25 August 2015 (UTC)
  
Description='eduroam for <your username>'
+
== How to resolve "The interface of network profile '' is already up" permanently ==
Interface=wlp2s0
 
Connection=wireless
 
Security=wpa-configsection
 
TimeoutDHCP=60
 
IP=dhcp
 
WPAConfigSection=(
 
        'ssid="eduroam"'
 
        'proto=RSN'
 
        'key_mgmt=WPA-EAP'
 
        'pairwise=CCMP'
 
        'auth_alg=OPEN'
 
        'eap=TTLS'
 
        'identity="<your username>@tu-chemnitz.de"'
 
        'password="<your password>"'
 
        'anonymous_identity="anonymous@tu-chemnitz.de"'
 
        'priority=2'
 
        'phase2="auth=PAP"'
 
)
 
  
This /etc/netctl/eduroam works for me. Maybe someone should update the main article?! Thank you!
+
I'm getting this when trying to run `sudo netctl start wlpNsM-SSID` after unplugging the Ethernet cable. This right after a reboot and login. How do I get Wi-Fi to ''just work'' after unplugging my Ethernet cable?
  
: I'd certainly not replace the current config in [[netctl#Eduroam]]. I have another, different config, but several people had trouble with connecting in Prague using my profile, so I think it's very specific. Perhaps separate page would be better, when there are more configs. But more information would be needed, the page can't be just set of different configs... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:55, 14 August 2013 (UTC)
+
PS: Whenever I get this error I've checked the state of the Wi-Fi interface just afterwards, and it was always '''down''', so I'm very surprised the workaround even works.
  
== What is the first command used to set up netctl? ==
+
[[User:L0b0|L0b0]] ([[User talk:L0b0|talk]]) 03:40, 20 March 2018 (UTC)
  
"''Once you have created your profile, make an attempt to establish a connection using the newly created profile by running:''"
+
== List known conflicting network managers ==
    '''# netctl start profile'''
 
  
Shouldn't the command be enable? From the man page:
+
Looking at a list of dozens of service names it's hard to know which, if any, conflict with netctl. It would be good if this page mentioned at least the most common culprits, such as NetworkManager. -- [[User:L0b0|L0b0]] ([[User talk:L0b0|talk]]) 20:30, 4 April 2018 (UTC)
  
  start [PROFILE]
+
:See [[:Category:Network managers]] for the few names known to the wiki, but really, ''any'' network management programs or user scripts would conflict. I don't see a point of adding a list which would be incomplete anyway. Ultimately the user should know what's running on his system. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 21:12, 4 April 2018 (UTC)
          Start the network profile specified on the command line.
 
  
  enable [PROFILE]
+
::Obviously any service could conflict with any other service. And knowing what is running is very different from knowing whether any of the things conflict. "Warning: Do not enable concurrent, conflicting network services" is only helpful if the user has some way of figuring out what constitutes a conflicting network service. By the way, did you mean [[:Category:Network_configuration]]? -- [[User:L0b0|L0b0]] ([[User talk:L0b0|talk]]) 21:43, 4 April 2018 (UTC)
          Enable the systemd unit for the profile specified. This will create
 
          a unit configuration file. If the file already exists, the command
 
          fails. No other profiles than the one specified will be enabled.
 
          Changes to the general options in a profile specification will not
 
          propagate to the unit configuration file automatically. After such
 
          changes, it is necessary to ‘reenable’ the profile.
 
  
[[User:Xtian|Xtian]] ([[User talk:Xtian|talk]]) 15:49, 15 September 2013 (UTC)
+
:::Yes, that's the category, sorry for the mistake. Part of knowing what's running is knowing what services manage network - that's what the warning says to look for. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 22:18, 4 April 2018 (UTC)
  
:The command is correct, you can start disabled profile. Disabled means just that it will not start automatically at boot. -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 18:11, 15 September 2013 (UTC)
+
:::The warning also states "Use systemctl --type=service to ensure that no other network service is running before enabling a netctl profile/service". Seems pretty clear to me that it means no other network daemon should be running. See also [[Network configuration#Network managers]].  -- [[User:Rdeckard|Rdeckard]] ([[User_talk:Rdeckard|talk]]) 22:21, 4 April 2018 (UTC)

Latest revision as of 22:21, 4 April 2018

Explain WPAConfigSection

It would be nice if there were an additional example using Security=wpa-configsection that explained each line in the example (/etc/netctl/examples/wireless-wpa-configsection). I'd imagine I'm not the first person discouraged from using netctl-auto because of this. -- Ryne Everett (talk) 16:28, 21 June 2015 (UTC)

As stated in the netctl.profile(5) man page, the WPAConfigSection variable is an array of config lines passed to wpa_supplicant. See example wpa_supplicant.conf (shipped with the Arch package at /etc/wpa_supplicant/wpa_supplicant.conf) for detailed explanation. -- Lahwaacz (talk) 19:20, 21 June 2015 (UTC)
Thanks, I wouldn't have guessed that would be the file to explain those values. If/When I figure it out I may add an additional example section explaining just the required values. (Surely all 10 in the example aren't required?) This is too common of a need (required for netctl-auto) to require so much studying. -- Ryne Everett (talk) 19:38, 21 June 2015 (UTC)
Remember that you are configuring wpa_supplicant, not netctl, so the info belongs to WPA supplicant (it may already be there). -- Lahwaacz (talk) 20:27, 21 June 2015 (UTC)

DHCP clients

I had the problem described under "Job for netctl@wlan(...).service failed", and changing my netctl profiles to use dhclient solved it. My /etc/dhcpcd.conf was unchanged from the version in the package, and my /etc/dhclient.conf was based on /usr/share/dhclient/dhclient.conf.example from the dhclient client package. These request different options from the DHCP server:

/etc/dhcpcd.conf
...
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

and

/etc/dhclient.conf
...
request subnet-mask, broadcast-address, time-offset, routers,
	domain-name, domain-name-servers, host-name;
require subnet-mask, domain-name-servers;

I removed DHCPClient='dhclient' from my netctl profiles, and made dhcpcd request the extra options by adding

option subnet_mask, broadcast_address, time_offset, routers

to /etc/dhcpcd.conf, and netctl works O.K. with dhcpcd as the DHCP client.

I don't know why requesting the extra options should make a difference, and I haven't tried any tests to see which of them are necessary.--Pdc (talk) 19:41, 25 August 2015 (UTC)

How to resolve "The interface of network profile '…' is already up" permanently

I'm getting this when trying to run `sudo netctl start wlpNsM-SSID` after unplugging the Ethernet cable. This right after a reboot and login. How do I get Wi-Fi to just work after unplugging my Ethernet cable?

PS: Whenever I get this error I've checked the state of the Wi-Fi interface just afterwards, and it was always down, so I'm very surprised the workaround even works.

L0b0 (talk) 03:40, 20 March 2018 (UTC)

List known conflicting network managers

Looking at a list of dozens of service names it's hard to know which, if any, conflict with netctl. It would be good if this page mentioned at least the most common culprits, such as NetworkManager. -- L0b0 (talk) 20:30, 4 April 2018 (UTC)

See Category:Network managers for the few names known to the wiki, but really, any network management programs or user scripts would conflict. I don't see a point of adding a list which would be incomplete anyway. Ultimately the user should know what's running on his system. -- Lahwaacz (talk) 21:12, 4 April 2018 (UTC)
Obviously any service could conflict with any other service. And knowing what is running is very different from knowing whether any of the things conflict. "Warning: Do not enable concurrent, conflicting network services" is only helpful if the user has some way of figuring out what constitutes a conflicting network service. By the way, did you mean Category:Network_configuration? -- L0b0 (talk) 21:43, 4 April 2018 (UTC)
Yes, that's the category, sorry for the mistake. Part of knowing what's running is knowing what services manage network - that's what the warning says to look for. -- Lahwaacz (talk) 22:18, 4 April 2018 (UTC)
The warning also states "Use systemctl --type=service to ensure that no other network service is running before enabling a netctl profile/service". Seems pretty clear to me that it means no other network daemon should be running. See also Network configuration#Network managers. -- Rdeckard (talk) 22:21, 4 April 2018 (UTC)