Network
Bridge: A software bridge can be used within a Linux host in order to
emulate a hardware bridge. This network bridge allows virtual machines to have
access to the external network and vice-versa and allow communicating between
different Network VLANs [Trunk VLANs].
NIC bonding: NIC Bonding enables two or more network interfaces to act as one interface, to provide higher data rates and as well as link fail over. Linux kernel features that allows aggregating multiple interfaces. This is a great way of achieving redundancy to a server. If one physical NIC is down or unplugged, it will automatically move resource to other NIC card.
Network bridge configuration with NIC bonding is done!!
The
bridge is used during the configuration of KVM Server (Kernel-based
Virtual Machine) and need to communicate between different Network VLANs. Virtual
Machine launched in KVM is use the default network with NAT networking which is
mapped to the host network to provide external network connectivity.
NIC bonding: NIC Bonding enables two or more network interfaces to act as one interface, to provide higher data rates and as well as link fail over. Linux kernel features that allows aggregating multiple interfaces. This is a great way of achieving redundancy to a server. If one physical NIC is down or unplugged, it will automatically move resource to other NIC card.
Step 1: Verify/Install
Module: Use the following command to verify whether the bridge module
is loaded or not.
[root@linuxcnf
~]# modinfo bridge
filename:
/lib/modules/3.10.0-693.el7.x86_64/kernel/net/bridge/bridge.ko.xz
alias:
rtnl-link-bridge
version:
2.3
license:
GPL
rhelversion:
7.4
srcversion:
188FE82E919189D8DCBCF21
depends:
stp,llc
intree:
Y
vermagic:
3.10.0-693.el7.x86_64 SMP mod_unload modversions
signer:
CentOS Linux kernel signing key
sig_key:
DA:18:7D:CA:7D:BE:53:AB:05:BD:13:BD:0C:4E:21:F4:22:B6:A4:9C
sig_hashalgo:
sha256
[root@linuxcnf
~]#
|
If the module is not loading, you can load it using the
following command:
[root@linuxcnf
~]# modprobe --first-time bridge
|
Also, we need to install bridge-utils for controlling the
network adapters. Install the bridg-utils as below:
[root@linuxcnf
~]# yum install bridge-utils
|
Step 2: Create A Network Bridge: Create a file named
“ifcfg-br0” in the “/etc/sysconfig/network-scripts/“and append the parameters
as below:
[root@linuxcnf
~]# vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.43.105
NETMASK=255.255.255.0
GATEWAY=192.168.43.1
ONBOOT=yes
NM_CONTROLLED=no
|
Here, you need to replace IP address as per actual setup IP
addresses.
Similarly, create and modify bond0, eth0 and eth1 interfaces
configuration files and append the below parameters as below:
Step 3: Create other configuration files: We need to create these
below files in /etc/sysconfig/network-scripts/ directory and append the below
parameters on respective files:
[root@linuxcnf
~]# vi /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
NAME=bond0
TYPE=Bond
ONBOOT=yes
BRIDGE=br0
BOOTPROTO=none
NM_CONTROLLED=no
BONDING_OPTS="mode=1
miimon=100"
|
[root@linuxcnf
~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
|
[root@linuxcnf
~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
TYPE=Ethernet
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
NM_CONTROLLED=no
MASTER=bond0
SLAVE=yes
|
Step 4: Load bond driver/module: Check bonding
driver/module is loaded for NIC-bonding interface (bond0) is bringing up.
First, load the bonding module, enter:
[root@linuxcnf
~]# modprobe bond
|
Step 5: Restarting Network service: Now we can restart the
network service in order to bring up bond0 interface:
[root@linuxcnf
~]# service network restart
|
Step 6: Verify Configuration: Enter the below commands to
verify the bridge status from Linux kernel bonding driver:
[root@linuxcnf
~]# brctl show
bridge
name bridge
id
STP enabled interfaces
br0
8000.a0d3c1f45d2c
no
bond0
vnet0
vnet1
virbr0
8000.52540098014f
yes
virbr0-nic
[root@linuxcnf
~]#
|
Enter the below commands to verify the bond status from Linux
kernel bonding driver:
[root@linuxcnf
~]# cat /proc/net/bonding/bond0
Ethernet
Channel Bonding Driver: v3.7.1 (April 27, 2011)
Bonding
Mode: fault-tolerance (active-backup)
Primary
Slave: None
Currently
Active Slave: eth0
MII
Status: up
MII
Polling Interval (ms): 100
Up
Delay (ms): 0
Down
Delay (ms): 0
Slave
Interface: eth0
MII
Status: up
Speed:
1000 Mbps
Duplex:
full
Link
Failure Count: 0
Permanent
HW addr: 14:f6:34:23:fd:1a
Slave
queue ID: 0
Slave
Interface: eth1
MII
Status: up
Speed:
1000 Mbps
Duplex:
full
Link
Failure Count: 0
Permanent
HW addr: 14:f6:34:32:fd:1b
Slave
queue ID: 0
[root@linuxcnf
~]#
|
[root@linuxcnf
~]# ifconfig
bond0:
flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST> mtu 1500
inet6 df80::32e1:71df:fe54:df0a prefixlen 64 scopeid
0x20<link>
ether 14:f6:34:23:fd:1a txqueuelen 1000 (Ethernet)
RX packets 7821329 bytes 7202213190 (6.7 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5083957 bytes 1189921931 (1.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br0:
flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.105 netmask 255.255.255.0 broadcast 192.168.43.1
inet6 df80::32e1:71df:fe54:df0a prefixlen 64 scopeid
0x20<link>
ether 14:f6:34:23:fd:1a txqueuelen 1000 (Ethernet)
RX packets 6231499 bytes 3275041689 (3.0 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1994973 bytes 485209953 (462.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0:
flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 14:f6:34:23:fd:1a txqueuelen 1000 (Ethernet)
RX packets 1293869 bytes 113523260 (108.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16
eth1:
flags=6211<UP,BROADCAST,RUNNING,SLAVE,MULTICAST> mtu 1500
ether 14:f6:34:32:fd:1b txqueuelen 1000 (Ethernet)
RX packets 4937630 bytes 3161518429 (2.9 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1994973 bytes 485209953 (462.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0
collisions 0
device interrupt 17
lo:
flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 4276 bytes 264988 (258.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4276 bytes 264988 (258.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@linuxcnf
~]#
|
Network bridge configuration with NIC bonding is done!!
No comments:
Post a Comment