Skip to content

Switch Routing Static Routes Configuration

Dashboard Location: Switching > Configure > Routing and DHCP

Static Routing Management for Layer 3 Switches

Switch routing static routes configuration in Meraki networks provides administrators with the capability to implement precise traffic routing control directly on Layer 3 switches, enabling custom network path management, traffic engineering, and network topology optimization. This functionality supports subnet-specific routing, next-hop gateway specification, OSPF integration, route preference management, and network segmentation routing. Static routing on switches is essential for multi-site connectivity, network redundancy implementation, traffic load balancing, and specialized routing scenarios where dynamic routing protocols are insufficient or inappropriate.

Diagram

Diagram

Classes

switch (meraki.domains.organizations.networks.devices)

NameTypeConstraintMandatoryDefault Value
routing_static_routesList[routing_static_routes]No

routing_static_routes (meraki.domains.organizations.networks.devices.switch)

NameTypeConstraintMandatoryDefault Value
nameStringmin: 1, max: 127No
subnetStringRegex: ^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\/([1-9]|[12][0-9]|3[0-2])$No
next_hop_ipIPNo
advertise_via_ospfBooleantrue, falseNo
prefer_over_ospf_routesBooleantrue, falseNo
management_next_hopIPNo

Examples

Example-1: The example below demonstrates switch static routing configuration using tested YAML configuration from pipeline fixtures.

meraki:
domains:
- name: "!env domain"
administrator:
name: "!env org_admin"
organizations:
- name: "!env org"
networks:
- name: "!env network_name"
product_types:
- appliance
- switch
- wireless
- camera
- sensor
- cellularGateway
devices:
- name: "!env dmz_switch_02"
switch:
routing_static_routes:
- name: Route 1
subnet: "2.2.2.0/24"
next_hop_ip: 1.1.1.254
advertise_via_ospf: true
prefer_over_ospf_routes: true

Configuration Parameters

ParameterTypeRequiredDescription
switch_routing_static_routesArrayNoStatic route configurations for the switch
switch_routing_static_routes[n].nameStringYesDescriptive name for the static route
switch_routing_static_routes[n].subnetStringYesDestination subnet in CIDR notation (e.g., “192.168.1.0/24”)
switch_routing_static_routes[n].next_hop_ipStringYesNext hop gateway IP address
switch_routing_static_routes[n].advertise_via_ospfBooleanNoWhether to advertise this route via OSPF (default: false)
switch_routing_static_routes[n].prefer_over_ospf_routesBooleanNoWhether to prefer this static route over OSPF routes (default: false)

Static Route Types

Route TypeDescriptionUse CaseOSPF Integration
Host RouteSingle IP (/32)Specific server accessOptional
Subnet RouteNetwork segmentNetwork connectivityRecommended
Summary RouteAggregated networksRoute optimizationCommon
Default Route0.0.0.0/0Internet/WAN accessConditional

Route Preference Options

Preference SettingDescriptionPriorityBehavior
Static Preferredprefer_over_ospf_routes: trueHighestAlways use static route
OSPF Preferredprefer_over_ospf_routes: falseLowerUse OSPF if available

OSPF Advertisement

Advertisement ModeConfigurationUse CaseNetwork Impact
Advertise Enabledadvertise_via_ospf: trueRoute sharingDomain-wide visibility
Advertise Disabledadvertise_via_ospf: falseLocal routingSwitch-specific

Subnet Notation Guide

CIDR NotationSubnet MaskNetwork SizeUse Case
/8255.0.0.016,777,216 hostsLarge networks
/16255.255.0.065,536 hostsRegional networks
/24255.255.255.0256 hostsStandard LANs
/30255.255.255.2524 hostsPoint-to-point
/32255.255.255.2551 hostHost routes

Next Hop Planning

Next Hop TypeConfigurationRequirementsVerification
Local GatewaySame subnet IPLayer 2 connectivityARP resolution