! Pcornel Finals - Case Skills Exam / L3 Switch ! Content version: 1.1-draft ! REFERENCE ONLY: replace every placeholder and choose the correct device/task-specific variants. ! Basic configuration is active text; all alternative sections below are commented references. ! Use Copy Section for a single relevant variant. Do not paste this entire file blindly. ! Basic configuration enable configure terminal hostname [HOSTNAME] ip domain-name [DOMAIN-NAME] enable secret [ENABLE-SECRET] username [USERNAME] privilege 15 secret [PASSWORD] line console 0 login local logging synchronous exit line vty 0 [VTY-LAST] login local exit ip routing ipv6 unicast-routing end ! VLAN / Create a VLAN ! enable ! configure terminal ! vlan [VLAN-ID] ! name [VLAN-NAME] ! exit ! end ! VLAN / Assign an access interface ! enable ! configure terminal ! vlan [VLAN-ID] ! name [VLAN-NAME] ! exit ! interface [INTERFACE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! no shutdown ! exit ! end ! VLAN / Layer 3 SVI ! enable ! configure terminal ! ip routing ! vlan [VLAN-ID] ! name [VLAN-NAME] ! exit ! interface vlan [VLAN-ID] ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! VLAN / IPv6 routed SVI ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! vlan [VLAN-ID] ! exit ! interface vlan [VLAN-ID] ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! VLAN / Voice VLAN (only if requested) ! enable ! configure terminal ! vlan [VLAN-ID] ! exit ! vlan [VOICE-VLAN] ! exit ! interface [INTERFACE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! switchport voice vlan [VOICE-VLAN] ! no shutdown ! exit ! end ! 802.1Q Trunking / Static 802.1Q trunk ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! enable ! configure terminal ! interface [INTERFACE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! exit ! end ! EtherChannel / TRUNK – LACP active / active ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! exit ! end ! EtherChannel / TRUNK – LACP active / passive ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! exit ! end ! EtherChannel / TRUNK – PAgP desirable / desirable ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! PAgP support is platform-dependent. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! exit ! end ! EtherChannel / TRUNK – PAgP desirable / auto ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! PAgP support is platform-dependent. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! exit ! end ! EtherChannel / TRUNK – Static on / on ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! Both endpoints must be explicitly configured on; incorrect static bundling can cause loops or loss of traffic. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! channel-group [CHANNEL-GROUP] mode on ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! exit ! end ! EtherChannel / ACCESS – LACP active / active ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! no shutdown ! exit ! end ! EtherChannel / ACCESS – LACP active / passive ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! no shutdown ! exit ! end ! EtherChannel / ACCESS – PAgP desirable / desirable ! PAgP support is platform-dependent. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! no shutdown ! exit ! end ! EtherChannel / ACCESS – PAgP desirable / auto ! PAgP support is platform-dependent. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! no shutdown ! exit ! end ! EtherChannel / ACCESS – Static on / on ! Both endpoints must be explicitly configured on; incorrect static bundling can cause loops or loss of traffic. ! enable ! configure terminal ! interface range [INTERFACE-RANGE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! channel-group [CHANNEL-GROUP] mode on ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – LACP active / active ! enable ! configure terminal ! ip routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – LACP active / passive ! enable ! configure terminal ! ip routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – PAgP desirable / desirable ! PAgP support is platform-dependent. ! enable ! configure terminal ! ip routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – PAgP desirable / auto ! PAgP support is platform-dependent. ! enable ! configure terminal ! ip routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – Static on / on ! Both endpoints must be explicitly configured on; incorrect static bundling can cause loops or loss of traffic. ! enable ! configure terminal ! ip routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode on ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – LACP active / active (IPv6) ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – LACP active / passive (IPv6) ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode active ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – PAgP desirable / desirable (IPv6) ! PAgP support is platform-dependent. ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – PAgP desirable / auto (IPv6) ! PAgP support is platform-dependent. ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode desirable ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! EtherChannel / ROUTED – Static on / on (IPv6) ! Both endpoints must be explicitly configured on; incorrect static bundling can cause loops or loss of traffic. ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! interface range [INTERFACE-RANGE] ! no switchport ! channel-group [CHANNEL-GROUP] mode on ! no shutdown ! exit ! interface port-channel [CHANNEL-GROUP] ! no switchport ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! STP / Rapid PVST+ ! enable ! configure terminal ! spanning-tree mode rapid-pvst ! end ! STP / PVST+ ! enable ! configure terminal ! spanning-tree mode pvst ! end ! STP / Root primary ! enable ! configure terminal ! spanning-tree vlan [VLAN-ID] root primary ! end ! STP / Root secondary ! enable ! configure terminal ! spanning-tree vlan [VLAN-ID] root secondary ! end ! STP / Explicit bridge priority ! Use an allowed multiple of 4096; a lower bridge ID is preferred. ! enable ! configure terminal ! spanning-tree vlan [VLAN-ID] priority [BRIDGE-PRIORITY] ! end ! STP / Explicit port cost ! enable ! configure terminal ! interface [INTERFACE] ! spanning-tree vlan [VLAN-ID] cost [STP-COST] ! exit ! end ! STP / Explicit port priority ! Port priority is an additional tie-breaker; select a supported increment. ! enable ! configure terminal ! interface [INTERFACE] ! spanning-tree vlan [VLAN-ID] port-priority [PORT-PRIORITY] ! exit ! end ! PortFast / Access edge port ! enable ! configure terminal ! interface [INTERFACE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! spanning-tree portfast ! no shutdown ! exit ! end ! PortFast / Default on access edge ports ! Review all affected non-trunk interfaces first. ! enable ! configure terminal ! spanning-tree portfast default ! end ! PortFast / Trunk to an edge endpoint ! On a switch with fixed 802.1Q encapsulation, omit the encapsulation selection command if it is not supported. Match native VLAN and allowed VLANs at both ends. ! Use only for an explicitly intended edge trunk, never a normal switch-to-switch trunk. ! enable ! configure terminal ! interface [INTERFACE] ! switchport ! switchport trunk encapsulation dot1q ! switchport mode trunk ! switchport trunk native vlan [NATIVE-VLAN] ! switchport trunk allowed vlan [ALLOWED-VLANS] ! no shutdown ! spanning-tree portfast trunk ! exit ! end ! BPDU Guard / Interface BPDU Guard ! enable ! configure terminal ! interface [INTERFACE] ! switchport ! switchport mode access ! switchport access vlan [VLAN-ID] ! spanning-tree portfast ! spanning-tree bpduguard enable ! no shutdown ! exit ! end ! BPDU Guard / Global PortFast BPDU Guard ! enable ! configure terminal ! spanning-tree portfast default ! spanning-tree portfast bpduguard default ! end ! BPDU Guard / Optional timed recovery ! Only enable automatic recovery if requested. A persistent BPDU source can repeatedly disable the port. ! enable ! configure terminal ! errdisable recovery cause bpduguard ! errdisable recovery interval [RECOVERY-SECONDS] ! end ! IPv4 and IPv6 Addressing / L3 switch routed IPv4 ! enable ! configure terminal ! ip routing ! interface [INTERFACE] ! no switchport ! ip address [IP-ADDRESS] [SUBNET-MASK] ! no shutdown ! exit ! end ! IPv4 and IPv6 Addressing / L3 switch routed IPv6 ! enable ! configure terminal ! ip routing ! ipv6 unicast-routing ! interface [INTERFACE] ! no switchport ! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH] ! no shutdown ! exit ! end ! IPv4 and IPv6 Addressing / IPv4 loopback ! enable ! configure terminal ! interface loopback [LOOPBACK-ID] ! ip address [LOOPBACK-IP] 255.255.255.255 ! exit ! end ! IPv4 and IPv6 Addressing / IPv6 loopback ! enable ! configure terminal ! ipv6 unicast-routing ! interface loopback [LOOPBACK-ID] ! ipv6 address [LOOPBACK-IPV6]/128 ! exit ! end ! IPv4 and IPv6 Addressing / Manual link-local address ! enable ! configure terminal ! interface [INTERFACE] ! ipv6 address [LINK-LOCAL-ADDRESS] link-local ! exit ! end ! Static Routing (IPv4/IPv6) / Next-hop route ! enable ! configure terminal ! ip route [NETWORK] [SUBNET-MASK] [NEXT-HOP] ! end ! Static Routing (IPv4/IPv6) / Exit-interface route ! Prefer this on a point-to-point link; on multiaccess Ethernet use a next hop or fully specified route. ! enable ! configure terminal ! ip route [NETWORK] [SUBNET-MASK] [INTERFACE] ! end ! Static Routing (IPv4/IPv6) / Fully specified route ! enable ! configure terminal ! ip route [NETWORK] [SUBNET-MASK] [INTERFACE] [NEXT-HOP] ! end ! Static Routing (IPv4/IPv6) / Default route ! enable ! configure terminal ! ip route 0.0.0.0 0.0.0.0 [NEXT-HOP] ! end ! Static Routing (IPv4/IPv6) / Floating backup route ! Choose a distance greater than the preferred route. ! enable ! configure terminal ! ip route [NETWORK] [SUBNET-MASK] [NEXT-HOP] [BACKUP-DISTANCE] ! end ! Static Routing (IPv4/IPv6) / Next-hop route ! Use a resolvable global-unicast next hop in this form. If the next hop is link-local, include the outgoing interface (fully specified route). ! enable ! configure terminal ! ipv6 route [IPV6-PREFIX]/[PREFIX-LENGTH] [NEXT-HOP-IPV6] ! end ! Static Routing (IPv4/IPv6) / Exit-interface route ! Prefer this on a point-to-point link; on multiaccess Ethernet use a next hop or fully specified route. ! enable ! configure terminal ! ipv6 route [IPV6-PREFIX]/[PREFIX-LENGTH] [INTERFACE] ! end ! Static Routing (IPv4/IPv6) / Fully specified route ! enable ! configure terminal ! ipv6 route [IPV6-PREFIX]/[PREFIX-LENGTH] [INTERFACE] [NEXT-HOP-IPV6] ! end ! Static Routing (IPv4/IPv6) / Default route ! Use a resolvable global-unicast next hop in this form. If the next hop is link-local, include the outgoing interface (fully specified route). ! enable ! configure terminal ! ipv6 route ::/0 [NEXT-HOP-IPV6] ! end ! Static Routing (IPv4/IPv6) / Floating backup route ! Choose a distance greater than the preferred route. ! Use a resolvable global-unicast next hop in this form. If the next hop is link-local, include the outgoing interface (fully specified route). ! enable ! configure terminal ! ipv6 route [IPV6-PREFIX]/[PREFIX-LENGTH] [NEXT-HOP-IPV6] [BACKUP-DISTANCE] ! end ! Route Summarization / IPv4 summary route ! enable ! configure terminal ! ip route [SUMMARY-NETWORK] [SUMMARY-MASK] [NEXT-HOP] ! end ! Route Summarization / IPv6 summary route ! enable ! configure terminal ! ipv6 route [SUMMARY-IPV6-PREFIX]/[SUMMARY-PREFIX-LENGTH] [NEXT-HOP-IPV6] ! end ! Route Summarization / OSPFv2 ABR summary ! enable ! configure terminal ! router ospf [PROCESS-ID] ! area [AREA-ID] range [SUMMARY-NETWORK] [SUMMARY-MASK] ! exit ! end ! Route Summarization / Legacy OSPFv3 ABR summary ! enable ! configure terminal ! ipv6 router ospf [PROCESS-ID] ! area [AREA-ID] range [SUMMARY-IPV6-PREFIX]/[SUMMARY-PREFIX-LENGTH] ! exit ! end ! Route Summarization / OSPFv2 ASBR external summary ! enable ! configure terminal ! router ospf [PROCESS-ID] ! summary-address [SUMMARY-NETWORK] [SUMMARY-MASK] ! exit ! end ! Route Summarization / BGP IPv4 aggregate ! Requires contributing more-specific BGP routes. summary-only suppresses their advertisement. ! enable ! configure terminal ! router bgp [LOCAL-AS] ! address-family ipv4 unicast ! aggregate-address [SUMMARY-NETWORK] [SUMMARY-MASK] summary-only ! exit-address-family ! exit ! end ! Route Summarization / Traditional OSPFv3 ASBR external summary ! Use on the ASBR for redistributed external routes, not inter-area summarization. ! enable ! configure terminal ! ipv6 router ospf [PROCESS-ID] ! summary-prefix [SUMMARY-IPV6-PREFIX]/[SUMMARY-PREFIX-LENGTH] ! exit ! end ! Route Summarization / BGP IPv6 aggregate ! Requires contributing more-specific BGP routes; summary-only suppresses their advertisement. ! enable ! configure terminal ! router bgp [LOCAL-AS] ! address-family ipv6 unicast ! aggregate-address [SUMMARY-IPV6-PREFIX]/[SUMMARY-PREFIX-LENGTH] summary-only ! exit-address-family ! exit ! end ! OSPFv2 / Network statement ! enable ! configure terminal ! router ospf [PROCESS-ID] ! router-id [ROUTER-ID] ! network [NETWORK] [WILDCARD-MASK] area [AREA-ID] ! exit ! end ! OSPFv2 / Interface activation ! enable ! configure terminal ! router ospf [PROCESS-ID] ! router-id [ROUTER-ID] ! exit ! interface [INTERFACE] ! ip ospf [PROCESS-ID] area [AREA-ID] ! exit ! end ! OSPFv2 / Passive by default with selected neighbors ! enable ! configure terminal ! router ospf [PROCESS-ID] ! passive-interface default ! no passive-interface [NEIGHBOR-INTERFACE] ! exit ! end ! OSPFv2 / Multi-area interfaces ! enable ! configure terminal ! router ospf [PROCESS-ID] ! router-id [ROUTER-ID] ! exit ! interface [BACKBONE-INTERFACE] ! ip ospf [PROCESS-ID] area 0 ! exit ! interface [OTHER-INTERFACE] ! ip ospf [PROCESS-ID] area [AREA-ID] ! exit ! end ! OSPFv2 / Originate default route ! Normally requires an installed default route; use always only if specified. ! enable ! configure terminal ! router ospf [PROCESS-ID] ! default-information originate ! exit ! end ! OSPFv2 / Legacy MD5 interface authentication ! Legacy lab authentication; match key ID and secret on both peers. ! enable ! configure terminal ! interface [INTERFACE] ! ip ospf authentication message-digest ! ip ospf message-digest-key [KEY-ID] md5 [SHARED-SECRET] ! exit ! end ! OSPFv3 (Traditional/Legacy) / Traditional IPv6 OSPFv3 ! enable ! configure terminal ! ipv6 unicast-routing ! ipv6 router ospf [PROCESS-ID] ! router-id [ROUTER-ID] ! exit ! interface [INTERFACE] ! ipv6 ospf [PROCESS-ID] area [AREA-ID] ! exit ! end ! OSPFv3 (Traditional/Legacy) / Passive interface ! enable ! configure terminal ! ipv6 router ospf [PROCESS-ID] ! passive-interface [INTERFACE] ! exit ! end ! OSPFv3 (Traditional/Legacy) / Traditional multi-area ! enable ! configure terminal ! ipv6 router ospf [PROCESS-ID] ! router-id [ROUTER-ID] ! exit ! interface [BACKBONE-INTERFACE] ! ipv6 ospf [PROCESS-ID] area 0 ! exit ! interface [OTHER-INTERFACE] ! ipv6 ospf [PROCESS-ID] area [AREA-ID] ! exit ! end ! MP-BGP (IPv4/IPv6) / IPv4 eBGP address family ! enable ! configure terminal ! router bgp [LOCAL-AS] ! bgp router-id [ROUTER-ID] ! no bgp default ipv4-unicast ! neighbor [NEIGHBOR-IP] remote-as [REMOTE-AS] ! address-family ipv4 unicast ! neighbor [NEIGHBOR-IP] activate ! network [NETWORK] mask [SUBNET-MASK] ! exit-address-family ! exit ! end ! MP-BGP (IPv4/IPv6) / IPv6 eBGP address family ! enable ! configure terminal ! router bgp [LOCAL-AS] ! bgp router-id [ROUTER-ID] ! no bgp default ipv4-unicast ! neighbor [NEIGHBOR-IPV6] remote-as [REMOTE-AS] ! address-family ipv6 unicast ! neighbor [NEIGHBOR-IPV6] activate ! network [IPV6-PREFIX]/[PREFIX-LENGTH] ! exit-address-family ! exit ! end ! MP-BGP (IPv4/IPv6) / IPv4 iBGP using loopback ! Loopbacks need reachability before the session can establish. Use next-hop-self where needed. ! enable ! configure terminal ! router bgp [LOCAL-AS] ! bgp router-id [ROUTER-ID] ! neighbor [NEIGHBOR-IP] remote-as [LOCAL-AS] ! neighbor [NEIGHBOR-IP] update-source loopback [LOOPBACK-ID] ! address-family ipv4 unicast ! neighbor [NEIGHBOR-IP] activate ! neighbor [NEIGHBOR-IP] next-hop-self ! exit-address-family ! exit ! end ! MP-BGP (IPv4/IPv6) / IPv6 iBGP using loopback ! Loopbacks need IPv6 reachability. ! enable ! configure terminal ! router bgp [LOCAL-AS] ! bgp router-id [ROUTER-ID] ! no bgp default ipv4-unicast ! neighbor [NEIGHBOR-IPV6] remote-as [LOCAL-AS] ! neighbor [NEIGHBOR-IPV6] update-source loopback [LOOPBACK-ID] ! address-family ipv6 unicast ! neighbor [NEIGHBOR-IPV6] activate ! neighbor [NEIGHBOR-IPV6] next-hop-self ! exit-address-family ! exit ! end ! IP SLA / ICMP echo with source interface ! enable ! configure terminal ! ip sla [SLA-ID] ! icmp-echo [DESTINATION-IP] source-interface [SOURCE-INTERFACE] ! timeout [TIMEOUT-MS] ! frequency [FREQUENCY-SECONDS] ! exit ! ip sla schedule [SLA-ID] life forever start-time now ! end ! IP SLA / ICMP echo with source IPv4 address ! enable ! configure terminal ! ip sla [SLA-ID] ! icmp-echo [DESTINATION-IP] source-ip [SOURCE-IP] ! timeout [TIMEOUT-MS] ! frequency [FREQUENCY-SECONDS] ! exit ! ip sla schedule [SLA-ID] life forever start-time now ! end ! Object Tracking / Track IP SLA reachability ! enable ! configure terminal ! track [TRACK-ID] ip sla [SLA-ID] reachability ! delay down [DOWN-SECONDS] up [UP-SECONDS] ! exit ! end ! Object Tracking / Track interface line protocol ! enable ! configure terminal ! track [TRACK-ID] interface [INTERFACE] line-protocol ! exit ! end ! Object Tracking / Tracked static IPv4 route ! Create the tracked object before applying this route. ! enable ! configure terminal ! ip route [NETWORK] [SUBNET-MASK] [NEXT-HOP] track [TRACK-ID] ! end ! HSRPv2 (IPv4/IPv6) / IPv4 HSRPv2 ! enable ! configure terminal ! interface [INTERFACE] ! standby version 2 ! standby [HSRP-GROUP] ip [VIRTUAL-IP] ! standby [HSRP-GROUP] priority [PRIORITY] ! standby [HSRP-GROUP] preempt ! exit ! end ! HSRPv2 (IPv4/IPv6) / IPv6 HSRPv2 autoconfig ! Ensure a real IPv6 interface address or appropriate IPv6 enabling is present before configuring HSRP. ! enable ! configure terminal ! ipv6 unicast-routing ! interface [INTERFACE] ! standby version 2 ! standby [HSRP-GROUP] ipv6 autoconfig ! standby [HSRP-GROUP] priority [PRIORITY] ! standby [HSRP-GROUP] preempt ! exit ! end ! HSRPv2 (IPv4/IPv6) / IPv6 HSRPv2 manual virtual link-local ! Ensure a real IPv6 interface address or appropriate IPv6 enabling is present before configuring HSRP. ! enable ! configure terminal ! ipv6 unicast-routing ! interface [INTERFACE] ! standby version 2 ! standby [HSRP-GROUP] ipv6 [VIRTUAL-LINK-LOCAL] ! standby [HSRP-GROUP] priority [PRIORITY] ! standby [HSRP-GROUP] preempt ! exit ! end ! HSRPv2 (IPv4/IPv6) / HSRP object tracking ! enable ! configure terminal ! interface [INTERFACE] ! standby [HSRP-GROUP] track [TRACK-ID] decrement [DECREMENT] ! exit ! end ! HSRPv2 (IPv4/IPv6) / Custom HSRP timers ! Match on both peers. ! enable ! configure terminal ! interface [INTERFACE] ! standby [HSRP-GROUP] timers [HELLO-SECONDS] [HOLD-SECONDS] ! exit ! end ! Password Hashing Algorithms / Generate type 9 (scrypt) local secret ! enable ! configure terminal ! username [USERNAME] algorithm-type scrypt secret [PASSWORD] ! enable algorithm-type scrypt secret [ENABLE-SECRET] ! end ! Password Hashing Algorithms / Generate type 8 (PBKDF2-SHA256) secret ! enable ! configure terminal ! username [USERNAME] algorithm-type sha256 secret [PASSWORD] ! enable algorithm-type sha256 secret [ENABLE-SECRET] ! end ! Password Hashing Algorithms / Generate legacy type 5 (MD5) secret ! Legacy exam compatibility only; modern platforms may reject or convert type 5. ! enable ! configure terminal ! username [USERNAME] algorithm-type md5 secret [PASSWORD] ! enable algorithm-type md5 secret [ENABLE-SECRET] ! end ! Password Hashing Algorithms / Explicit type 0 line password ! Plaintext input and storage unless password encryption is enabled. ! enable ! configure terminal ! line console 0 ! password 0 [PASSWORD] ! login ! exit ! end ! Password Hashing Algorithms / Legacy service password encryption ! Obfuscates applicable plaintext line passwords as type 7. It does not create a strong hash. ! enable ! configure terminal ! service password-encryption ! end ! Password Hashing Algorithms / Import an already encoded type 9 secret ! The value must already be a valid encoded type 9 secret, not a plaintext password. ! enable ! configure terminal ! username [USERNAME] secret 9 [ENCODED-TYPE9-SECRET] ! end ! AAA / AAA local default login ! enable ! configure terminal ! ! Secret hash depends on the IOS/IOS XE release and platform. ! ! Prefer type 9 (scrypt) or type 8 (PBKDF2-SHA-256) where supported; type 5 (MD5) is legacy. ! ! See Password Hashing for algorithm-type examples; secret 8/9 requires an encoded hash. ! username [USERNAME] privilege 15 secret [PASSWORD] ! aaa new-model ! aaa authentication login default local ! end ! AAA / Explicit local console list ! enable ! configure terminal ! aaa new-model ! aaa authentication login [CONSOLE-LIST] local ! line console 0 ! login authentication [CONSOLE-LIST] ! exit ! end ! AAA / Named VTY login list ! enable ! configure terminal ! aaa new-model ! aaa authentication login [LOGIN-LIST] local ! line vty 0 [VTY-LAST] ! login authentication [LOGIN-LIST] ! exit ! end ! AAA / RADIUS with local fallback ! Create the RADIUS group first. Local fallback normally occurs if the server is unavailable, not when it rejects credentials. ! enable ! configure terminal ! aaa new-model ! aaa authentication login [LOGIN-LIST] group [RADIUS-GROUP] local ! line vty 0 [VTY-LAST] ! login authentication [LOGIN-LIST] ! exit ! end ! AAA / Optional local EXEC authorization ! enable ! configure terminal ! aaa authorization exec [EXEC-LIST] local ! line vty 0 [VTY-LAST] ! authorization exec [EXEC-LIST] ! exit ! end ! RADIUS / Named RADIUS server ! enable ! configure terminal ! aaa new-model ! radius server [RADIUS-SERVER-NAME] ! address ipv4 [SERVER-IP] auth-port 1812 acct-port 1813 ! key [SHARED-SECRET] ! exit ! end ! RADIUS / RADIUS server group ! enable ! configure terminal ! aaa group server radius [RADIUS-GROUP] ! server name [RADIUS-SERVER-NAME] ! exit ! end ! RADIUS / Optional RADIUS source interface ! enable ! configure terminal ! ip radius source-interface [SOURCE-INTERFACE] ! end ! RADIUS / Bind RADIUS with local fallback to VTY ! enable ! configure terminal ! ! Secret hash depends on the IOS/IOS XE release and platform. ! ! Prefer type 9 (scrypt) or type 8 (PBKDF2-SHA-256) where supported; type 5 (MD5) is legacy. ! ! See Password Hashing for algorithm-type examples; secret 8/9 requires an encoded hash. ! username [USERNAME] privilege 15 secret [PASSWORD] ! aaa new-model ! aaa authentication login [LOGIN-LIST] group [RADIUS-GROUP] local ! line vty 0 [VTY-LAST] ! login authentication [LOGIN-LIST] ! exit ! end ! ACL / Named standard IPv4 ACL ! enable ! configure terminal ! ip access-list standard [ACL-NAME] ! permit [SOURCE-NETWORK] [SOURCE-WILDCARD] ! deny any ! exit ! interface [INTERFACE] ! ip access-group [ACL-NAME] [DIRECTION] ! exit ! end ! ACL / Numbered standard IPv4 ACL ! enable ! configure terminal ! access-list [STANDARD-ACL-NUMBER] permit [SOURCE-NETWORK] [SOURCE-WILDCARD] ! access-list [STANDARD-ACL-NUMBER] deny any ! interface [INTERFACE] ! ip access-group [STANDARD-ACL-NUMBER] [DIRECTION] ! exit ! end ! ACL / Named extended IPv4 ACL ! enable ! configure terminal ! ip access-list extended [ACL-NAME] ! permit tcp [SOURCE-NETWORK] [SOURCE-WILDCARD] host [DESTINATION-IP] eq [PORT] ! deny ip any any ! exit ! interface [INTERFACE] ! ip access-group [ACL-NAME] [DIRECTION] ! exit ! end ! ACL / Numbered extended IPv4 ACL ! enable ! configure terminal ! access-list [EXTENDED-ACL-NUMBER] permit tcp [SOURCE-NETWORK] [SOURCE-WILDCARD] host [DESTINATION-IP] eq [PORT] ! access-list [EXTENDED-ACL-NUMBER] deny ip any any ! interface [INTERFACE] ! ip access-group [EXTENDED-ACL-NUMBER] [DIRECTION] ! exit ! end ! ACL / IPv6 ACL ! Allow required IPv6 control traffic such as router advertisements, solicitations and ICMPv6 error messages as appropriate before the final deny. ! enable ! configure terminal ! ipv6 access-list [ACL-NAME] ! permit tcp [SOURCE-IPV6-PREFIX]/[PREFIX-LENGTH] host [DESTINATION-IPV6] eq [PORT] ! permit icmp any any nd-ns ! permit icmp any any nd-na ! deny ipv6 any any ! exit ! interface [INTERFACE] ! ipv6 traffic-filter [ACL-NAME] [DIRECTION] ! exit ! end ! ACL / Restrict IPv4 management sources ! enable ! configure terminal ! ip access-list standard [MGMT-ACL] ! permit [SOURCE-NETWORK] [SOURCE-WILDCARD] ! exit ! line vty 0 [VTY-LAST] ! access-class [MGMT-ACL] in ! exit ! end ! NTP / NTP lab server ! Only use as a local reference when the task requests it; prefer a real upstream time source in production. ! enable ! configure terminal ! ntp master [STRATUM] ! end ! NTP / NTP client ! Point the client at an existing reachable time server. For a local lab time source, use the separate NTP lab server example when requested. ! enable ! configure terminal ! ntp server [SERVER-IP] ! end ! NTP / NTP peer ! enable ! configure terminal ! ntp peer [PEER-IP] ! end ! NTP / Authenticated local NTP server ! enable ! configure terminal ! ntp authentication-key [KEY-ID] md5 [SHARED-SECRET] ! ntp authenticate ! ntp trusted-key [KEY-ID] ! ntp master [STRATUM] ! end ! NTP / Authenticated client ! Point the client at an existing reachable time server. For a local lab time source, use the separate Authenticated local NTP server example when requested. ! enable ! configure terminal ! ntp authentication-key [KEY-ID] md5 [SHARED-SECRET] ! ntp authenticate ! ntp trusted-key [KEY-ID] ! ntp server [SERVER-IP] key [KEY-ID] ! end ! NTP / Authenticated peer ! enable ! configure terminal ! ntp authentication-key [KEY-ID] md5 [SHARED-SECRET] ! ntp authenticate ! ntp trusted-key [KEY-ID] ! ntp peer [PEER-IP] key [KEY-ID] ! end ! Syslog / Local logging buffer ! enable ! configure terminal ! service timestamps log datetime msec ! logging buffered [BUFFER-BYTES] [SEVERITY] ! end ! Syslog / Remote IPv4 Syslog ! enable ! configure terminal ! service timestamps log datetime msec ! logging host [SERVER-IP] ! logging trap [SEVERITY] ! logging on ! end ! Syslog / Optional logging source interface ! enable ! configure terminal ! logging source-interface [SOURCE-INTERFACE] ! end ! SNMPv2c / Read-only community with ACL ! enable ! configure terminal ! ip access-list standard [MGMT-ACL] ! permit host [MANAGER-IP] ! exit ! snmp-server community [COMMUNITY] RO [MGMT-ACL] ! end ! SNMPv2c / Optional read-write community with ACL ! Allows write operations; use only where requested. ! enable ! configure terminal ! ip access-list standard [MGMT-ACL] ! permit host [MANAGER-IP] ! exit ! snmp-server community [COMMUNITY] RW [MGMT-ACL] ! end ! SNMPv2c / SNMPv2c trap destination ! enable ! configure terminal ! snmp-server host [MANAGER-IP] traps version 2c [COMMUNITY] ! snmp-server enable traps snmp linkdown linkup ! end ! SNMPv2c / Device location and contact ! enable ! configure terminal ! snmp-server location [LOCATION] ! snmp-server contact [CONTACT] ! end ! Save only after reviewing and verifying the configuration: ! copy running-config startup-config ! Confirm the destination filename if prompted.