Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

RTNETLINK answers: File exists + ifup: failed to bring up

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
Richard74
Posts: 6
Joined: 2017-09-26 04:58

RTNETLINK answers: File exists + ifup: failed to bring up

#1 Post by Richard74 »

I've got an issue with /etc/network/interfaces. I am using ipv4 and ipv6 with vlans enabled.
Everything seems to be correct and it survives a reboot but syslog gives the next lines:

ifup[964]: RTNETLINK answers: File exists
ifup: failed to bring up enp1s0f0.160

The /etc/network/interfaces config looks like this:

auto enp1s0f0
iface enp1s0f0 inet manual
pre-up ip link set $IFACE allmulticast off
post-up ip link set $IFACE allmulticast off

auto enp1s0f0.160
iface enp1s0f0.160 inet static
address 192.168.160.2
netmask 255.255.255.0

vlan-raw-devices enp1s0f0

pre-up ip link set $IFACE allmulticast off
post-up ip link set $IFACE allmulticast off

iface enp1s0f0.160 inet6 static
address fec0:0:0:1::2/64
vlan-raw-devices enp1s0f0

pre-up ip -6 addr flush dev $IFACE
pre-up ip -6 addr add fec0:0:0:1::2/64 dev enp1s0f0.160

I don't need a (default) gateway in vlan 160 and I need to disable multicast

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#2 Post by p.H »

IIUC, you have

Code: Select all

address fec0:0:0:1::2/64
pre-up ip -6 addr add fec0:0:0:1::2/64 dev enp1s0f0.160
which set the same IPv6 address twice.

Note : site-local addresses in the prefix fec0::/10 have been deprecated and replaced with unique local addresses (ULA) in the prefix fc00::/7.

Richard74
Posts: 6
Joined: 2017-09-26 04:58

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#3 Post by Richard74 »

Hi p.H,

The pre-up doesn't make any difference. I think that it's more a vlan issue.
It seems that the ipv4 interface sets vlan 160 up and the ipv6 interface tries to set the vlan 160 up again.

The ipv6 address is just an example.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#4 Post by p.H »

You are probably right.

There is an old flaw with virtual interfaces such as bridges and VLANs in ifup and ifdown which try to create or delete the interface for each stanza in /etc/network/interfaces. Maybe the flaw rather lies in the scripts installed by other packages such as bridge-utils and vlan which are called by ifup and ifdown to do the actual job which do not check whether the interface already or no longer exists.

Anyway, the simplest workaround is probably to define only one inet or inet6 stanza for the VLAN interface and add the other address with an "up ip addr add..." option in that stanza. No need to create a matching "down ip addr del..." to delete the address, it will be automatically deleted when the interface is deleted.

Richard74
Posts: 6
Joined: 2017-09-26 04:58

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#5 Post by Richard74 »

I have tried to do both stanza with inet or with inet6 with "up ip addr add..." still without success.
To be sure I removed the packages isc-dhcp-client and net-utlils (ifconfig).

It will work but it doesn't satisfy me in the belief that this is the best solution.
Last edited by Richard74 on 2017-09-27 06:57, edited 1 time in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#6 Post by p.H »

The flaw I was talking about has been corrected for VLAN since Jessie. ifup checks whether the VLAN interface already exists and tries to create it only if it does not exist, so it can be called by multiple stanzas without error.

The only way I could trigger the error is to put both the "address" and the "ip -6 addr add" statements in the inet6 stanza.

Richard74
Posts: 6
Joined: 2017-09-26 04:58

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#7 Post by Richard74 »

I am aware of the flaw, but it seems that it is reintroduced.

I did the test with both stanza. The inet stanza generates the same error:

Tested "inet" stanza
======================================
iface enp1s0f0 inet manual
pre-up ip link set $IFACE multicast off
post-up ip link set $IFACE multicast off

auto enp1s0f0.160
iface enp1s0f0.160 inet static
address 192.168.160.2
netmask 255.255.255.0

vlan-raw-devices enp1s0f0 #not necessary, just for adminstration

pre-up ip link set $IFACE multicast off
post-up ip link set $IFACE multicast off

up ip -6 addr add 2001:XXXXXXXX/48 dev $IFACE
====================================================

Richard74
Posts: 6
Joined: 2017-09-26 04:58

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#8 Post by Richard74 »

Richard74 wrote:I am aware of the flaw, but it seems that it is reintroduced.

I did the test with both stanza. The inet stanza generates the same error:

Tested "inet" stanza
======================================
iface enp1s0f0 inet manual
pre-up ip link set $IFACE multicast off
post-up ip link set $IFACE multicast off

auto enp1s0f0.160
iface enp1s0f0.160 inet static
address 192.168.160.2
netmask 255.255.255.0

vlan-raw-device enp1s0f0 #not necessary, just for administration

pre-up ip link set $IFACE multicast off
post-up ip link set $IFACE multicast off

up ip -6 addr add 2001:XXXXXXXX/48 dev $IFACE
====================================================
It seems that I fixed the issue, the working stanza has just a minor change:
auto enp1s0f0.160
iface enp1s0f0.160 inet static
address 192.168.160.2
netmask 255.255.255.0

vlan-raw-device enp1s0f0 #not necessary, just for administration

pre-up ip link set $IFACE multicast off
post-up ip link set $IFACE multicast off

up ip -6 address add 2001:XXXXXXXX/48 dev $IFACE

I can confirm that when using the inet6 stanza,it will break.So just adding ipv6 addressing under the inet stanza will work.
Last edited by Richard74 on 2017-09-27 19:59, edited 1 time in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#9 Post by p.H »

1) The option is vlan-raw-device, not vlan-raw-devices. vlan-raw-devices is just meaningless and ignored.
2) "ip addr" is the same as "ip address". That should not make any difference.
3) On Debian Stretch I tested successfully with both inet and inet6 static stanzas without any error, so there is no need for any "ip -6 addr" hack.
4) The standard prefix length for an IPv6 network is 64, not 48. I do not think that anyone in the world needs such a big address space as /48 in a single network.

Richard74
Posts: 6
Joined: 2017-09-26 04:58

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#10 Post by Richard74 »

1) vlan-raw-devices was a typo, just pointing out to the following statement:
If you name your VLAN interfaces ethX.YYY, then there is no need to specify the vlan-raw-device, as the raw device can be retrieved from the interface name

2) "ip addr" can mean "ip address" or "ip addresslabel" but normally the first is dominant. But in my setup it did make a difference and I don't know why.
3) I tested on two Debian Stretch servers with a fresh install and minimal conf. Can you post your tested config?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: RTNETLINK answers: File exists + ifup: failed to bring u

#11 Post by p.H »

On stretch :

Code: Select all

auto enp0s25
iface enp0s25 inet manual

auto enp0s25.160
iface enp0s25.160 inet static
address 192.168.160.2/24

iface enp0s25.160 inet6 static
address 2001:xxx:xxx:160::2/64

Post Reply