Configuring network for enterprises can be painful and complex job and Red Hat Enterprise Linux 7.0 makes it easy by providing Network Manger which is ready to use for enterprise networking setups like Bonding, Teaming, VLAN, and Bridging. Network manager eliminates the need to manually edit network configuration files. It provides flexible and unified gnome applet (GUI) and command line tool (nmcli) to configure network.  Network manager can also detect and manage existing interface configurations.  Following examples will explain how to configure Bonding, bridging, teaming and VLAN through nmcli

Bonding through CLI

To create a bond through the CLI, you first need to create a bond interface, add slaves to this interface and bring the slaves up. Here is how you do it.

  • Create bond interface bond0

nmcli con add type bond ifname bond0 mode active-backup

  • Add slave interfaces  to master(bond0)

nmcli con add type bond-slave ifname em1 master bond0

nmcli con add type bond-slave ifname em2 master bond0

  • Bring slave interfaces up

nmcli con up bond-slave-em1

nmcli con up bond-slave-em2

 

Bridging through CLI

Creating a bridge is also a similar procedure. You need to first create a bridge interface, add the network interfaces which are to be bridged to this interface. Once you bring these interfaces up, the bridge will be active. Here is how you create the bridge in few easy steps.

  • Creating bridge interface

nmcli con add type bridge ifname br1

  • Add network interfaces to bridge

nmcli con add type bridge-slave ifname em3 master br1

nmcli con add type bridge-slave ifname em4 master br1

  • Bring bridge slave interfaces up

nmcli con up bridge-slave-em3

nmcli con up bridge-slave-em4

VLAN through CLI

Unlike in earlier versions where creating a VLAN can be quite complicated, with RHEL 7.0 a VLAN can be created with a single nmcli command and it will update all the config files for you.

  • Create VLAN interface

nmcli con add type vlan ifname VLAN10 dev em4 id 10

  • bring VLAN interface up

nmcli con up VLAN-VLAN10

 

Teaming through CLI

Just as how bonding lets you do link aggregation, the team driver which was introduced in RHEL 7.0, also lets you aggregate links in a more flexible and efficient manner. Creating a team is just like creating a bond, as you will realize below.

  • create teaming interface

nmcli con add type team ifname team0

Add slave interfaces to teaming (team0)

nmcli con add type team-slave em1 master team0

  • Bring all teaming slave interface up

nmcli con up team-team0

Other useful commands

There are lot of other commands which make network management a breeze, here are a few examples

  • Add bonding option mii=100

nmcli con mod bond0 +bond.options mii=100

  • Delete bonding option downdelay

nmcli con mod bond0 -bond.options downdelay

  • Show all connection

nmcli connection show

  • Show only active connection

nmcli connection show –active

  • Show device status

nmcli device status

  • Interactive edit configuration

nmcli con edit

As you would have observed, network manager lets you manage your networks in a simple, efficient, unified and effective manner. I encourage you to try out nmcli and see for yourself how easy it can get.