A python script using NETCONF shutdown radios of C9800 managed APs:
To do so, the script updates RF Profiles of 2.4GHz, 5GHz and 6GHz bands for given RF Tags.
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 |
Go to Configuration > Tags & Profiles > Tags > RF
section:
Before | After |
---|---|
- Clone or download this repo
git clone https://github.com/xaviervalette/cisco-c9800-netconf-disable-ap-radios
- Install required packages
pip3 install -r requirements.txt
- 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
- 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
- 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
python3 src/main.py 1 |
python3 src/main.py 0 |
---|---|