You are not logged in.

#1 2015-04-20 19:49:05

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Netctl does not work but dhcpcd does work ... and I need netctl

I am able to get a network connection using dhcpcd just fine, but I really would like to use netctl.  Below is /etc/netctl/static:

% cat /etc/netctl/static 
Description='ethernet connection'
Interface=enp1s0
Connection=ethernet
IP=static
Address=('192.168.0.200/24')
Gateway='192.168.0.1'
DNS=('192.168.0.1')
TimeoutUp=40
TimeoutCarrier=40

This profile is enabled but when I reboot, I have no network but I do not know why.

% sudo journalctl -u netctl@static
-- Logs begin at Thu 2014-12-18 19:40:28 EST, end at Mon 2015-04-20 15:42:43 EDT. --
Apr 20 12:06:43 gemini systemd[1]: Starting ethernet connection...
Apr 20 12:06:44 gemini network[392]: Starting network profile 'static'...
Apr 20 12:06:49 gemini network[392]: No connection found on interface 'enp1s0' (timeout)
Apr 20 12:06:49 gemini network[392]: Failed to bring the network up for profile 'static'
Apr 20 12:06:49 gemini systemd[1]: netctl@static.service: main process exited, code=exited, status=1/FAILURE
Apr 20 12:06:49 gemini systemd[1]: Failed to start ethernet connection.
Apr 20 12:06:49 gemini systemd[1]: Unit netctl@static.service entered failed state.
Apr 20 12:06:49 gemini systemd[1]: netctl@static.service failed.

If I disable that profile and instead use dhcpcd@enp1s0.service, following a reboot, the network works as expected.

% sudo systemctl status dhcpcd@enp1s0.service
* dhcpcd@enp1s0.service - dhcpcd on enp1s0
   Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2015-04-20 15:08:22 EDT; 40min ago
  Process: 391 ExecStart=/usr/bin/dhcpcd -q -w %I (code=exited, status=0/SUCCESS)
 Main PID: 892 (dhcpcd)
   CGroup: /system.slice/system-dhcpcd.slice/dhcpcd@enp1s0.service
           `-892 /usr/bin/dhcpcd -q -w enp1s0

Apr 20 15:08:15 gemini dhcpcd[391]: enp1s0: carrier acquired
Apr 20 15:08:15 gemini dhcpcd[391]: DUID 00:01:00:01:1a:2b:7d:1a:68:05:ca:09:0e:6a
Apr 20 15:08:15 gemini dhcpcd[391]: enp1s0: IAID ca:09:0e:6a
Apr 20 15:08:15 gemini dhcpcd[391]: enp1s0: soliciting an IPv6 router
Apr 20 15:08:16 gemini dhcpcd[391]: enp1s0: rebinding lease of 192.168.0.200
Apr 20 15:08:22 gemini dhcpcd[391]: enp1s0: leased 192.168.0.200 for 86400 seconds
Apr 20 15:08:22 gemini dhcpcd[391]: enp1s0: adding route to 192.168.0.0/24
Apr 20 15:08:22 gemini dhcpcd[391]: enp1s0: adding default route via 192.168.0.1
Apr 20 15:08:22 gemini systemd[1]: Started dhcpcd on enp1s0.
Apr 20 15:08:29 gemini dhcpcd[892]: enp1s0: no IPv6 Routers available

Any thoughts are welcomed.

Last edited by graysky (2015-04-20 21:21:48)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2015-04-20 21:36:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

If I disable my 'static' profile and enable a 'bridge' profile, netctl is able to bring up the adapter just fine ... why does the static configuration fail?

% cat /etc/netctl/bridge 
Description='lxc bridge'
Interface=br0
Connection=bridge
BindsToInterfaces=('enp1s0')
IP=static
Address=('192.168.0.200/24')
Gateway='192.168.0.1'
DNS=('192.168.0.1')
SkipForwardingDelay=yes
% sudo journalctl -u netctl@bridge
-- Logs begin at Thu 2014-12-18 19:40:28 EST, end at Mon 2015-04-20 17:34:23 EDT. --
Apr 20 17:31:46 gemini systemd[1]: Starting lxc bridge...
Apr 20 17:31:47 gemini network[400]: Starting network profile 'bridge'...
Apr 20 17:31:47 gemini network[400]: RTNETLINK answers: Network is down
Apr 20 17:31:47 gemini network[400]: Started network profile 'bridge'
Apr 20 17:31:47 gemini systemd[1]: Started lxc bridge.

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2015-04-20 21:48:18

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Netctl does not work but dhcpcd does work ... and I need netctl

By default, basic static netctl profiles (but not bridge profiles with static ip, just confirmed) fail if there is no physical connection:

Apr 20 12:06:49 gemini network[392]: No connection found on interface 'enp1s0' (timeout)

You can override this behaviour with 'SkipNoCarrier=yes' in the profile.

Last edited by alphaniner (2015-04-20 21:51:47)


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2015-04-20 21:50:56

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,795
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

What is the output of:

ls -l /etc/netctl/static
ls -l /etc/systemd/system/multi-user.target.wants

Jin, Jîyan, Azadî

Offline

#5 2015-04-20 21:56:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

@alphaniner - Yes, but they network cable is actually connected hmm
@HS -

% ls -l /etc/netctl/static
-rw-r--r-- 1 root root 183 Apr 20 17:29 /etc/netctl/static

% ls -l /etc/systemd/system/multi-user.target.wants | grep netctl
lrwxrwxrwx 1 root root 41 Apr 20 17:29 netctl@static.service -> /etc/systemd/system/netctl@static.service

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2015-04-20 22:01:01

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Netctl does not work but dhcpcd does work ... and I need netctl

Then maybe

       TimeoutUp
           Maximum time, in seconds, to wait for an interface to get up. Defaults to ‘5’.

But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#7 2015-04-20 22:02:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,795
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

Try this:

# chmod 600 /etc/netctl/static

It would be useful to see the entire output of the second command.

Which command are you using to start netctl?


Jin, Jîyan, Azadî

Offline

#8 2015-04-20 22:08:45

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

@alphanier - I set it to 40 but still no change; the bridge comes up right away hmm
@HS - 644 or 600 gives the same result.  I started it via `netctl enable netctl` followed-up by a reboot.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2015-04-20 22:12:30

dcdriving
Member
From: United Kingdom
Registered: 2015-01-20
Posts: 70

Re: Netctl does not work but dhcpcd does work ... and I need netctl

do you have the netctl ifplugd service enabled?

Offline

#10 2015-04-20 22:14:38

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

@dcd - No, shouldn't need it.  I have this setup on many other machines without it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2015-04-21 13:09:21

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Netctl does not work but dhcpcd does work ... and I need netctl

graysky wrote:

@alphanier - ... the bridge comes up right away hmm

Well, bridge profiles don't seem to care at all whether or not the master interface can be brought up, so that's not surprising.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#12 2015-04-21 16:03:45

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Netctl does not work but dhcpcd does work ... and I need netctl

You say you "need netctl" - is there a particular reason for that? If you can be tempted to try an alternative, systemd-networkd is just awesome for static configurations - dhcp too, for that matter.

Offline

#13 2015-04-21 19:27:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

@tomk - Yes, I know other bridge alternatives are out there, but netctl's implementation is so easy smile  I have it working now via a single profile (bridge as described).  I have been using systemd-networkd prior to that.  Is the bridge implementation in there equally good in your experience?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#14 2015-04-22 06:42:04

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Netctl does not work but dhcpcd does work ... and I need netctl

I don't use bridges. You said your static connection wasn't working, hence my networkd suggestion.

Offline

#15 2015-04-22 11:11:54

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,489

Re: Netctl does not work but dhcpcd does work ... and I need netctl

Adding a bridge is always possible, that's why the error does not appear there.

Your "static" profile works just fine here. The only thing I can think of is that you still have some competing (guess: systemctl --type=service lists a systemd-networkd) service running which grabs the interface before netctl starts up.

Offline

#16 2015-04-22 18:59:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,795
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

Strike0 wrote:

The only thing I can think of is that you still have some competing (guess: systemctl --type=service lists a systemd-networkd) service running which grabs the interface before netctl starts up.

If I may, the (full) output of this command will show if any .services are conflicting:

ls -l /etc/systemd/system/multi-user.target.wants

Jin, Jîyan, Azadî

Offline

#17 2015-04-22 19:17:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,697
Website

Re: Netctl does not work but dhcpcd does work ... and I need netctl

% ls -l /etc/systemd/system/multi-user.target.wants
total 0
lrwxrwxrwx 1 root root 40 Nov 29  2013 cpupower.service -> /usr/lib/systemd/system/cpupower.service
lrwxrwxrwx 1 root root 38 Nov 29  2013 cronie.service -> /usr/lib/systemd/system/cronie.service
lrwxrwxrwx 1 root root 40 Sep  7  2014 lighttpd.service -> /usr/lib/systemd/system/lighttpd.service
lrwxrwxrwx 1 root root 42 Nov 29  2013 lm_sensors.service -> /usr/lib/systemd/system/lm_sensors.service
lrwxrwxrwx 1 root root 41 Aug  7  2014 monitorix.service -> /usr/lib/systemd/system/monitorix.service
lrwxrwxrwx 1 root root 41 Apr 20 17:29 netctl@bridge.service -> /etc/systemd/system/netctl@bridge.service
lrwxrwxrwx 1 root root 35 Aug  7  2014 psd.service -> /usr/lib/systemd/system/psd.service
lrwxrwxrwx 1 root root 40 Apr 19 17:08 remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 36 Aug  1  2014 sshd.service -> /usr/lib/systemd/system/sshd.service
lrwxrwxrwx 1 root root 35 Aug  1  2014 ufw.service -> /usr/lib/systemd/system/ufw.service
lrwxrwxrwx 1 root root 40 Aug 15  2014 vncserver@:1.service -> /etc/systemd/system/vncserver@:1.service

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB