Firepower Management Center Commands
Overview
The netapi fmc command group provides comprehensive CLI access to Cisco Firepower Management Center (FMC) for managing Firepower Threat Defense (FTD) devices, access policies, NAT rules, network objects, and deployments.
Prerequisites
Load secrets before using FMC commands:
dsource d000 dev/network
Required environment variables:
| Variable | Description |
|---|---|
|
FMC IP or hostname |
|
API username |
|
API password |
| The FMC user must have API access. Configure in FMC: System > Users > Edit User > REST API User. |
Commands Reference
| Command | Description |
|---|---|
Device Management |
|
|
List managed FTD devices |
|
Get device details by UUID |
|
List device interfaces |
|
List devices with pending deployments |
Policy Management |
|
|
List access control policies |
|
Get policy details |
|
List rules in an access policy |
|
Create an access control rule |
|
Delete an access control rule |
|
Enable/disable a rule |
|
List NAT policies |
|
List intrusion policies |
Object Management |
|
|
List network objects |
|
Create a network object |
|
List host objects |
|
Create a host object |
|
List port objects |
|
Create a port object |
|
List network groups |
|
Create a network group |
|
Delete any object |
|
List security zones |
Deployment |
|
|
Deploy pending changes to devices |
|
Get deployment job status |
System |
|
|
Check FMC connectivity |
|
Get audit log entries |
Device Management
get-devices
List all managed FTD devices:
netapi fmc get-devices
FMC Managed Devices (3) ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━┓ ┃ Name ┃ Model ┃ Version ┃ Status ┃ ID ┃ ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━┩ │ FTD-EDGE-01 │ Firepower 2110│ 7.2.0 │ green │ a1b2c3d4... │ │ FTD-EDGE-02 │ Firepower 2110│ 7.2.0 │ green │ e5f6g7h8... │ │ FTD-DC-01 │ FTDv │ 7.2.0 │ yellow │ i9j0k1l2... │ └───────────────┴───────────────┴─────────┴────────┴─────────────┘
get-interfaces
List physical interfaces for a device:
netapi fmc get-interfaces <device-uuid>
Device Interfaces (4) ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓ ┃ Name ┃ Mode ┃ Enabled ┃ Zone ┃ ID ┃ ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩ │ GigabitEth0/0 │ ROUTED │ Yes │ OUTSIDE │ abc123... │ │ GigabitEth0/1 │ ROUTED │ Yes │ INSIDE │ def456... │ │ GigabitEth0/2 │ ROUTED │ Yes │ DMZ │ ghi789... │ │ Management0/0 │ PASSIVE │ Yes │ - │ jkl012... │ └───────────────┴──────────┴─────────┴────────────┴────────────┘
Policy Management
get-rules
List rules in an access control policy:
netapi fmc get-rules <policy-uuid>
Access Rules (5) ┏━━━━┳━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━┓ ┃ # ┃ Name ┃ Action ┃ Enabled ┃ ID ┃ ┡━━━━╇━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━┩ │ 1 │ Allow-DNS │ ALLOW │ Yes │ r1a2b3c4...│ │ 2 │ Allow-HTTPS-Out │ ALLOW │ Yes │ r5d6e7f8...│ │ 3 │ Allow-Internal │ TRUST │ Yes │ r9g0h1i2...│ │ 4 │ Block-Malware-IPs │ BLOCK │ Yes │ rj3k4l5m...│ │ 5 │ Monitor-Unknown │ ALLOW │ No │ rn6o7p8q...│ └────┴───────────────────────┴────────┴─────────┴────────────┘
create-rule
Create an access control rule:
# Simple allow rule
netapi fmc create-rule <policy-uuid> "Allow-Web-Traffic" --action ALLOW
# Block rule with logging
netapi fmc create-rule <policy-uuid> "Block-Bad-IPs" --action BLOCK --log
# Disabled rule with comment
netapi fmc create-rule <policy-uuid> "Test-Rule" --disabled --comment "Testing"
Options:
| Option | Default | Description |
|---|---|---|
|
ALLOW |
ALLOW, BLOCK, TRUST, MONITOR |
|
enabled |
Enable or disable rule |
|
false |
Log connections |
|
Rule comment |
Object Management
create-network
Create a network object:
netapi fmc create-network "Internal-LAN" "10.50.0.0/16" -d "Internal network"
create-host
Create a host object:
netapi fmc create-host "DC-01" "10.50.1.50" -d "Domain Controller"
create-port
Create a port object:
# Single port
netapi fmc create-port "HTTPS" "443" -p TCP
# Port range
netapi fmc create-port "HighPorts" "49152-65535" -p TCP
create-network-group
Create a network group with multiple networks:
netapi fmc create-network-group "RFC1918" \
-n "10.0.0.0/8" \
-n "172.16.0.0/12" \
-n "192.168.0.0/16" \
-d "Private address space"
delete-object
Delete any object type:
# Delete network object
netapi fmc delete-object networks <uuid> --yes
# Delete host object
netapi fmc delete-object hosts <uuid> --yes
# Delete port object
netapi fmc delete-object protocolportobjects <uuid> --yes
get-zones
List security zones:
netapi fmc get-zones
Security Zones (4) ┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓ ┃ Name ┃ Type ┃ ID ┃ ┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩ │ INSIDE │ ROUTED │ zone123abc... │ │ OUTSIDE │ ROUTED │ zone456def... │ │ DMZ │ ROUTED │ zone789ghi... │ │ MANAGEMENT │ PASSIVE │ zonejkl012... │ └───────────────┴────────────┴────────────────┘
Deployment
deploy
Deploy pending changes to FTD devices:
# Deploy to specific device
netapi fmc deploy <device-uuid>
# Deploy to multiple devices
netapi fmc deploy <uuid1> <uuid2> <uuid3>
# Force deploy (even if no changes detected)
netapi fmc deploy <device-uuid> --force
System
get-audit
Get recent audit log entries:
# Last 25 entries (default)
netapi fmc get-audit
# Last 100 entries
netapi fmc get-audit -n 100
# JSON for parsing
netapi fmc get-audit --format json
Audit Log (last 25) ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓ ┃ Time ┃ User ┃ Action ┃ Object ┃ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩ │ 2026-02-21T10:30:00 │ admin │ PolicyDeploy │ Enterprise-ACP │ │ 2026-02-21T10:25:00 │ netapi │ ObjectCreate │ Server-DMZ │ │ 2026-02-21T10:20:00 │ admin │ RuleModify │ Allow-HTTPS │ └─────────────────────┴────────────┴──────────────┴──────────────────┘
Workflows
Create Objects and Rule
#!/bin/bash
# Workflow: Create objects and firewall rule
dsource d000 dev/network
# Create network object for new server
netapi fmc create-host "NewServer" "10.50.1.100" -d "New application server"
# Create port object
netapi fmc create-port "AppPort" "8443" -p TCP -d "Application HTTPS"
# Get policy ID
POLICY_ID=$(netapi fmc get-policies --format json | jq -r '.[] | select(.name=="Enterprise-ACP") | .id')
# Create rule (note: for source/dest, use FMC GUI or expand CLI)
netapi fmc create-rule "$POLICY_ID" "Allow-NewServer-App" --action ALLOW --log
# Deploy
DEVICE_ID=$(netapi fmc get-deployable --format json | jq -r '.[0].id')
netapi fmc deploy "$DEVICE_ID"
Audit Object Usage
#!/bin/bash
# Export all objects for documentation
DATE=$(date +%Y%m%d)
mkdir -p /backup/fmc/$DATE
netapi fmc get-networks --format json > /backup/fmc/$DATE/networks.json
netapi fmc get-hosts --format json > /backup/fmc/$DATE/hosts.json
netapi fmc get-ports --format json > /backup/fmc/$DATE/ports.json
netapi fmc get-network-groups --format json > /backup/fmc/$DATE/network-groups.json
netapi fmc get-zones --format json > /backup/fmc/$DATE/zones.json
netapi fmc get-policies --format json > /backup/fmc/$DATE/policies.json
# Export rules for each policy
for pid in $(jq -r '.[].id' /backup/fmc/$DATE/policies.json); do
name=$(jq -r ".[] | select(.id==\"$pid\") | .name" /backup/fmc/$DATE/policies.json)
netapi fmc get-rules "$pid" --format json > "/backup/fmc/$DATE/rules-${name}.json"
done
echo "FMC objects backed up to /backup/fmc/$DATE"
Troubleshooting
Authentication Failed
# Verify environment variables
echo $FMC_IP $FMC_USER
# Test connectivity
netapi fmc health
Check FMC user permissions: 1. System > Users 2. Edit user 3. Enable "REST API User" 4. Assign appropriate roles