Use built in MAC OS FTP Server to export Cisco WLC configuration
Working with Cisco Wireless LAN Controllers, it is sometimes needed to save and export the configuration into a text file format. It could be needed for backup purposes. Personally, I often do it so I can import the configuration into the WLC config analyzer. This is a tool developped by Cisco which helps analyzing the configurations. You can learn more about the WLC config analyzer on this website: https://supportforums.cisco.com/document/7711/wlc-config-analyzer
When exporting the configuration file, you have the choice of using the FTP, TFTP or SFTP protocol.
1 - SETUP THE FTP SERVER ON MAC OS
By default, the FTP server is already running. So all you need to do is:
- validate that the FTP server is running
- validate which users you can use to connect to the FTP server
To validate that the FTP server is running, open the Terminal app and type the following command: “netstat -na | grep .21 | grep LISTEN“. This command will display the listening connections on port 21 (port used by FTP). In the example below, the 2 last lines indicate that the FTP server is running and listening on port 21.
If you don’t see that the FTP server is up, running and listening. You can enter the following command in order to start the service: sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
2 - TEST THE CONNECTION TO THE FTP LOCALLY
Before transferring the configuration file over from the controller to your MAC. It is always a good idea to test the connection to your FTP server locally to make sure that you have the right credentials to connect.
In order to connect to the FTP server, you will need a username and a password. These are the one listed in the section above.
You are now almost ready to transfer some files between your Cisco controller and your MAC.
3 - SETUP THE CONNECTION TO THE CISCO WLC
Important note: Your MAC computer has to be connected to the wired network in order for the transfer to work. The controller will not allow the transfer if you are connected from the Wi-Fi network.
Here are the different way you may connect your MAC to the WLC:
- Connect your MAC to the wired network on the same vlan that is used for the management interface on the controller
- Connect directly your MAC to the service port (except for WLC 2504 which does not have a service port)
In my case, I performed my testing on a Cisco WLC 2504 so I connected my MAC to a switchport on the same vlan as the one I use for the management interface on the controller. In my case it was vlan 20.
So once you have connected your MAC on the same vlan as the management, you are ready to perform the actual FTP transfer.
4 - TRANSFER THE CONFIGURATION
In the drop down menu list name “File Type“, choose “Configuration“.
As a “Transfer Mode“, choose “FTP“.
Note: you have the possibility to secure the file by encrypting it before sending it over the network.
In the “Server Details” section, you need to fill out these different fields:
- IP Address: This is the IP address of the FTP server. So this is the IP address of your MAC computer.
- File Path: This is the path where you want to send your file onto the FTP server. If you leave “./”, it is going to send the file to the home directory of the user you are using for the transfer.
- File Name: This is the name you want to give to the configuration file onto the FTP server
- Server Login Username: This is your user account name on the FTP server
- Server Login Password: This is the password tied to this user account on the FTP server
- Service Port Number: This is the port used for FTP on the server (21 in my case)
5 - TROUBLESHOOT THE TRANSFER
I hope this will help others since it is a pretty convenient way to transfer the full WLC configuration in a short amount of time.