Source of truth and network automation platform for network infrastructure management.
—
Wireless infrastructure management including radio profiles, wireless networks, supported data rates, and device group assignments. Provides comprehensive modeling of wireless access point configurations and network broadcasting capabilities.
Define data rates supported by wireless access point radios.
class SupportedDataRate:
"""
Data rate that can be used by an access point radio.
Attributes:
standard (str): Wireless standard (802.11a/b/g/n/ac/ax/be)
rate (int): Data rate in Kbps
mcs_index (int, optional): Modulation and Coding Scheme index
"""Configuration profiles for wireless access point radios.
class RadioProfile:
"""
Collection of settings that can be applied to an access point radio.
Attributes:
name (str): Profile name (unique)
frequency (str): Frequency band (2.4GHz/5GHz/6GHz)
tx_power_min (int): Minimum transmit power
tx_power_max (int): Maximum transmit power
rx_power_min (int): Minimum receive power
channel_width (list): Supported channel widths (20/40/80/160 MHz)
allowed_channel_list (list): List of allowed channel numbers
regulatory_domain (str): Country/region regulatory domain
supported_data_rates (ManyToManyField): Associated data rates
"""Wireless networks that can be broadcast by access points.
class WirelessNetwork:
"""
Wireless network that can be broadcast by an access point.
Attributes:
name (str): Network name (unique)
description (str): Optional description
ssid (str): Service Set Identifier
mode (str): Network mode (Central/Fabric/Standalone/Local/Mesh/Bridge)
enabled (bool): Whether network is enabled
authentication (str): Authentication type (Open/WPA2/WPA3 variants)
hidden (bool): Whether SSID is hidden
secrets_group (ForeignKey, optional): Authentication secrets
tenant (ForeignKey, optional): Tenant ownership
"""Assignment models linking wireless configurations to device groups.
class ControllerManagedDeviceGroupWirelessNetworkAssignment:
"""
Assigns a WirelessNetwork to a ControllerManagedDeviceGroup.
Attributes:
controller_managed_device_group (ForeignKey): Target device group
wireless_network (ForeignKey): Assigned wireless network
vlan (ForeignKey, optional): Associated VLAN
"""
class ControllerManagedDeviceGroupRadioProfileAssignment:
"""
Assigns a RadioProfile to a ControllerManagedDeviceGroup.
Attributes:
controller_managed_device_group (ForeignKey): Target device group
radio_profile (ForeignKey): Assigned radio profile
"""Predefined choices for wireless configuration options.
class RadioProfileChannelWidthChoices:
"""Channel width options for radio profiles."""
WIDTH_20MHZ = 20
WIDTH_40MHZ = 40
WIDTH_80MHZ = 80
WIDTH_160MHZ = 160
class RadioProfileFrequencyChoices:
"""Frequency band options for radio profiles."""
FREQUENCY_2_4G = "2.4GHz"
FREQUENCY_5G = "5GHz"
FREQUENCY_6G = "6GHz"
class SupportedDataRateStandardChoices:
"""Wireless standard options for data rates."""
A = "802.11a"
B = "802.11b"
G = "802.11g"
N = "802.11n"
AC = "802.11ac"
AX = "802.11ax"
BE = "802.11be"
class WirelessNetworkModeChoices:
"""Network mode options for wireless networks."""
CENTRAL = "Central"
FABRIC = "Fabric"
STANDALONE = "Standalone (Autonomous)"
LOCAL = "Local (Flex)"
MESH = "Mesh"
BRIDGE = "Bridge"
class WirelessNetworkAuthenticationChoices:
"""Authentication options for wireless networks."""
OPEN = "Open"
WPA2_PERSONAL = "WPA2 Personal"
WPA2_ENTERPRISE = "WPA2 Enterprise"
ENHANCED_OPEN = "Enhanced Open"
WPA3_PERSONAL = "WPA3 Personal"
WPA3_SAE = "WPA3 SAE"
WPA3_ENTERPRISE = "WPA3 Enterprise"
WPA3_ENTERPRISE_192_BIT = "WPA3 Enterprise 192Bit"
class RadioProfileRegulatoryDomainChoices:
"""Country/region regulatory domain options for radio profiles."""
US = "US"
EU = "EU"
JP = "JP"
# ... extensive list of country codes availableREST API serializers for wireless resources.
class SupportedDataRateSerializer:
"""Serializer for SupportedDataRate with tagging support."""
class RadioProfileSerializer:
"""Serializer for RadioProfile with JSON array field handling."""
class WirelessNetworkSerializer:
"""Serializer for WirelessNetwork with tagging support."""
class ControllerManagedDeviceGroupWirelessNetworkAssignmentSerializer:
"""Serializer for wireless network assignments."""
class ControllerManagedDeviceGroupRadioProfileAssignmentSerializer:
"""Serializer for radio profile assignments."""REST API viewsets for wireless resource management.
class SupportedDataRateViewSet:
"""ViewSet for SupportedDataRate CRUD operations with filtering."""
class RadioProfileViewSet:
"""ViewSet for RadioProfile CRUD operations with filtering."""
class WirelessNetworkViewSet:
"""ViewSet for WirelessNetwork CRUD operations with filtering."""
class ControllerManagedDeviceGroupWirelessNetworkAssignmentViewSet:
"""ViewSet for wireless network assignment operations."""
class ControllerManagedDeviceGroupRadioProfileAssignmentViewSet:
"""ViewSet for radio profile assignment operations."""from nautobot.wireless.models import SupportedDataRate
from nautobot.wireless.choices import SupportedDataRateStandardChoices
# Create 802.11ax data rates
data_rates = [
SupportedDataRate.objects.create(
standard=SupportedDataRateStandardChoices.AX,
rate=150000, # 150 Mbps
mcs_index=7
),
SupportedDataRate.objects.create(
standard=SupportedDataRateStandardChoices.AX,
rate=300000, # 300 Mbps
mcs_index=9
),
SupportedDataRate.objects.create(
standard=SupportedDataRateStandardChoices.AX,
rate=600000, # 600 Mbps
mcs_index=11
)
]from nautobot.wireless.models import RadioProfile
from nautobot.wireless.choices import (
RadioProfileFrequencyChoices,
RadioProfileChannelWidthChoices,
RadioProfileRegulatoryDomainChoices
)
# Create a high-performance 5GHz radio profile
radio_profile = RadioProfile.objects.create(
name="High Performance 5GHz",
frequency=RadioProfileFrequencyChoices.FREQUENCY_5G,
tx_power_min=5,
tx_power_max=25,
rx_power_min=-85,
channel_width=[
RadioProfileChannelWidthChoices.WIDTH_40MHZ,
RadioProfileChannelWidthChoices.WIDTH_80MHZ,
RadioProfileChannelWidthChoices.WIDTH_160MHZ
],
allowed_channel_list=[36, 40, 44, 48, 52, 56, 60, 64],
regulatory_domain=RadioProfileRegulatoryDomainChoices.US
)
# Associate supported data rates
radio_profile.supported_data_rates.set(data_rates)from nautobot.wireless.models import WirelessNetwork
from nautobot.wireless.choices import (
WirelessNetworkModeChoices,
WirelessNetworkAuthenticationChoices
)
from nautobot.extras.models import SecretsGroup
from nautobot.tenancy.models import Tenant
# Create a corporate wireless network
secrets_group = SecretsGroup.objects.create(name="WiFi Secrets")
tenant = Tenant.objects.create(name="Corporate")
corporate_wifi = WirelessNetwork.objects.create(
name="Corporate WiFi",
description="Primary corporate wireless network",
ssid="CORP-WIFI",
mode=WirelessNetworkModeChoices.CENTRAL,
authentication=WirelessNetworkAuthenticationChoices.WPA3_ENTERPRISE,
enabled=True,
hidden=False,
secrets_group=secrets_group,
tenant=tenant
)
# Create a guest network
guest_wifi = WirelessNetwork.objects.create(
name="Guest WiFi",
description="Guest access wireless network",
ssid="GUEST-WIFI",
mode=WirelessNetworkModeChoices.CENTRAL,
authentication=WirelessNetworkAuthenticationChoices.WPA2_PERSONAL,
enabled=True,
hidden=False,
tenant=tenant
)from nautobot.wireless.models import (
ControllerManagedDeviceGroupWirelessNetworkAssignment,
ControllerManagedDeviceGroupRadioProfileAssignment
)
from nautobot.dcim.models import ControllerManagedDeviceGroup
from nautobot.ipam.models import VLAN
# Assume we have a device group and VLAN
device_group = ControllerManagedDeviceGroup.objects.get(name="Building-A APs")
corporate_vlan = VLAN.objects.get(name="Corporate")
guest_vlan = VLAN.objects.get(name="Guest")
# Assign wireless networks to device group
corporate_assignment = ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
controller_managed_device_group=device_group,
wireless_network=corporate_wifi,
vlan=corporate_vlan
)
guest_assignment = ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
controller_managed_device_group=device_group,
wireless_network=guest_wifi,
vlan=guest_vlan
)
# Assign radio profile to device group
radio_assignment = ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
controller_managed_device_group=device_group,
radio_profile=radio_profile
)# Create 2.4GHz radio profile for compatibility
radio_profile_24g = RadioProfile.objects.create(
name="Standard 2.4GHz",
frequency=RadioProfileFrequencyChoices.FREQUENCY_2_4G,
tx_power_min=5,
tx_power_max=20,
rx_power_min=-80,
channel_width=[
RadioProfileChannelWidthChoices.WIDTH_20MHZ,
RadioProfileChannelWidthChoices.WIDTH_40MHZ
],
allowed_channel_list=[1, 6, 11], # Non-overlapping channels
regulatory_domain=RadioProfileRegulatoryDomainChoices.US
)
# Create 802.11g/n data rates for 2.4GHz
data_rate_24g = SupportedDataRate.objects.create(
standard=SupportedDataRateStandardChoices.N,
rate=72200, # 72.2 Mbps
mcs_index=7
)
radio_profile_24g.supported_data_rates.add(data_rate_24g)
# Assign both radio profiles to the same device group
radio_assignment_24g = ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
controller_managed_device_group=device_group,
radio_profile=radio_profile_24g
)from nautobot.wireless.api.serializers import (
RadioProfileSerializer,
WirelessNetworkSerializer
)
# Serialize radio profile data
radio_serializer = RadioProfileSerializer(radio_profile)
radio_data = radio_serializer.data
# Query wireless networks via API
networks = WirelessNetwork.objects.filter(enabled=True)
network_serializer = WirelessNetworkSerializer(networks, many=True)
network_data = network_serializer.datafrom nautobot.wireless.filters import RadioProfileFilterSet, WirelessNetworkFilterSet
# Filter radio profiles by frequency
profiles_5g = RadioProfile.objects.filter(
frequency=RadioProfileFrequencyChoices.FREQUENCY_5G
)
# Filter by channel width capabilities
profiles_160mhz = RadioProfile.objects.filter(
channel_width__contains=[RadioProfileChannelWidthChoices.WIDTH_160MHZ]
)
# Search wireless networks
enterprise_networks = WirelessNetwork.objects.filter(
authentication__icontains="enterprise"
)
# Filter by mode
central_networks = WirelessNetwork.objects.filter(
mode=WirelessNetworkModeChoices.CENTRAL
)The wireless module exposes the following REST API endpoints:
/api/wireless/supported-data-rates/ - Data rate management/api/wireless/radio-profiles/ - Radio profile management/api/wireless/wireless-networks/ - Wireless network management/api/wireless/controller-managed-device-group-radio-profile-assignments/ - Radio profile assignments/api/wireless/controller-managed-device-group-wireless-network-assignments/ - Wireless network assignmentsCommon validation patterns for wireless resources:
from django.core.exceptions import ValidationError
from nautobot.wireless.models import RadioProfile
try:
# Invalid channel width configuration
profile = RadioProfile.objects.create(
name="Invalid Profile",
frequency=RadioProfileFrequencyChoices.FREQUENCY_2_4G,
channel_width=[RadioProfileChannelWidthChoices.WIDTH_160MHZ], # Not valid for 2.4GHz
tx_power_min=10,
tx_power_max=5, # Min > Max
regulatory_domain=RadioProfileRegulatoryDomainChoices.US
)
except ValidationError as e:
print(f"Validation error: {e}")
try:
# Duplicate assignment
from nautobot.wireless.models import ControllerManagedDeviceGroupRadioProfileAssignment
# This would fail if the assignment already exists
duplicate_assignment = ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
controller_managed_device_group=device_group,
radio_profile=radio_profile
)
except ValidationError as e:
print(f"Duplicate assignment error: {e}")# Create comprehensive wireless infrastructure for a building
from nautobot.wireless.models import *
from nautobot.dcim.models import ControllerManagedDeviceGroup
# Create device groups for different floors
floors = ['Floor-1', 'Floor-2', 'Floor-3']
device_groups = []
for floor in floors:
group = ControllerManagedDeviceGroup.objects.create(
name=f"{floor} Access Points",
description=f"Access points on {floor}"
)
device_groups.append(group)
# Assign radio profiles (both 2.4GHz and 5GHz)
ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
controller_managed_device_group=group,
radio_profile=radio_profile_24g
)
ControllerManagedDeviceGroupRadioProfileAssignment.objects.create(
controller_managed_device_group=group,
radio_profile=radio_profile
)
# Assign wireless networks
ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
controller_managed_device_group=group,
wireless_network=corporate_wifi,
vlan=corporate_vlan
)
ControllerManagedDeviceGroupWirelessNetworkAssignment.objects.create(
controller_managed_device_group=group,
wireless_network=guest_wifi,
vlan=guest_vlan
)Install with Tessl CLI
npx tessl i tessl/pypi-nautobot