You are not logged in.

#1 2013-05-09 16:12:46

earlz
Member
Registered: 2010-07-11
Posts: 39

Can't get `netctl start` to work with example eth0-dhcp profile

So I recently decided to go ahead and install netctl. I had netcfg previously. First thing I did was disable my old systemd unit for netcfg after upgrading.

Then I proceeded with using the example profile

cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/eth0-dhcp
netctl start eth0-dhcp

But then, instead of it working, I get an error. I decided to reboot to see if the new kernel would affect it. It didn't. This is the error I got:

[earlz@EarlzWork ~]$ sudo netctl start eth0-dhcp
Job for netctl@eth0\x2ddhcp.service failed. See 'systemctl status netctl@eth0\x2ddhcp.service' and 'journalctl -xn' for details.
[earlz@EarlzWork ~]$ sudo journalctl -xn
-- Logs begin at Fri 2012-11-09 08:25:27 EST, end at Thu 2013-05-09 12:01:20 EDT. --
May 09 12:01:02 EarlzWork sudo[1251]: pam_unix(sudo:session): session opened for user root by (uid=0)
May 09 12:01:02 EarlzWork systemd[1]: Starting Networking for netctl profile eth0-dhcp...
-- Subject: Unit netctl@eth0\x2ddhcp.service has begun with start-up
-- Defined-By: systemd
-- Support: [url]http://lists.freedesktop.org/mailman/listinfo/systemd-devel[/url]
--
-- Unit netctl@eth0\x2ddhcp.service has begun starting up.
May 09 12:01:02 EarlzWork network[1258]: Starting network profile 'eth0-dhcp'...
May 09 12:01:02 EarlzWork network[1258]: The interface of network profile 'eth0-dhcp' is already up
May 09 12:01:02 EarlzWork systemd[1]: netctl@eth0\x2ddhcp.service: main process exited, code=exited, status=1/FAILURE
May 09 12:01:02 EarlzWork systemd[1]: Failed to start Networking for netctl profile eth0-dhcp.
-- Subject: Unit netctl@eth0\x2ddhcp.service has failed
-- Defined-By: systemd
-- Support: [url]http://lists.freedesktop.org/mailman/listinfo/systemd-devel[/url]
-- Documentation: [url]http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d[/url]
--
-- Unit netctl@eth0\x2ddhcp.service has failed.
--
-- The result is failed.
May 09 12:01:02 EarlzWork systemd[1]: Unit netctl@eth0\x2ddhcp.service entered failed state.
May 09 12:01:02 EarlzWork sudo[1251]: pam_unix(sudo:session): session closed for user root
May 09 12:01:20 EarlzWork sudo[1266]: earlz : TTY=pts/0 ; PWD=/home/earlz ; USER=root ; COMMAND=/usr/bin/journalctl -xn
May 09 12:01:20 EarlzWork sudo[1266]: pam_unix(sudo:session): session opened for user root by (uid=0)
[earlz@EarlzWork ~]$ systemctl status netctl@eth0\x2ddhcp.service
netctl@eth0x2ddhcp.service - Networking for netctl profile eth0x2ddhcp
   Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static)
   Active: inactive (dead)
     Docs: man:netctl.profile(5)

Somehow, the service is loaded, but not active. The error message appears to just be that the interface is already up... which doesn't make sense. If I manually use `ifconfig eth0 down` before calling it, then I get

May 09 12:10:12 EarlzWork kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
May 09 12:10:17 EarlzWork network[1335]: No connection on interface 'eth0'
May 09 12:10:17 EarlzWork dhclient[1299]: receive_packet failed on eth0: Network is down
May 09 12:10:17 EarlzWork network[1335]: Failed to bring the network up for profile 'eth0-dhcp'
May 09 12:10:17 EarlzWork systemd[1]: netctl@eth0\x2ddhcp.service: main process exited, code=exited, status=1/FAILURE
May 09 12:10:17 EarlzWork systemd[1]: Failed to start Networking for netctl profile eth0-dhcp.

If I then reenable eth0, then I still get the "is already up" message, despite neither dhclient nor dhcpcd being active. Also, at this point the interface does not have an IP address either.

How do I fix this? Why does it constantly say the interface is already up?

Edit:

I temporarily "fixed" this by using ForceConnect=yes as indicated here: https://github.com/joukewitteveen/netctl/issues/11 However, I think using that is quite a hack, so maybe someone can solve what the underlying cause is

Last edited by earlz (2013-05-09 16:21:28)

Offline

#2 2013-05-09 16:45:22

hotvic
Member
Registered: 2013-02-11
Posts: 107

Re: Can't get `netctl start` to work with example eth0-dhcp profile

First make sure that any dhcp client isn't running:

% ps aux | egrep 'dhcpcd|dhclient'

If any of these is running kill the.

After, put interface in DOWN state:

# ip link set down dev eth0

then restart profile and verify if it start:

# netctl restart eth0-dhcp

This must work, but I don't know what's putting interface in UP state.

Offline

#3 2013-05-09 17:32:08

earlz
Member
Registered: 2010-07-11
Posts: 39

Re: Can't get `netctl start` to work with example eth0-dhcp profile

hotvic wrote:

First make sure that any dhcp client isn't running:

% ps aux | egrep 'dhcpcd|dhclient'

If any of these is running kill the.

After, put interface in DOWN state:

# ip link set down dev eth0

then restart profile and verify if it start:

# netctl restart eth0-dhcp

This must work, but I don't know what's putting interface in UP state.

I did this. neither dhcpcd or dhclient were running through any of this. Also, when I set the link down, then I got the error message "network not ready" discussed in the second error message in my post

Offline

#4 2013-05-09 18:11:52

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

Re: Can't get `netctl start` to work with example eth0-dhcp profile

Probably not related to problem, but you might consider renaming the profile to remove the '-' since '-' has a special meaning to systemd. It's why you're seeing stuff like "netctl@eth0\x2ddhcp.service".

Last edited by alphaniner (2013-05-09 18:12:08)


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

#5 2013-05-09 18:13:37

hotvic
Member
Registered: 2013-02-11
Posts: 107

Re: Can't get `netctl start` to work with example eth0-dhcp profile

Apparently the error occur when it's trying to set IPv6 to UP on interface.

try disable IPv6 on interface and restart profile again, you can disable IPv6 with:

# sysctl -w net.ipv6.conf.eth0.disable_ipv6=1

Last edited by hotvic (2013-05-09 18:14:31)

Offline

#6 2013-05-10 10:24:15

robjk
Member
From: Amsterdam
Registered: 2013-05-10
Posts: 2

Re: Can't get `netctl start` to work with example eth0-dhcp profile

I'm having the same problem with exactly the same error messages whith eth0 up or down respectively.

However adding ForceConnect=yes to the profile doesn't fix it. Also disabling IPv6 with sysctl (re hotviv) has no effect.

My wifi profiles are working fine with netctl start (as well as with netctl-auto on)

Interestingly netctl-ifplugd can establish a connection to eth0 using the ethernet-dhcp profile. But somehow netctl start can't

Offline

#7 2013-05-10 12:10:17

hotvic
Member
Registered: 2013-02-11
Posts: 107

Re: Can't get `netctl start` to work with example eth0-dhcp profile

Try reload module of device and restart profile, you can find module with:

$ lspci -k

look at "Ethernet controller: ...", then reload module:

# modprobe -r <module>
# modprobe <module>

Offline

#8 2013-05-10 22:07:57

robjk
Member
From: Amsterdam
Registered: 2013-05-10
Posts: 2

Re: Can't get `netctl start` to work with example eth0-dhcp profile

Thanks hotvic but that also didn't fix it unfortunately

Offline

#9 2013-05-16 05:17:48

Jeffhunt90
Member
Registered: 2012-11-20
Posts: 8

Re: Can't get `netctl start` to work with example eth0-dhcp profile

Thanks hotvic. This had been giving me days of worry.
I'm using ethernet-static and bringing the card down and restarting using netctl worked.
The permanent solution for me was to disable TWO dhcpcd services. One general one and one on eth0.

Last edited by Jeffhunt90 (2013-05-18 15:10:50)

Offline

#10 2013-08-08 08:23:11

winevalley
Member
Registered: 2013-08-08
Posts: 1

Re: Can't get `netctl start` to work with example eth0-dhcp profile

Jeffhunt90 wrote:

Thanks hotvic. This had been giving me days of worry.
I'm using ethernet-static and bringing the card down and restarting using netctl worked.
The permanent solution for me was to disable TWO dhcpcd services. One general one and one on eth0.

How did you find this two dhcpcd services and how did you disable them?

thank you

Offline

Board footer

Powered by FluxBB