Migrate APs from Old WLC to 9800

Python script to move access points from an old WLC (Wireless LAN Controller) to a new Cisco Catalyst 9800 WLC:

Example Code Snippets

  1. Collecting configuration data from the old WLC (AireOS):

import netmiko

old_wlc_ip = ‘192.168.1.100’
old_wlc_username = ‘admin’
old_wlc_password = ‘password’

ssh_conn = netmiko.Netmiko(
hostname=old_wlc_ip,
username=old_wlc_username,
password=old_wlc_password
)

config_data = ssh_conn.send_command(‘show running-config’)

2.Processing data to extract AP information:

import csv

ap_info = []
for line in config_data.splitlines():
if ‘ap-name’ in line:
ap_name = line.split()[1]
ap_info.append({‘ap_name’: ap_name, ‘wlc_ip’: old_wlc_ip})

with open(‘ap_config.csv’, ‘w’, newline=”) as csvfile:
writer = csv.DictWriter(csvfile, fieldnames=[‘ap_name’, ‘wlc_ip’])
writer.writeheader()
writer.writerows(ap_info)

  1. Sending configuration commands to the new 9800 WLC:
new_wlc_ip = '192.168.1.200'
new_wlc_username = 'admin'
new_wlc_password = 'password'

ssh_conn = netmiko.Netmiko(
hostname=new_wlc_ip,
username=new_wlc_username,
password=new_wlc_password
)

with open('ap_config.csv', 'r') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
ap_name = row['ap_name']
wlc_ip = row['wlc_ip']
config_cmd = f'config ap primary-base {wlc_ip} {ap_name}'
ssh_conn.send_command(config_cmd)

Leave a comment

Hey there, fellow nerds and net-surfers!

Welcome to my corner of the internet where I talk about the holy trinity of tech: NetworkingLinux, and Security — or as I like to call it, “Ctrl+Alt+Fix-It”. If you’re into packet sniffing (the legal kind), hardening Linux boxes, or figuring out why your network is being as moody as a teenager, you’re in the right place.

This blog is where I dump useful knowledge, random tech rants, and occasional troubleshooting victories so future me (and hopefully you) can benefit. Expect bash scripts, firewall rules, sarcastic comments, and the occasional meme — because what’s IT without a little command-line chaos and caffeine?

Whether you’re a curious beginner or a battle-hardened sysadmin, I hope you’ll find something here to learn, laugh at, or copy-paste in desperation.

Welcome aboard — and may your logs always be verbose.

Let’s connect