2

I'm working on Centos 7.2 kernel version 3.10.0-327.36.3. I'm writing a simple bash script that modifies some network parameters of a server.

I'm trying to remove some interfaces from a linux bridge, but they keep coming back after restarting the network service.

the initial configuration is:

4: enp7s0f2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
master br-MCP state UP qlen 1000 link/ether 00:10:f3:5e:fe:11 brd
ff:ff:ff:ff:ff:ff 
5: enp7s0f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu
1500 qdisc mq master br-MCP state UP qlen 1000 link/ether
00:10:f3:5e:fe:12 brd ff:ff:ff:ff:ff:ff

first I delete the "BRIDGE=br-MCP" line from ifcfg-enp7s0f2 and from ifcfg-enp7s0f3. then I remove the interfaces using brctl tool:

brctl delif br-MCP enp7s0f2
brctl delif br-MCP enp7s0f3

so far everything works as expected. at the end of my script I restart the network service in order to apply other changes I made to other interfaces. after restarting the network service, the interfaces are reattached to the br-MCP bridge.

I tried going through the process manually, same result, after restarting the network service the interfaces reattached to the bridge.

network manager is disabled. the system has an openVswitch running, but it has nothing to do with those 2 interfaces.

what am I missing here? how can I remove the interfaces from the bridge permanently?

best regards, Igal

beeaaver
  • 21
  • 1
  • 2

1 Answers1

-1

A Linux bridge created or deleted by brctl is NOT persistent, meaning that any changes created by brctl will automatically be destroyed upon boot or network service restart. If you would like to make permanent bridge changes, you need to use a separate configuration file in /etc/sysconfig/network-scripts/ifcfg-interface-name Network Interfaces in Centos.

DEVICE=enp7s0f2
TYPE=Ethernet
BRIDGE=br-MCP

You need to delete line BRIDGE=br-MCP from the configuration file.

Gnat
  • 279
  • 1
  • 3
  • hi, as I mentioned in my question "first I delete the "BRIDGE=br-MCP" line from ifcfg-enp7s0f2 and from ifcfg-enp7s0f3". that doesn't do the trick. for some odd reason the interface is reattached to the bridge after restarting network service. only system reboot solves the problem, but I'm looking for a way to avoid reboot – beeaaver Dec 25 '17 at 10:51
  • Strange. After reboot when you add the interface to the bridge in config file and restart networking, this interface are not attached to the bridge? – Gnat Dec 25 '17 at 11:33
  • adding the bridge works perfectly, and is not effected by network restart. removing the bridge is the challenge.. – beeaaver Dec 25 '17 at 12:15