### FMC Prerequisites Configuration Example Source: https://netascode.cisco.com/docs/data_models/fmc/objects/network_group Example configuration demonstrating the setup of prerequisite network objects like hosts and networks before defining network groups. ```YAML fmc: domains: - name: Global objects: hosts: - name: MyHostName1 ip: 10.10.10.10 networks: - name: MyNetworkName1 prefix: 10.10.10.0/24 ``` -------------------------------- ### Robot Framework Test Structure Example Source: https://netascode.cisco.com/docs/guides/concepts/testing Demonstrates the basic structure of a Robot Framework test suite, including settings, documentation, suite setup, default tags, resource imports, and test cases. This is used by nac-test to define validation logic. ```robotframework *** Settings *** Documentation Verify Fabric Nodes Suite Setup Login APIC Default Tags apic day1 config node_policies Resource ./apic_common.resource *** Test Cases *** ``` -------------------------------- ### General Deployment Configuration Example Source: https://netascode.cisco.com/docs/data_models/fmc/system/deployment An example configuration showing how to set general deployment options, including device-specific deployment actions. ```yaml fmc: system: deployment: ignore_warning: true domains: - name: Global devices: devices: - name: MyDeviceName1 deploy: true ``` -------------------------------- ### Onboarding Template Example Source: https://netascode.cisco.com/docs/data_models/catalyst_center/templates/template Demonstrates the YAML configuration for an onboarding template, specifying its properties and device compatibility. ```yaml catalyst_center: templates: projects: - name: Project_Onboarding description: Project_Onboarding onboarding_templates: - name: onboarding_template description: Onboarding Template language: JINJA composite: false device_types: - product_family: "Switches and Hubs" product_series: "Cisco Catalyst 9300 Series Switches" software_type: IOS-XE ``` -------------------------------- ### VXLAN Underlay General Configuration Example Source: https://netascode.cisco.com/docs/data_models/vxlan/underlay/underlay_general Provides a sample configuration demonstrating how to set various parameters for the VXLAN underlay's general settings, such as routing protocol and MTU. ```YAML vxlan: underlay: general: routing_protocol: ospf enable_ipv6_underlay: false replication_mode: multicast manual_underlay_allocation: false underlay_routing_loopback_id: 0 underlay_vtep_loopback_id: 1 underlay_routing_protocol_tag: UNDERLAY underlay_rp_loopback_id: 254 intra_fabric_interface_mtu: 9216 layer2_host_interface_mtu: 9216 unshut_host_interfaces: True ``` -------------------------------- ### APIC Tenants Configuration Example Source: https://netascode.cisco.com/docs/data_models/apic/tenants/filter Provides example YAML configurations for APIC tenants, demonstrating both a simple and a full setup for filters and entries. These examples illustrate how to apply the data model structure for practical network policy definition. ```YAML apic: tenants: - name: ABC filters: - name: FILTER1 entries: - name: HTTP ethertype: ip protocol: tcp destination_from_port: 80 stateful: true ``` ```YAML apic: tenants: - name: ABC filters: - name: FILTER1 alias: ABC-FILTER1 description: My Desc entries: - name: ENTRY1 alias: ENTRY1-ALIAS ethertype: ip protocol: tcp source_from_port: 80 source_to_port: 80 destination_from_port: 80 destination_to_port: 80 stateful: true ``` -------------------------------- ### Install nac-test Source: https://netascode.cisco.com/docs/guides/concepts/testing Installs the nac-test CLI tool, which is required for running automated network validation tests. Python 3.10+ is a prerequisite. ```shell pip install nac-test ``` -------------------------------- ### Install and Initialize Pre-commit Source: https://netascode.cisco.com/docs/guides/concepts/validation Installs the `pre-commit` tool and initializes it for the current Git repository. This command must be run from the repository root to set up the hooks. ```shell > pip install pre-commit > pre-commit install pre-commit installed at .git/hooks/pre-commit ``` -------------------------------- ### Clone Example Repository Source: https://netascode.cisco.com/docs/start/ndfc/first_steps Clones the Ansible VXLAN example repository from GitHub to create a project skeleton. Requires Git client. ```bash git clone https://github.com/netascode/ansible-dc-vxlan-example.git nac-vxlan ``` -------------------------------- ### VXLAN Access Port-Channel Configuration Example Source: https://netascode.cisco.com/docs/data_models/vxlan/topology/interface/access_po_interface Example YAML configuration demonstrating the setup of port-channel interfaces for access layer connectivity in a VXLAN fabric, including VPC configurations. ```YAML vxlan: topology: switches: - name: dc1-leaf1 interfaces: - name: port-channel10 mode: access description: 'VPC Access Interface 1 Leaf 1' enabled: true pc_mode: active vpc_id: 10 # (VPC Port-channel) mtu: jumbo speed: auto access_vlan: 10 spanning_tree_portfast: true enable_bpdu_guard: true members: - eth1/11 - eth1/12 - name: po20 mode: access description: 'Port-channel Access Interface 1' enabled: true pc_mode: active mtu: default speed: auto access_vlan: 20 spanning_tree_portfast: true enable_bpdu_guard: true members: - eth1/21 - eth1/22 - name: dc1-leaf2 interfaces: - name: port-channel10 mode: access description: 'VPC Access Interface 1 Leaf 2' enabled: true pc_mode: active vpc_id: 10 # (VPC Port-channel) mtu: jumbo speed: auto access_vlan: 10 spanning_tree_portfast: true enable_bpdu_guard: true members: - eth1/11 - eth1/12 - name: po20 mode: access description: 'Port-channel Access Interface 2' enabled: true pc_mode: active mtu: default speed: auto access_vlan: 20 spanning_tree_portfast: true members: - eth1/21 - eth1/22 ``` -------------------------------- ### APIC Configuration: Simple Example Source: https://netascode.cisco.com/docs/data_models/apic/tenants/endpoint_group A basic Cisco APIC configuration example demonstrating essential components like tenants, application profiles, endpoint groups, bridge domains, physical domains, static ports, and contracts. This serves as a foundational example for APIC setup. ```YAML apic: tenants: - name: ABC application_profiles: - name: AP1 endpoint_groups: - name: EPG1 bridge_domain: BD1 physical_domains: - PHY1 static_ports: - node_id: 101 port: 10 vlan: 135 contracts: consumers: - CON1 ``` -------------------------------- ### Full GoTo APIC Configuration Example Source: https://netascode.cisco.com/docs/data_models/apic/tenants/l4l7_device Provides a comprehensive example of an APIC configuration for a GoTo service, including device aliases, context awareness, service type, and detailed interface configurations. ```yaml apic: tenants: - name: ABC services: l4l7_devices: - name: DEV1 alias: DEV1-ALIAS context_aware: single-Context type: PHYSICAL function: GoTo copy_device: false managed: false promiscuous_mode: false service_type: FW trunking: false physical_domain: PHY1 concrete_devices: - name: DEV1 alias: DEV1-ALIAS vcenter_name: vm_name: interfaces: - name: INT1 alias: INT1-ALIAS vnic_name: node_id: 101 module: 1 port: 11 - name: INT2 node_id: 101 fex_id: 101 port: 13 logical_interfaces: - name: INT1 alias: INT1-ALIAS vlan: 135 concrete_interfaces: - device: DEV1 interface_name: INT1 ``` -------------------------------- ### Clone NAC ACI Simple Example Repository Source: https://netascode.cisco.com/docs/start/aci/first_steps This command clones the example repository for managing ACI with Network as Code. It requires Git to be installed on your system. ```Git git clone https://github.com/netascode/nac-aci-simple-example.git ``` -------------------------------- ### Complete VXLAN Configuration Example Source: https://netascode.cisco.com/docs/data_models/vxlan/fabric/fabric A comprehensive YAML example demonstrating the structure of VXLAN configuration, including fabric details and global settings. ```yaml vxlan: fabric: name: nac-ndfc type: VXLAN_EVPN global: bgp_asn: "65000.1" # Use quotes route_reflectors: 2 anycast_gateway_mac: de:ad:be:ef:fe:ed enable_nxapi_http: false ``` -------------------------------- ### Example Discovery Configuration Source: https://netascode.cisco.com/docs/data_models/catalyst_center/inventory/discovery An example YAML configuration for setting up network device discovery in Cisco Catalyst Center, specifying discovery parameters and referencing global credentials. ```YAML catalyst_center: inventory: discovery: - name: Discovery1 type: Range global_credential_list: - dnacadmin ip_address_list: "198.18.130.1-198.18.130.10" preferred_ip_method: None protocol_order: SSH,Telnet time_out: 60 ``` -------------------------------- ### Example: Permit AS Paths Starting with 100 Source: https://netascode.cisco.com/docs/data_models/vxlan/overlay_extensions/route_control/ip_as_path_access_lists Configures an IP AS-path list named 'AllowFrom_AS_100' to permit BGP routes where the AS path starts with '100_' followed by any number of valid AS numbers. This list is then applied to a BGP neighbor. ```cli ip as-path access-list AllowFrom_AS_100 seq 10 permit "^100_[0-9]*$" ``` ```yaml --- vxlan: overlay_extensions: route_control: ip_as_path_access_lists: - name: AllowFrom_AS_100 entries: - seq_number: 10 operation: permit bgp_as_paths_regex: '^100_[0-9]*$' groups: - name: ipaspath_RCtrlGrp ip_as_path_access_lists: - name: AllowFrom_AS_100 switches: - name: netascode-leaf1 groups: - ipaspath_RCtrlGrp ``` -------------------------------- ### FMC IPv6 Address Pool Configuration Example Source: https://netascode.cisco.com/docs/data_models/fmc/objects/ipv6_address_pool Example configuration snippet demonstrating how to define an IPv6 Address Pool object in FMC, including its name, description, start address, number of addresses, and overridable status. ```YAML fmc: domains: - name: Global objects: ipv6_address_pools: - name: MyIPv6AddressPool1 description: My Test IPv6 Address Pool 1 start_address: 2001:db8::1/64 number_of_addresses: 100 overridable: false ``` -------------------------------- ### SDWAN Site List Configuration Example Source: https://netascode.cisco.com/docs/data_models/sdwan/classic_policy_objects/site_list An example demonstrating the configuration of SDWAN site lists, including a list with specific site IDs and another with a range of site IDs. ```yaml sdwan: policy_objects: site_lists: - name: SL-EMEA site_ids: - 1000 - 2000 site_id_ranges: - from: 10000 to: 19999 - name: DC site_ids: - 100000 ``` -------------------------------- ### Example Building Configuration Source: https://netascode.cisco.com/docs/data_models/catalyst_center/sites/building An example demonstrating the structure of a building configuration using YAML, showcasing key attributes like name, latitude, longitude, and parent name. ```YAML catalyst_center: sites: buildings: - name: Toronto City Hall latitude: 43.653 longitude: -79.384 parent_name: Global/Canada/Toronto City Hall ``` -------------------------------- ### Cisco SDWAN Management VPN Configuration Example Source: https://netascode.cisco.com/docs/data_models/sdwan/features_transport/transport_management_vpn Example configuration demonstrating the setup of a transport profile with a management VPN, including DNS settings and an IPv4 static default route using a variable for the next hop. ```YAML sdwan: feature_profiles: transport_profiles: - name: transport1 management_vpn: name: management_vpn ipv4_primary_dns_address: 1.1.1.1 ipv4_secondary_dns_address: 1.0.0.1 ipv4_static_routes: - network_address: 0.0.0.0 subnet_mask: 0.0.0.0 next_hops: - address_variable: vpn512_default_gateway ``` -------------------------------- ### Node Inventory Configuration Example Source: https://netascode.cisco.com/docs/guides/concepts/testing An example YAML file defining node policies and inventory for Cisco APIC. This structure is used by Robot Framework to drive tests and provide node-specific data. ```YAML apic: node_policies: inb_endpoint_group: inb oob_endpoint_group: default nodes: - id: 101 pod: 1 role: leaf serial_number: FDOAAAA9JB name: leaf-101 oob_address: 10.61.124.141/24 oob_gateway: 10.61.124.1 update_group: MG1 fabric_policy_group: all-leafs access_policy_group: all-leafs - id: 102 pod: 1 role: leaf serial_number: FDAAAAA9V8 name: leaf-102 oob_address: 10.61.124.152/24 oob_gateway: 10.61.124.1 update_group: MG2 fabric_policy_group: all-leafs access_policy_group: all-leafs ``` -------------------------------- ### FMC Device Configuration Example Source: https://netascode.cisco.com/docs/data_models/fmc/devices/device Example of configuring a Cisco FMC device with basic settings and licenses. ```python fmc: domains: - name: Global devices: devices: - name: MyDeviceName1 host: 10.62.158.201 registration_key: cisco123 access_policy: MyAccessPolicyName1 deploy: true licenses: - ESSENTIALS - IPS performance_tier: FTDv5 ``` -------------------------------- ### Configure AS Path List Source: https://netascode.cisco.com/docs/data_models/sdwan/policy_objects/as_path_list Examples demonstrating how to configure AS Path Lists in Cisco SDWAN using YAML. The first example matches AS paths starting with specific AS numbers, while the second matches paths ending with an AS number or containing a specific AS number. ```yaml sdwan: feature_profiles: policy_object_profile: as_path_lists: - name: aspath_list10 id: 10 as_paths: - "^65100" - "^65101" ``` ```yaml sdwan: feature_profiles: policy_object_profile: as_path_lists: - name: aspath_list20 id: 20 as_paths: - "65999$" - "_65000_" ``` -------------------------------- ### Simple APIC Redirect Policy Configuration Source: https://netascode.cisco.com/docs/data_models/apic/tenants/redirect_policy A basic YAML configuration example for APIC redirect policies, demonstrating L3 and L1/L2 destination setups. ```YAML apic: tenants: - name: ABC services: redirect_policies: - name: PBR1 l3_destinations: - ip: 1.1.1.1 mac: 00:00:00:11:22:33 - name: PBR_L1 type: L1 l1l2_destinations: - name: L1_DEST1 concrete_interface: l4l7_device: DEV-L1 concrete_device: DEV1-L1 interface: INT1 - name: PBR_L2 type: L2 l1l2_destinations: - name: L2_DEST1 concrete_interface: l4l7_device: DEV-L2 concrete_device: DEV1-L2 interface: INT1 ``` -------------------------------- ### Meraki Configuration Sample Source: https://netascode.cisco.com/docs/data_models/meraki/networks_switch/general_settings/settings An example YAML configuration file demonstrating how to set up Meraki network and switch settings, including VLAN and power configurations. ```yaml meraki: domains: - name: EMEA administrator: name: Foo Bar organizations: - name: Dev networks: - name: Dev-main-cx-provider product_types: - appliance - camera - switch - wireless switch: settings: vlan: 99 use_combined_power: false uplink_client_sampling: enabled: true mac_blocklist: enabled: false ``` -------------------------------- ### APIC Tenant and Bridge Domain Configuration Examples Source: https://netascode.cisco.com/docs/data_models/apic/tenants/bridge_domain Provides two YAML examples for configuring Cisco APIC. The first shows a basic tenant and bridge domain setup, while the second illustrates a more comprehensive configuration with advanced parameters like MAC addresses, IP learning, and L3Out associations. ```yaml apic: tenants: - name: ABC bridge_domains: - name: BD1 vrf: VRF1 subnets: - ip: 1.1.1.1/24 ``` ```yaml apic: tenants: - name: ABC bridge_domains: - name: BD1 alias: ABC_BD1 mac: 00:22:BD:F8:19:FE virtual_mac: 00:23:BD:F8:19:12 ep_move_detection: true arp_flooding: false ip_dataplane_learning: false limit_ip_learn_to_subnets: false multi_destination_flooding: encap-flood unknown_unicast: proxy unknown_ipv4_multicast: flood unknown_ipv6_multicast: flood unicast_routing: true clear_remote_mac_entries: true advertise_host_routes: true l3_multicast: false multicast_arp_drop: false vrf: VRF1 nd_interface_policy: "ND_INTF_POL1" endpoint_retention_policy: ERP1 subnets: - ip: 1.1.1.1/24 description: My Desc primary_ip: true public: true shared: true virtual: false igmp_querier: true nd_ra_prefix: true no_default_gateway: false - ip: fd00:0:abcd:1::1/64 description: My IPv6 Desc primary_ip: true public: true shared: false virtual: false igmp_querier: true nd_ra_prefix: true no_default_gateway: false nd_ra_prefix_policy: ND-RA-PREFIX1 ip_dataplane_learning: false l3outs: - L3OUT1 dhcp_labels: - dhcp_relay_policy: DHCP-RELAY1 dhcp_option_policy: DHCP-OPTION1 ``` -------------------------------- ### NDO Sites Configuration Example Source: https://netascode.cisco.com/docs/data_models/ndo/ndo/site An example configuration demonstrating how to define a site with APIC connection details and location. ```yaml ndo: sites: - name: APIC1 apic_urls: - https://10.10.10.10 username: admin password: Cisco123456 id: 1 location: long: '50' lat: '50' ``` -------------------------------- ### Initialize and Apply Terraform Configuration Source: https://netascode.cisco.com/docs/start/aci/first_steps Commands to initialize the Terraform working directory and apply the defined infrastructure changes. 'terraform init' downloads providers, while 'terraform apply' creates or updates resources, requiring user confirmation. ```bash terraform init ``` ```bash terraform apply ``` -------------------------------- ### Example SDWAN AAA Configuration Source: https://netascode.cisco.com/docs/data_models/sdwan/features_system/system_aaa A sample YAML configuration for Cisco SDWAN demonstrating the setup of AAA, including authentication order, TACACS+ server groups, and user definitions. ```yaml sdwan: feature_profiles: system_profiles: - name: system aaa: name: aaa description: basic aaa auth_order: - tacacs-511 - local tacacs_groups: - vpn: 511 source_interface_variable: tacacs_source_interface servers: - address: 10.1.1.1 port: 49 key: $CRYPT_CLUSTER$jq34CKAzT5KGdEjIpYarKg==$MZkY/AdOWzm/kiLHOsKHJg== secret_key: 070c285f4d06485744 - address: 10.1.1.2 key: $CRYPT_CLUSTER$jq34CKAzT5KGdEjIpYarKg==$MZkY/AdOWzm/kiLHOsKHJg== secret_key: 070c285f4d06485744 users: - name: admin password: $6$Oz2ydqNXLLDIsPSG$LhogoactFVb9eJgqgv/O/Zb.FHg74drK4maijc.Q9q/KhyDcPfwrHx9Vy6G9hY7oKWbyas4XKms7f7Znl/ndF. privilege: 15 - name: failsafe password: $6$v0UN8x4fkvZd0Lnj$hq13MC.W5ElstGlolO38fshGEYxSechW4K5zEdrJD1trSH30AaNKvL4VUlOtxersGmIDNefPwyrSqbJpCpXGJ. privilege: 15 authorization_rules: - id: rule1 method: commands level: 15 groups: - tacacs-511 authenticated: true ``` -------------------------------- ### Meraki Network Appliance Configuration Sample Source: https://netascode.cisco.com/docs/data_models/meraki/networks_appliance/settings Provides an example of how to configure Meraki network appliance settings, including client tracking method, deployment mode, and dynamic DNS parameters. ```yaml meraki: domains: - name: EMEA administrator: name: Foo Bar organizations: - name: Dev networks: - name: Dev-main-cx-provider product_types: - appliance - camera - switch - wireless appliance: settings: client_tracking_method: "MAC address" deployment_mode: routed dynamic_dns: prefix: "my-network" enabled: true ```