GithubHelp home page GithubHelp logo

xaviervalette / cisco-c9800-netconf-shut-ap-radios Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 57 KB

A python script using NETCONF on C9800 to disable APs radios via RF tags

License: Apache License 2.0

Python 100.00%
api c9800 devnet netconf wifi wlc cisco

cisco-c9800-netconf-shut-ap-radios's Introduction

Cisco Catalyst 9800 NETCONF shut radios

A python script using NETCONF shutdown radios of C9800 managed APs:

image

Targeted changes

To do so, the script updates RF Profiles of 2.4GHz, 5GHz and 6GHz bands for given RF Tags.

CLI configuration changes

Before After
wireless tag rf FR42_STE07ALD
 24ghz-rf-policy 15dbm_24ghz
 5ghz-rf-policy 15dbm_5ghz
 6ghz-rf-policy 15dbm_6ghz
wireless tag rf FR42_STE07ALD
-24ghz-rf-policy 15dbm_24ghz
+24ghz-rf-policy No_24ghz
-5ghz-rf-policy 15dbm_5ghz
+5ghz-rf-policy No_5ghz
6ghz-rf-policy No_6ghz

GUI configuration changes

Go to Configuration > Tags & Profiles > Tags > RF section:

Before After
image image

Get started

  1. Clone or download this repo
git clone https://github.com/xaviervalette/cisco-c9800-netconf-disable-ap-radios
  1. Install required packages
pip3 install -r requirements.txt
  1. Add a file called config.yml as follow:
└── cisco-c9800-netconf-disable-ap-radios/
+   ├── config.yml
    ├── src/
    │    └── main.py
    ├── netconf/
    │    ├── config/
    │    │     ├── rfTag.xml
    │    │     └── rfTagsContainer.xml
    │    └── filter/
    │          └── getRfTags.xml
    └── conf/
         └── <wlc_ip>_rf-tags.xml  
  1. In the config.yml file, add the following variables:
#config.yml
---

controllers:
  - name: "<wlc name>"
    username: "<wlc NETCONF username>"
    password: "<wlc NETCONF password>"
    port: "<wlc NETCONF port>"
    host: "<wlc NETCONF @IP>"
rfTags:
  - name: FR42_STE07ALD
    rfProfiles:
      radiosDown:
        24ghz: "No_24ghz"
        5ghz: "No_5ghz"
        6ghz: "No_6ghz"
      radiosUp:
        24ghz: "15dbm_24ghz"
        5ghz: "15dbm_5ghz"
        6ghz: "No_6ghz"
      
...

⚠ RF Tags and RF Profiles have to be created before using the script

  1. Now you can run the code by using the following command:

Disable the radio of access points:

python3 src/main.py 0

Enable the radio of access points:

python3 src/main.py 1

Output

python3 src/main.py 1
python3 src/main.py 0
image image

cisco-c9800-netconf-shut-ap-radios's People

Contributors

xaviervalette avatar

Stargazers

 avatar Audacious Lab avatar

Watchers

 avatar Audacious Lab avatar

Forkers

hariram32

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.