You are not logged in.

#1 2013-09-24 19:26:49

phatfish
Member
From: England
Registered: 2013-04-21
Posts: 5

netctl multiple interfaces/profiles not working

Hi,

I have just installed a fresh system, just base at the moment. I am trying to bring up two wired interfaces at boot with netctl. Sounds a pretty basic thing to do smile

However i am having (and have had on a previous test install) a lot of trouble doing this.

This appears to be perfectly acceptable thing to do, from the wiki (https://wiki.archlinux.org/index.php/Ne … sic_method)

"With this method, you can statically start only one profile per interface. First manually check that the profile can be started successfully, then it can be enabled using..."

Here are the two profiles:

/etc/netctl/wired0

Description='Primary interface'
Interface=enp2s0
Connection=ethernet
IP=static
Address=('192.168.1.100/24')
Gateway='192.168.1.1'
DNS=('192.168.1.1')
SkipNoCarrier=yes

/etc/netctl/wired1

Description='Secondary Interface'
Interface=enp3s0
Connection=ethernet
IP=static
Address=('192.168.1.101/24')
Gateway='192.168.1.1'
DNS=('192.168.1.1')
SkipNoCarrier=yes

Each profile will start fine individually, but trying to start them together will produce the following error:

Sep 24 18:50:38 localhost network[339]: Starting network profile 'wired1'...
Sep 24 18:50:38 localhost network[339]: RTNETLINK answers: File exists
Sep 24 18:50:38 localhost network[339]: Could not set gateway '192.168.1.1' on interface 'enp3s0'
Sep 24 18:50:38 localhost systemd[1]: netctl@wired1.service: main process exited, code=exited, status=1/FAILURE
Sep 24 18:50:38 localhost systemd[1]: Failed to start Networking for netctl profile wired1.
Sep 24 18:50:38 localhost systemd[1]: Unit netctl@wired1.service entered failed state.

An error that doesn't make any sense to me. Is anyone else running this setup? I don't think I'm being stupid and missing something obvious, but it seems that some core functionality is broken here that i would expect to be working, so maybe i am smile

Thanks!

Last edited by phatfish (2013-09-25 19:50:21)

Offline

#2 2013-09-24 20:09:43

andy123
Member
Registered: 2011-11-04
Posts: 169
Website

Re: netctl multiple interfaces/profiles not working

I'm really not a network expert, but I think the "Gateway=" sets the default gateways, of which there can only be one.

So the solution would basically be to only write it (and maybe dns?) in only one of the profiles and not both.


i'm sorry for my poor english wirting skills…

Offline

#3 2013-09-25 08:00:32

phatfish
Member
From: England
Registered: 2013-04-21
Posts: 5

Re: netctl multiple interfaces/profiles not working

Thanks for the reply Andy.

I'm not much of an expert either smile But the Gateway is certainly a per-interface setting as you can have one machine dual-homed on two different network segments. And if one interface went down you are stuck with a second one that is not configured correctly.

I did try removing the Gateway line as a test myself, but then it just raised an error about the Address line instead. Which suggests to me the errors are just a symptom of something else not working right.

Offline

#4 2013-09-29 18:22:34

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: netctl multiple interfaces/profiles not working

Hi,

I had a similar mistake with a different setting. Let's look at the essential part of the journal output:

Sep 24 18:50:38 localhost network[339]: RTNETLINK answers: File exists
Sep 24 18:50:38 localhost systemd[1]: netctl@wired1.service: main process exited, code=exited, status=1/FAILURE

netcfg uses systemd and systemd is (partially) configured via service files. I guess somewhere the netctl@wired1.service uses a command like 'ip addr add ...' or 'ip route add ...'. These commands may fail with 'RTNETLINK answers: File exists' if a routing table was already set up with the ip command. Thus, before executing an 'ip route/addr add ...' command, one may have to use (for example) 'ip addr flush dev enp2s0'. I'm not sure, if 'netctl@wired1.service' is generated automatically, but if not, you could try to modify it.

edit: it may not be necessary to use 'ip addr flush', you just have to make sure, that the systemd service file does not fail when the 'ip addr add ...' command fails.

Last edited by Lord Bo (2013-09-29 18:27:12)

Offline

Board footer

Powered by FluxBB