Hello my friend,
Recently I’ve been engage in some troubleshooting with Cumulus and was looking for the way, how can I send the cl-support file from my switches directly to the vendor support bypassing downloading them to my laptop.
No part of this blogpost could be reproduced, stored in a
retrieval system, or transmitted in any form or by any
means, electronic, mechanical or photocopying, recording,
or otherwise, for commercial purposes without the
prior permission of the author.
Eager to learn about network automation?
We are here to help you. At our network automation training you learn all you need to know to be successful with such tasks in your profession:
- Foundation, operation and administration of Linux, Docker, KVM
- Structure, syntax, and content of YANG models
- Structure, syntax, and application of various data encoding formats: JSON, XML, Protocol Buffers (Protobuf)
- Operation and application of different transport protocols SSH, HTTP, gRPC
- Operation and application of management specifications: CLI, gNMI, NETCONF, RESTCONF/REST API
- How to use and manage everything above with Ansible, Bash, and Python
Let’s take a closer look into the issue. The Cumulus Linux is based on the Debian Linux distribution. Being Linux, it is possible to use in Cumulus Linux some tools, like scp, out of the box. This allows you to download the support files from the switch or upload anything (e.g. software image) to the network element. However, it certain cases (e.g. when you deal with the technical support), you may need to use different protocols, such as ftp, to upload the information from your switch. By default the workflow is:
- Download the support files from the switch to your laptop using scp.
- Upload the support files from your laptop to the support server using ftp.
There is in general nothing wrong about such an approach, but what if your Internet bandwidth at home is quite low. Unfortunately, that is still quite a reality in many countries.
To solve the issue, you can bypass your local Internet connectivity and upload the support files directly to the support server using the FTP (or download the software images directly using FTP as well). To do that, we need to have a proper FTP client on our Cumulus Linux switches.
How to do that
As the Cumulus Linux is based in the Debian Linux distribution, you generally are able to install any package, which Debian has. However, by default the original Debian repo are removed from the list of the available repositories. Hence, the first step is to bring that back. To do that, you need to modify the /etc/apt/source.list as follows:
cumulus@H1:mgmt-vrf:~$ cat /etc/apt/sources.list
deb http://repo3.cumulusnetworks.com/repo CumulusLinux-3 cumulus upstream
deb-src http://repo3.cumulusnetworks.com/repo CumulusLinux-3 cumulus upstream
deb http://repo3.cumulusnetworks.com/repo CumulusLinux-3-security-updates cumulus upstream
deb-src http://repo3.cumulusnetworks.com/repo CumulusLinux-3-security-updates cumulus upstream
deb http://repo3.cumulusnetworks.com/repo CumulusLinux-3-updates cumulus upstream
deb-src http://repo3.cumulusnetworks.com/repo CumulusLinux-3-updates cumulus upstream
#deb http://repo3.cumulusnetworks.com/repo CumulusLinux-3-early-access cumulus
#deb-src http://repo3.cumulusnetworks.com/repo CumulusLinux-3-early-access cumulus
#deb http://repo3.cumulusnetworks.com/repo Jessie-supplemental upstream
#deb-src http://repo3.cumulusnetworks.com/repo Jessie-supplemental upstream
# Add this repo for Debian packages
deb http://deb.debian.org/debian/ jessie main
The repository “http://deb.debian.org/debian/ jessie main” (the last string) should be added to the source list to unlock the access to the Debian packages.
The next step is to resync the available packages using the apt update command (pretty standard Linux, right? ;-))
cumulus@H1:mgmt-vrf:~$ sudo apt update
Ign http://deb.debian.org jessie InRelease
Get:1 http://deb.debian.org jessie Release.gpg [1,652 B]
Get:2 http://deb.debian.org jessie Release [77.3 kB]
Get:3 http://repo3.cumulusnetworks.com CumulusLinux-3 InRelease [7,645 B]
Get:4 http://deb.debian.org jessie/main amd64 Packages [6,818 kB]
Get:5 http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates InRelease [7,612 B]
Get:6 http://repo3.cumulusnetworks.com CumulusLinux-3-updates InRelease [7,693 B]
Get:7 http://repo3.cumulusnetworks.com CumulusLinux-3/cumulus Sources [20 B]
Get:8 http://repo3.cumulusnetworks.com CumulusLinux-3/upstream Sources [209 kB]
Get:9 http://repo3.cumulusnetworks.com CumulusLinux-3/cumulus amd64 Packages [33.7 kB]
Get:10 http://repo3.cumulusnetworks.com CumulusLinux-3/upstream amd64 Packages [499 kB]
Get:11 http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/cumulus Sources [20 B]
Get:12 http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/upstream Sources [39.1 kB]
Get:13 http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/cumulus amd64 Packages [20 B]
Get:14 http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/upstream amd64 Packages [148 kB]
Get:15 http://deb.debian.org jessie/main Translation-en [4,581 kB]
Get:16 http://repo3.cumulusnetworks.com CumulusLinux-3-updates/cumulus Sources [25.1 kB]
Get:17 http://repo3.cumulusnetworks.com CumulusLinux-3-updates/upstream Sources [216 kB]
Get:18 http://repo3.cumulusnetworks.com CumulusLinux-3-updates/cumulus amd64 Packages [67.1 kB]
Get:19 http://repo3.cumulusnetworks.com CumulusLinux-3-updates/upstream amd64 Packages [515 kB]
Ign http://repo3.cumulusnetworks.com CumulusLinux-3/cumulus Translation-en_US
Ign http://repo3.cumulusnetworks.com CumulusLinux-3/cumulus Translation-en
Ign http://repo3.cumulusnetworks.com CumulusLinux-3/upstream Translation-en_US
Ign http://repo3.cumulusnetworks.com CumulusLinux-3/upstream Translation-en
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/cumulus Translation-en_US
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/cumulus Translation-en
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/upstream Translation-en_US
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-security-updates/upstream Translation-en
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-updates/cumulus Translation-en_US
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-updates/cumulus Translation-en
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-updates/upstream Translation-en_US
Ign http://repo3.cumulusnetworks.com CumulusLinux-3-updates/upstream Translation-en
Fetched 13.3 MB in 18s (709 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
As you can see, the first lines are dedicated to the update of the package list for the original Debian Linux repositories. Once that is complete, you can just install the ftp client (e.g. lftp):
cumulus@H1:mgmt-vrf:~$ sudo apt install lftp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 94 not upgraded.
Need to get 581 kB of archives.
After this operation, 1,776 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian/ jessie/main lftp amd64 4.6.0-1+deb8u1 [581 kB]
Fetched 581 kB in 0s (1,081 kB/s)
Creating pre-apt snapshot... 22 done.
Selecting previously unselected package lftp.
(Reading database ... 28660 files and directories currently installed.)
Preparing to unpack .../lftp_4.6.0-1+deb8u1_amd64.deb ...
Unpacking lftp (4.6.0-1+deb8u1) ...
Processing triggers for man-db (184.108.40.206-5) ...
Setting up lftp (4.6.0-1+deb8u1) ...
Creating post-apt snapshot... 23 done.
You are done. Now you can upload your tech support (or download anything to your switch using the FTP:
cumulus@H1:mgmt-vrf:~$ lftp firstname.lastname@example.org
lftp email@example.com:~> put /local/file/path
There are two important aspects I’d like to focus you, what I’ve learned dealing with this case:
The first one is that using such an approach you can install anything on Cumulus Linux that you need: any Linux tool. Not that I haven’t known that before given we have installed custom FRR earlier, but that is the first time I’ve needed something extra for production.
The second is one is that it is very easy to automate this case, if you need to install additional Debian packages on Cumulus Linux. The playbook (if you use Ansible) or the script (if you use Python) can be quite handy.
Come to our network automation training to learn, how to automate Cumulus Linux like a profi.
The world of the modern data centres’ networking is full of Linux: both for servers and switches. As such, using the Linux skills to manage your network infrastructure is essential for your success. This is not what we as network engineers used to, but that is where the industry is heading to. Stay tuned. Take care and good bye!
If you have further questions or you need help with your networks, I’m happy to assist you, just send me message. Also don’t forget to share the article on your social media, if you like it.