VLAN on Bond Interface

Issues related to configuring your network
harris7139
Posts: 2
Joined: 2016/02/04 14:43:30

VLAN on Bond Interface

Postby harris7139 » 2016/02/04 14:49:55

I have 2x NICs bonded together and am looking to put a VLAN subinterface on the bond group (bond0.25). After creating the config files, I restart networking and get the following error message: "Bringing up interface bond0.25: Error: Connection activation failed: No suitable device found for this connection."

I've tried multiple different config variations, but have been unable to correct the issue. Any help or guidance would be appreciated.

Below are configs for each of the interfaces:

ifcfg-enp2s0f0

Code: Select all

BOOTPROTO=none
NM_CONTROLLED=no
USERCTL=no
DEVICE="enp2s0f0"
ONBOOT="yes"
MASTER=bond0
SLAVE=yes
HWADDR=d8:d3:85:e6:95:0c


ifcfg-enp2s0f1

Code: Select all

BOOTPROTO=none
NM_CONTROLLED=no
DEVICE="enp2s0f1"
USERCTL=no
ONBOOT="yes"
MASTER=bond0
SLAVE=yes
HWADDR=d8:d3:85:e6:95:0d


bond0

Code: Select all

DEVICE=bond0
TYPE=Unknown
#NAME=bond0
#BONDING_MASTER=yes
BOOTPROTO=none
ONBOOT=yes
IPADDR=10.50.6.2
NETMASK=255.0.0.0
GATEWAY=10.50.0.1
BONDING_OPTS="mode=4 miimon=100"
IPV6INIT=no
NM_CONTROLLED=no
USERCTL=no


bond0.25

Code: Select all

DEVICE=bond0.25
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
VLAN=yes
USERCTL=no
IPADDR=172.25.4.51
PREFIX=24

aks
Posts: 2426
Joined: 2014/09/20 11:22:14

Re: VLAN on Bond Interface

Postby aks » 2016/02/04 16:22:41

I've never done this, so I don't know.

But this may be of interest:
In the case of VLANs over bonds, it is important that the bond has slaves and that they are “up” before bringing up the VLAN interface. At the time of writing, adding a VLAN interface to a bond without slaves does not work.

Source: https://access.redhat.com/documentation ... gging.html

User avatar
jlehtone
Posts: 1702
Joined: 2007/12/11 08:17:33
Location: Finland

Re: VLAN on Bond Interface

Postby jlehtone » 2016/02/04 23:36:38

I did use nmcli to create (and edit) all connections. I have no service network running. Some of the files:

Code: Select all

# cat ifcfg-bond-bond0
DEVICE=bond0
TYPE=Bond
BONDING_MASTER=yes
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=bond-bond0
UUID=3fe838b0-6d68-4747-8be0-57c89aacab20
ONBOOT=yes
BONDING_OPTS=mode=802.3ad


Code: Select all

# cat ifcfg-bond-slave-enp8s1
TYPE=Ethernet
NAME=bond-slave-enp8s1
UUID=d5dd1420-529a-4d6d-8a3f-c6199cbf02d5
DEVICE=enp8s1
ONBOOT=yes
MASTER=bond0
SLAVE=yes


Code: Select all

# cat ifcfg-vlan-666
VLAN=yes
TYPE=Vlan
DEVICE=666
PHYSDEV=bond0
VLAN_ID=666
REORDER_HDR=0
BOOTPROTO=none
IPV4_FAILURE_FATAL=no
IPV6INIT=no
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=vlan-666
UUID=016e4f65-85fc-466e-9f7a-5224680ade57
ONBOOT=yes
BRIDGE=22e7c1ed-f24b-4c98-9b9f-2a996b437ce2

(The last line hints that there is more than just VLAN, but that is an another story.)

The most striking difference (in my eyes) is in the TYPE variables. Even the network service's ifup*-scripts do use at that.

harris7139
Posts: 2
Joined: 2016/02/04 14:43:30

Re: VLAN on Bond Interface

Postby harris7139 » 2016/02/08 14:23:36

Thanks for the input and suggestions. It ended up being that Network Manager was trying to bring up the bonded VLAN interface while the physical interfaces and bond itself were being managed outside of Network Manager. Adding NM_CONTROLLED=no to the bonded VLAN ifcfg file fixed the problem and all is well. Much appreciated!

jannoke
Posts: 2
Joined: 2016/09/20 17:12:11

Re: VLAN on Bond Interface

Postby jannoke » 2017/01/10 09:43:56

Same problem here. Thanks for the solution.
Added NM_CONTROLLED="no" and it fixedit.

krisr
Posts: 2
Joined: 2012/02/16 21:41:05

Re: VLAN on Bond Interface

Postby krisr » 2017/01/26 12:03:39

I have similar problem and can't find solution. A server talks via switch to the iSCSI(dual) NAS.
All IFs are defined with NM_CONTROLLED="no". The ports on switch, that are used by both links, are
trunked and untagged in VLAN1 and tagged in VLAN42. NAS's ports are untagged in VLAN42.

The physical devices ens4f0 and ens4f1 have following configuration (only one here):

Code: Select all

# cat ifcfg-ens4f0
NM_CONTROLLED=no
TYPE=Ethernet
BOOTPROTO=none
NAME=ens4f0
UUID=726c73c9-ebad-4d70-9b39-a0b453f7f2de
DEVICE=ens4f0
ONBOOT=yes
hwaddr=2c:59:e5:7c:84:70
MASTER=bond0
SLAVE=yes


The bond0 works (checked with data transfer from server to one of nodes in 192.168.1.0 net). It's defined as:

Code: Select all

# cat ifcfg-bond0
NM_CONTROLLED=no
DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.1.243
NETMASK=255.255.255.0
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=4 miimon=100"


Bond0.42 should work in VLAN 42:

Code: Select all

# cat ifcfg-bond0.42
NM_CONTROLLED=no
VLAN=yes
TYPE=Vlan
DEVICE=bond0.42
PHYSDEV=bond0
VLAN_ID=42
BOOTPROTO=none
IPADDR=192.168.2.241
PREFIX=24
NETWORK=192.168.2.0
NAME=bond0.42
UUID=a8a3413d-c350-4897-9ae8-0b002b216a5a
ONBOOT=yes


When I try to activate bond0.42 following error comes :

Code: Select all

# ifup bond0.42
RTNETLINK answers: File exists
ERROR    : [/usr/sbin/ifup] ERROR: could not add vlan 42 as bond0.42 on dev bond0


I tried a lot of things to no avail. As always any help would be highly appreciated.

p.s.
even more frustrating is that similar configuration in CentOS 5.11 worked.

User avatar
jlehtone
Posts: 1702
Joined: 2007/12/11 08:17:33
Location: Finland

Re: VLAN on Bond Interface

Postby jlehtone » 2017/01/26 20:57:14

krisr wrote:even more frustrating is that similar configuration in CentOS 5.11 worked.

I'm afraid that "we are not in Kansas any more". The network.service [scripts] have been modified [in el6 and el7] to live with the NetworkManager.


I'd say that the name of the game is "All or Nothing":

* If one sticks with network.service, then I would 'yum remove *NetworkManager*' to be sure that there is only one player in town. Consequently, there should be no need for 'NM_CONTROLLED=no' if there is not even a trace of NM in the system. (At least in el6 the scripts were so.)

* If one leaps to NM, then one should 'systemctl disable network.service' and do all configuration with the nmcli (as I have done). Retrospectively, I probably should not have posted those ifcfg-files a year ago and rather concentrate on the output of nmcli.

* If one has more than one VLAN on same wire, then prefer to tag each of them. It is much more clear to have an addressless bond and two VLAN interfaces: bond0.1 and bond0.42.

User avatar
TrevorH
Forum Moderator
Posts: 19449
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: VLAN on Bond Interface

Postby TrevorH » 2017/01/26 20:58:46

The bond0.25 ifcfg file should probably have ONPARENT=yes not ONBOOT=yes
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke


Return to “CentOS 7 - Networking Support”

Who is online

Users browsing this forum: No registered users and 0 guests