Wednesday, 24 December 2014

Configuring Network Bridge using nmcli command in RHEL 7.0

A Network Bridge  is a link-layer device that forwards traffic between networks based on MAC addresses. It learns what hosts are connected to each network, builds a table of MAC addresses then makes packet forwarding decision based on that table. A software bridge can be used in a Linux environment to emulate a hardware bridge. The most common application for software bridge is in virtualization application for sharing a hardware NIC among one or more Virtual NICs.

Let now show you how to create a Network Bridge in RHEL 7.0 using nmcli command.
if you missed to see the my last 2 Articles on Network, here is the link for your reference :
  1. Configuring Network Teaming using nmcli in RHEL 7.0
  2. Configuring Network using nmcli command line tool in RHEL 7 
Run  #nmcli con show to check the current connection configuration. currently i don't have any bridge configured in this system.
 
Check the currently available interfaces for creating the Network Bridge . run #ip link command to see the available NIC interfaces in the system. Here I am using eno33554992 & eno50332216 to create bridge br0.
 

 Run the following command to create bridge.
# nmcli con add type bridge con-name br0 ifname br0


Now Bridge interface is created , lets add the Slave devices to this bridge interface using the following command.

# nmcli con add type bridge-slave con-name br0-port1 ifname eno33554992 master br0
# nmcli con add type bridge-slave con-name br0-port2 ifname eno50332216 master br0
 
Now bridge is ready let us check the configuration using the following command.
#brctl show
 
 Also we could check the connections information using #nmcli con show ,this would show us the bridge and slave interface connections information.


Lets assign IP address to this Bridge for external communication.
#nmcli con mod br0 ipv4.addresses "192.168.1.200/24 192.168.1.1"
# nmcli con mod br0 ipv4.method manual




 # nmcli con show br0  command would print more information and setting on br0 bridge.


Lets enable to connection and check the IP address information. use the following command to enable the bridge br0.
#nmcli con up br0


#ip add show br0 will show the IP address associated with br0 bridge.

There are many setting you could do with brctl command refer the mnapage for more information. Hope this is useful to you. Next post will be on caching name server using unbound.
Merry X'mas  friends!

No comments:

Post a Comment