Tuesday, July 16, 2019

Capturing Network Traces From The CLI On CUCM

Here are the givens:
CUCM Publisher IP: 10.5.0.10  and Target ISR Gateway: 172.16.0.1
Step 1: Connect to the CUCM Host
Using an SSH client like putty/secureCRT connect to the  CUCM publisher.
—————-
lexter@lextertech.com /
$ ssh admin@10.5.0.10
admin@10.5.0.10’s password:
Last login: Tue Jul 16 19:53:00 2019 from 192.168.1.1
Welcome to the Platform Command Line Interface
admin:
————–
Step 2: Prepare a Capture Trace File
From the admin: prompt, you will use the capture network utility to setup a protocol trace.  You can do this live and watch it on the screen if you are simply trying to determine that a conversation is happening or you can capture the output to a file.  We are going to do the latter.
———-
admin: utils network capture file mycap count 100000 size all host all 172.16.0.1
Executing command with options:
size=all count=100000 interface=eth0
src= dest= port=
ip=172.16.0.1
———–
The trace continues until you press Ctrl-C.
Step 3: Download the Trace File
OK, so now you have a file somewhere on the system with the data that you would really like to view.  You have to download it to your machine.  You will need a running SFTP server on the target machine.  You can use openSSH on linux/unix, freeFTPd, copSSH, or something similar.
——-
admin:file get activelog platform/cli/mycap.cap
The size of the file and other information is sent to the output screen.
You are prompted for the host name: use DNS or IP address of SFTP server
You are prompted for the port: Defaults to 22 (SSH)
The CUCM checks its local keys and then asks for your user ID and password on the SFTP server.
Step 4: View Trace
After the file has been downloaded, you can view it in whatever protocol analyzer you prefer as long as it support the  tcpdump/libpcap format (.cap usual file extension).  A good tool is WireShark.
As previously noted you can look at packets live on the CUCM console screen. You can also specify port, source address, destination address, and protocol filters.  Enter the command “utils network capture ?” for a list of all options.