I. BACKGROUND notes
Recently participating in a private cloud project, network mode leverages the CENTOS7 default bridging mode. The operating system is CentOS7.4, the customer installs it himself, and then tells us that the usual toolkit is installed.
Ii. Problems and Solutions
A) Configure the NIC as follows:
# cat/etc/sysconfig/network-scripts/ifcfg-em1 type=ethernetname=em1device=em1onboot=yesbridge=br0# cat/etc/ Sysconfig/network-scripts/ifcfg-br0 type=bridgebootproto=staticpeedns=yesname=br0device=br0onboot=yesipaddr= 192.168.108.4netmask=255.255.255.0gateway=192.168.108.1userctl=no
b) After restarting the network card, found that the connection is not on the server, after the remote management card into the server, see the bridge does not take effect, but the network adapter configuration has been the problem,
Use Brctl, actually reported this command, actually did not install bridge-utils, also blame I think of course, think to do private cloud, this basic package should be installed, so I install the next bridge-utils
# yum-y Install bridge-utils# systemctl restart network# brctl showbridge namebridge idstp enabledinterfacesbr08000.d0946 6197542noem1vnet1vnet10vnet11vnet12vnet13vnet14vnet2vnet4vnet5vnet6vnet8vnet9cloud08000.fe00a9fe006enovnet0vnet3vnet7virb R08000.5254006e12d8yesvirbr0-nic
Here, the problem is resolved.
Third, the cause of thinking
When adjusting the network, especially not around the server, it is recommended to write a script, and then combine the planning tasks, in case the adjustment is wrong, can also be quickly restored, similar to the following, I think quite practical.
# cat/config/recover.network.sh#!/bin/bash# set for restore networkcp-rf/tmp/ifcfg-em1/etc/sysconfig/ network-scripts/rm-rf/etc/sysconfig/network-scripts/ifcfg-br0# CRONTAB-L50 1 * * */bin/bash/config/ recover.network.sh >/dev/null 2>&1
One error with Linux bridge