Deploy 802.1x to Cisco 9300
Overview
This runbook covers deploying the Day0 base configuration and DayN 802.1x/IBNS2 configuration to a Cisco Catalyst 9300 switch using Jinja2 templates and netapi.
Prerequisites
Procedure
Step 1: Load Secrets
dsource d000 dev/network
Verify credentials are available:
echo $SWITCH_9300_IP
echo $SWITCH_9300_USER
Step 3: Backup Current Config
uv run netapi ios exec "show running-config" > backup-$(date +%Y%m%d-%H%M).txt
Step 4: Render Day0 Base Template
cd ~/atelier/_bibliotheca/domus-automation-ops
j2 templates/cisco-ios/day0-base.j2 vars/domus-home.yml > /tmp/day0-config.txt
Review the output:
cat /tmp/day0-config.txt
Step 5: Apply Day0 Configuration
uv run netapi ios config --file /tmp/day0-config.txt
ssh $SWITCH_9300_USER@$SWITCH_9300_IP < /tmp/day0-config.txt
Step 6: Render DayN 802.1x Template
j2 templates/cisco-ios/dayn-802.1x-ibns2.j2 vars/domus-home.yml \
-e access_port_range="GigabitEthernet1/0/1-24" \
> /tmp/dayn-802.1x-config.txt
Review the output:
cat /tmp/dayn-802.1x-config.txt
Step 8: Verify Deployment
Check AAA configuration:
uv run netapi ios exec "show aaa servers"
Check 802.1x status:
uv run netapi ios exec "show dot1x all"
Check RADIUS connectivity:
uv run netapi ios exec "test aaa group ISE-RADIUS ise_probe legacy"
Check interface template application:
uv run netapi ios exec "show derived-config interface GigabitEthernet1/0/1"
Variables Reference
The templates use variables from vars/domus-home.yml:
| Variable | Description | Example |
|---|---|---|
|
List of ISE Policy Service Nodes |
|
|
RADIUS/TACACS source interface |
|
|
Critical auth VLAN |
|
|
Policy map name |
|
|
Interfaces to configure (runtime) |
|
Secrets
Secrets are referenced but not embedded in templates:
| Secret | Source |
|---|---|
|
dsec: |
|
dsec: |
|
dsec: |
To inject secrets at render time:
j2 templates/cisco-ios/dayn-802.1x-ibns2.j2 vars/domus-home.yml \
-e vault_radius_key_encrypted="$RADIUS_KEY_TYPE7" \
-e access_port_range="GigabitEthernet1/0/1-24" \
> /tmp/dayn-802.1x-config.txt
Rollback
If issues occur, restore from backup:
uv run netapi ios config --file backup-YYYYMMDD-HHMM.txt
Or remove 802.1x from specific ports:
uv run netapi ios exec "configure terminal"
uv run netapi ios exec "interface range GigabitEthernet1/0/1-24"
uv run netapi ios exec "no source template Wired_802_1X_Closed_Template"
uv run netapi ios exec "end"
Troubleshooting
RADIUS Server Unreachable
uv run netapi ios exec "show aaa servers"
uv run netapi ios exec "debug radius authentication"
Check ISE is reachable:
uv run netapi ise mnt health