Cumulus Linux Basic Setup - Manual

Cumulus Linux , A Linux Network Experience beyond the CLI

Sarah Williams

In this post we will go over the basic setting of cumulus Linux on a brand new bare metal switch. 

We already covered the method to load the Cumulus NOS on a bare metal switch in previous posts.

1- Out Of Band Management Interface

Out of band management interface is the dedicated Ethernet port of the switch which is used for loading the NOS and also will be used for initial configuration of the switch. it is always a good idea to have a dedicated OOB network to connect these ports all to a separate network.

Our switch is booted with Cumulus Linux and we already logged in through the console using cumulus/ CumulusLinux! credentials.

In Cumulus, the "eth0" interface is dedicated for OOB and also has a separate VRF (Virtual Routing Forwarding) which allows you to have separate default gateway for OOB interface without interfering with the switch routing table.

So to make a clean OOB configuration we will enable the Management VRF first , and then we will assign the IP address.

Cumulus Management VRF 

Cumulus Linux only supports eth0 as the management interface. VLAN subinterfaces, bonds, bridges and the front panel switch ports are not supported as management interfaces.

Management VRF creates two routing tables within the Linux kernel: 

  • main: This is the routing table for all the data plane switch ports. 

  • mgmt: This is the routing table for eth0

Management VRF assumes all traffic generated by the switch (except via Quagga) will exit eth0 by default, so unless there is application-level intervention, any packet generated by an application on the switch will only reference the eth0 routing table (the mgmt table). Applications that need to communicate over the data plane network (the main table) must bind to the loopback IP address. 

For example, if the switch is responding to an inbound SSH connection or inbound ping, management VRF does not force the traffic out through eth0. However, if you attempt to SSH from the switch outbound, then management VRF will force the traffic to exit eth0, unless you specify otherwise. For example, when initiating an SSH connection, you can use -b <loopback IP address> to SSH to a device via the data plane network.

How to Enable Management VRF on Cumulus

to enable the Management VRF, follow the below steps on Cumulus CLI

Enabling Management VRF

$ sudo apt-get update 

$ sudo apt-get install cl-mgmtvrf

$ sudo cl-mgmtvrf --enable 

$ sudo service quagga restart

For information of people new to Cumulus, you can see the available packages to install using "apt-cache search" command.  most of Cumulus packages starts with "cl-"prefix so you can easily find what packages are available to install.

To verify the status of management VRF you can use below command to check.

$ cl-mgmtvrf --status

Now the management VRF is enabled. we will continue by configuring the eth0 OOB interface.

Configuring the Eth0  OOB interface

There are 2 ways to configure the OOB interface. using DHCP or Static. 
Normally the management IP address should not get changed, so if you plan to use DHCP ensure that you have MAC binding in your DHCP and bind a specific IP address for the OOB interface of the bare metal switch.


For configuring DHCP on management interface  

$ sudo nano /etc/network/interfaces

in interfaces file , add the following lines to enable DHCP for OOB port

auto eth0 

iface eth0 inet static

Save the file (CTRL+X) , and bounce the eth0 using below command:

$ sudo ifdown eth0; sudo ifup eth0 

For configuring Static IP address on management interface  

$ sudo nano /etc/network/interfaces

in interfaces file , add the following lines to for adding static IP address (here with gateway for management interface

auto eth0
iface eth0 inet static
            post-up ip route add dev eth0 table mgmt
            post-up ip route add default via dev eth0 table mgmt
            post-up ip route del dev eth0 table main
            post-down ip route del dev eth0 table mgmt
            post-down ip route del default via dev eth0 table mgmt

Save the file (CTRL+X) , and bounce the eth0 using below command:

$ sudo ifdown eth0; sudo ifup eth0 

to verify that the management VRF is having correct default gateway you can use the below command

ip route show table mgmt


2- Changing the Host Name

Changing host name can be done in 2 ways :

1- Using commands and a Reboot

2- Using a bash script file without Reboot.

Using commands and a Reboot 

We need to edit /etc/hostname and /etc/hosts files with the desired hostname

$ sudo nano /etc/hostname

Then replace the IP address in /etc/hosts with the new hostname:

$ sudo nano /etc/hosts

$sudo reboot


Using the script without Reboot 

To change the hostname without reboot (which all of us don't like to reboot) , you can use a script.

The script is located in Cumulus Git hub :

Download this file to the switch using wget , or you can copy paste the commands to a new file. 

After downloaded/ created , enable the execution on  the file using chmod command.



3- Changing the Time Zone

Having the correct timezone setup is very important. All Linux logs are based on timezone and without having a correct timezone and also timeserver setup, you will run into confusing issues.

Use below command to configure your timezone.

$ sudo dpkg-reconfigure tzdata 


 3- Add DNS Servers

If you are using static IP on management interface you need to configure the DNS servers in Cumulus.

Just like a Linux host, configure your DNS servers in /etc/resolve.conf

4- Set Date and Time

To set date and time use the below command:

$ sudo date -s "Tue Jan 12 00:37:13 2016"

You can write the current value of the system (software) clock to the hardware clock using the hwclock

$ sudo hwclock -w

Above steps helps us to perform a basic configuration on bare metal switches running Cumulus Linux.

Performing the rest of configuration using automation tools is more efficient and better managed.