Reference only. Replace placeholders, select the correct sections and verify before saving. Copy All includes the basic block and commented alternatives, never removal commands.
Filters affect the sections shown below. Copy All, TXT downloads and print always include the complete script for this device.
! Pcornel Finals - Case Skills Exam / L2 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
! no ip routing (only on supported Layer 2 devices; do not disable routing on L3 devices)
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 2 management SVI
! Use the default gateway only when the device is not routing IP.
! enable
! configure terminal
! vlan [VLAN-ID]
! name [VLAN-NAME]
! exit
! interface vlan [VLAN-ID]
! ip address [IP-ADDRESS][SUBNET-MASK]
! no shutdown
! exit
! ip default-gateway [NEXT-HOP]
! 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
! 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 / L2 switch IPv6 management SVI
! This is host management, not IPv6 routing. Use a platform that supports IPv6 host/SVI functions. Off-link traffic requires a learned IPv6 default router, normally through Router Advertisements.
! Check the exact model, IOS release, feature image and show sdm prefer before IPv6 management. On supported Catalyst 2960 LAN Base models, select sdm prefer dual-ipv4-and-ipv6 default in global configuration, then end, save the configuration and schedule a reload; verify the active template with show sdm prefer after reboot. Reload interrupts service and is a separate preparation step, not part of this script.
! Do not apply the 2960 template requirement to every switch: Cisco documents that the dual template is not required on 2960-S and is unavailable on 2960 LAN Lite. Confirm support in the matching platform guide.
! enable
! configure terminal
! vlan [VLAN-ID]
! name [VLAN-NAME]
! exit
! interface vlan [VLAN-ID]
! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH]
! no shutdown
! exit
! end
! IPv4 and IPv6 Addressing / L2 switch IPv4 management SVI
! Use ip default-gateway on a nonrouting switch.
! enable
! configure terminal
! vlan [VLAN-ID]
! name [VLAN-NAME]
! exit
! interface vlan [VLAN-ID]
! ip address [IP-ADDRESS][SUBNET-MASK]
! no shutdown
! exit
! ip default-gateway [NEXT-HOP]
! end
! IPv4 and IPv6 Addressing / L2 switch IPv6 management SVI using SLAAC
! Requires IPv6 host/SVI support for the exact model, IOS release and feature image. Apply the same model-dependent SDM preparation described for the static IPv6 management SVI; do not insert template changes or reload into a Golden Script.
! ipv6 address autoconfig is an interface command for host SLAAC. The management SVI must be up/up with an active VLAN member; a router on that VLAN must advertise a /64 prefix with autonomous addressing enabled. Off-link management also needs a usable default router advertised by RA. A static IPv6 address alone does not provide a default router; ip default-gateway is IPv4 only. Do not enable ipv6 unicast-routing for this L2 host example.
! enable
! configure terminal
! vlan [VLAN-ID]
! exit
! interface vlan [VLAN-ID]
! ipv6 address autoconfig
! no shutdown
! 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 / 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.
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
! no ip routing (only on supported Layer 2 devices; do not disable routing on L3 devices)
end
VLAN
VLANs divide a switched network into separate Layer 2 broadcast domains. A switch virtual interface (SVI) provides IP management or inter-VLAN routing when supported and configured.
Create a VLAN Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
Assign an access interface Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
Layer 2 management SVI Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Use the default gateway only when the device is not routing IP.
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
interface vlan [VLAN-ID]
ip address [IP-ADDRESS][SUBNET-MASK]
no shutdown
exit
ip default-gateway [NEXT-HOP]
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[IP-ADDRESS]
Local IPv4 interface address.
[SUBNET-MASK]
IPv4 dotted-decimal subnet mask.
[NEXT-HOP]
IPv4 next-hop address.
Voice VLAN (only if requested) Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
Voice VLAN identifier distinct from the access VLAN.
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
802.1Q Trunking
An 802.1Q trunk transports multiple VLANs across one link. Frames are tagged except for native VLAN traffic under the usual native VLAN behavior.
Static 802.1Q trunk Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
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.
Local interface name including type and number, or an SVI as appropriate.
[NATIVE-VLAN]
Matching native VLAN ID on trunk peers.
[ALLOWED-VLANS]
Comma-separated VLAN IDs and ranges; replace the whole list only when intended.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
EtherChannel bundles compatible physical links into a single logical port-channel. LACP and PAgP negotiate membership; static mode does not negotiate.
TRUNK – LACP active / active Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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.
Comma-separated VLAN IDs and ranges; replace the whole list only when intended.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
TRUNK – LACP active / passive Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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.
Comma-separated VLAN IDs and ranges; replace the whole list only when intended.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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.
Comma-separated VLAN IDs and ranges; replace the whole list only when intended.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
TRUNK – PAgP desirable / auto Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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.
Comma-separated VLAN IDs and ranges; replace the whole list only when intended.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
TRUNK – Static on / on Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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.
Comma-separated VLAN IDs and ranges; replace the whole list only when intended.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
ACCESS – LACP active / active Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[INTERFACE-RANGE]
Local Cisco interface range expression.
[VLAN-ID]
VLAN identifier.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Shared: VLAN-ID
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
ACCESS – LACP active / passive Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[INTERFACE-RANGE]
Local Cisco interface range expression.
[VLAN-ID]
VLAN identifier.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Shared: VLAN-ID
enable
configure terminal
interface range [INTERFACE-RANGE]
switchport
switchport mode access
switchport access vlan [VLAN-ID]
channel-group [CHANNEL-GROUP] mode passive
no shutdown
exit
interface port-channel [CHANNEL-GROUP]
switchport
switchport mode access
switchport access vlan [VLAN-ID]
no shutdown
exit
end
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[INTERFACE-RANGE]
Local Cisco interface range expression.
[VLAN-ID]
VLAN identifier.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Shared: VLAN-ID
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
ACCESS – PAgP desirable / auto Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[INTERFACE-RANGE]
Local Cisco interface range expression.
[VLAN-ID]
VLAN identifier.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Shared: VLAN-ID
enable
configure terminal
interface range [INTERFACE-RANGE]
switchport
switchport mode access
switchport access vlan [VLAN-ID]
channel-group [CHANNEL-GROUP] mode auto
no shutdown
exit
interface port-channel [CHANNEL-GROUP]
switchport
switchport mode access
switchport access vlan [VLAN-ID]
no shutdown
exit
end
ACCESS – Static on / on Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: etherchannel-link. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[INTERFACE-RANGE]
Local Cisco interface range expression.
[VLAN-ID]
VLAN identifier.
[CHANNEL-GROUP]
Local EtherChannel and corresponding Port-channel number.
Peer configuration — Other switch
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Shared: VLAN-ID
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
STP
Spanning Tree prevents Layer 2 loops by electing a root bridge and selecting forwarding and non-forwarding ports. PVST+ and Rapid PVST+ maintain per-VLAN spanning-tree instances.
Rapid PVST+ Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
enable
configure terminal
spanning-tree mode rapid-pvst
end
PVST+ Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
enable
configure terminal
spanning-tree mode pvst
end
Root primary Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
enable
configure terminal
spanning-tree vlan [VLAN-ID] root primary
end
Command parameters
[VLAN-ID]
VLAN identifier.
Root secondary Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
enable
configure terminal
spanning-tree vlan [VLAN-ID] root secondary
end
Command parameters
[VLAN-ID]
VLAN identifier.
Explicit bridge priority Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
Use an allowed multiple of 4096; a lower bridge ID is preferred.
enable
configure terminal
spanning-tree vlan [VLAN-ID] priority [BRIDGE-PRIORITY]
end
Command parameters
[VLAN-ID]
VLAN identifier.
[BRIDGE-PRIORITY]
STP bridge priority, normally a multiple of 4096.
Explicit port cost Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: stp-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
Local interface name including type and number, or an SVI as appropriate.
[VLAN-ID]
VLAN identifier.
[PORT-PRIORITY]
STP port priority using a supported increment.
PortFast
PortFast allows an edge interface to enter forwarding rapidly instead of waiting for normal spanning-tree convergence. It does not disable spanning tree.
Access edge port Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
interface [INTERFACE]
switchport
switchport mode access
switchport access vlan [VLAN-ID]
spanning-tree portfast
no shutdown
exit
end
Command parameters
[INTERFACE]
Local interface name including type and number, or an SVI as appropriate.
[VLAN-ID]
VLAN identifier.
Default on access edge ports Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Review all affected non-trunk interfaces first.
enable
configure terminal
spanning-tree portfast default
end
Trunk to an edge endpoint Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
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.
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[RECOVERY-SECONDS]
Errdisable recovery interval in seconds.
IPv4 and IPv6 Addressing
IPv4 and IPv6 addresses identify interfaces at Layer 3. A routed switchport must be converted to Layer 3 before assigning an address.
L2 switch IPv6 management SVI Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
This is host management, not IPv6 routing. Use a platform that supports IPv6 host/SVI functions. Off-link traffic requires a learned IPv6 default router, normally through Router Advertisements.
Check the exact model, IOS release, feature image and show sdm prefer before IPv6 management. On supported Catalyst 2960 LAN Base models, select sdm prefer dual-ipv4-and-ipv6 default in global configuration, then end, save the configuration and schedule a reload; verify the active template with show sdm prefer after reboot. Reload interrupts service and is a separate preparation step, not part of this script.
Do not apply the 2960 template requirement to every switch: Cisco documents that the dual template is not required on 2960-S and is unavailable on 2960 LAN Lite. Confirm support in the matching platform guide.
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
interface vlan [VLAN-ID]
ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH]
no shutdown
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[IPV6-ADDRESS]
Local IPv6 interface address without the prefix length.
[PREFIX-LENGTH]
IPv6 prefix length without slash.
L2 switch IPv4 management SVI Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Use ip default-gateway on a nonrouting switch.
enable
configure terminal
vlan [VLAN-ID]
name [VLAN-NAME]
exit
interface vlan [VLAN-ID]
ip address [IP-ADDRESS][SUBNET-MASK]
no shutdown
exit
ip default-gateway [NEXT-HOP]
end
Command parameters
[VLAN-ID]
VLAN identifier.
[VLAN-NAME]
Descriptive VLAN name.
[IP-ADDRESS]
Local IPv4 interface address.
[SUBNET-MASK]
IPv4 dotted-decimal subnet mask.
[NEXT-HOP]
IPv4 next-hop address.
L2 switch IPv6 management SVI using SLAAC Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Requires IPv6 host/SVI support for the exact model, IOS release and feature image. Apply the same model-dependent SDM preparation described for the static IPv6 management SVI; do not insert template changes or reload into a Golden Script.
ipv6 address autoconfig is an interface command for host SLAAC. The management SVI must be up/up with an active VLAN member; a router on that VLAN must advertise a /64 prefix with autonomous addressing enabled. Off-link management also needs a usable default router advertised by RA. A static IPv6 address alone does not provide a default router; ip default-gateway is IPv4 only. Do not enable ipv6 unicast-routing for this L2 host example.
enable
configure terminal
vlan [VLAN-ID]
exit
interface vlan [VLAN-ID]
ipv6 address autoconfig
no shutdown
exit
end
Command parameters
[VLAN-ID]
VLAN identifier.
Password Hashing Algorithms
Cisco credential types describe how a password or key is stored. Type 0 is plaintext, type 7 is reversible obfuscation, type 5 is legacy MD5 hashing, and types 8 and 9 use stronger password hashing. Type 6 is reversible AES encryption for credentials that must be recovered by the device; it is not a password hash.
Generate type 9 (scrypt) local secret Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: password-hashing-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
New local or line password; never include a real password in shared material.
[ENABLE-SECRET]
New enable password, not a pre-encoded hash.
Explicit type 0 line password Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: password-hashing-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
Plaintext input and storage unless password encryption is enabled.
enable
configure terminal
line console 0
password 0 [PASSWORD]
login
exit
end
Command parameters
[PASSWORD]
New local or line password; never include a real password in shared material.
Legacy service password encryption Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: password-hashing-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
Obfuscates applicable plaintext line passwords as type 7. It does not create a strong hash.
enable
configure terminal
service password-encryption
end
Import an already encoded type 9 secret Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: password-hashing-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[USERNAME]
Local user account name.
[ENCODED-TYPE9-SECRET]
Existing valid type 9 encoded hash, not plaintext.
AAA
AAA separates authentication (identity), authorization (permissions) and accounting (recording activity). A method list selects authentication methods in order.
AAA local default login Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[USERNAME]
Local user account name.
[PASSWORD]
New local or line password; never include a real password in shared material.
Explicit local console list Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
aaa new-model
aaa authentication login [CONSOLE-LIST] local
line console 0
login authentication [CONSOLE-LIST]
exit
end
Command parameters
[CONSOLE-LIST]
Named AAA method list for console login.
Named VTY login list Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
aaa new-model
aaa authentication login [LOGIN-LIST] local
line vty 0 [VTY-LAST]
login authentication [LOGIN-LIST]
exit
end
Command parameters
[LOGIN-LIST]
AAA authentication method-list name.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.
RADIUS with local fallback Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[LOGIN-LIST]
AAA authentication method-list name.
[RADIUS-GROUP]
Named AAA RADIUS server group.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.
Optional local EXEC authorization Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
aaa authorization exec [EXEC-LIST] local
line vty 0 [VTY-LAST]
authorization exec [EXEC-LIST]
exit
end
Command parameters
[EXEC-LIST]
AAA EXEC authorization list name.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.
RADIUS
RADIUS centralizes authentication and accounting using a shared secret and a server or server group. Cisco AAA method lists reference the server group.
Named RADIUS server Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[RADIUS-SERVER-NAME]
Local name for the RADIUS server definition.
[SERVER-IP]
IPv4 address of the relevant server.
[SHARED-SECRET]
Matching shared authentication secret on participating systems.
RADIUS server group Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
aaa group server radius [RADIUS-GROUP]
server name [RADIUS-SERVER-NAME]
exit
end
Command parameters
[RADIUS-GROUP]
Named AAA RADIUS server group.
[RADIUS-SERVER-NAME]
Local name for the RADIUS server definition.
Optional RADIUS source interface Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
ip radius source-interface [SOURCE-INTERFACE]
end
Command parameters
[SOURCE-INTERFACE]
Local source interface used for probes or management traffic.
Bind RADIUS with local fallback to VTY Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[USERNAME]
Local user account name.
[PASSWORD]
New local or line password; never include a real password in shared material.
[LOGIN-LIST]
AAA authentication method-list name.
[RADIUS-GROUP]
Named AAA RADIUS server group.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.
ACL
Access control lists match packets in sequence and permit or deny them. Standard IPv4 ACLs match source addresses; extended IPv4 and IPv6 ACLs can match protocol, addresses and ports.
Restrict IPv4 management sources Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Alternative group: acl-method. Select the applicable method; do not apply mutually exclusive variants in sequence.
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
Command parameters
[MGMT-ACL]
Management ACL name.
[SOURCE-NETWORK]
IPv4 source network address.
[SOURCE-WILDCARD]
IPv4 source wildcard mask.
[VTY-LAST]
Last VTY line number supported by the device; configure remaining lines as needed.
NTP
Network Time Protocol synchronizes clocks. An NTP client uses a server; peers form symmetric associations. A lab device can serve time using ntp master when specified.
NTP lab server Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[STRATUM]
NTP master stratum specified by the task.
NTP client Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[SERVER-IP]
IPv4 address of the relevant server.
NTP peer Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
ntp peer [PEER-IP]
end
Command parameters
[PEER-IP]
Remote IPv4 NTP peer address.
Peer configuration — Other NTP peer
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Each peer points to the other device. Both need compatible authentication if configured.
enable
configure terminal
ntp peer [SOURCE-IP]
end
Authenticated local NTP server Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Matching shared authentication secret on participating systems.
[STRATUM]
NTP master stratum specified by the task.
Authenticated client Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[KEY-ID]
Matching authentication key identifier.
[SHARED-SECRET]
Matching shared authentication secret on participating systems.
[SERVER-IP]
IPv4 address of the relevant server.
Authenticated peer Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
Matching shared authentication secret on participating systems.
[PEER-IP]
Remote IPv4 NTP peer address.
Peer configuration — Other NTP peer
Peer blocks use the peer's own local interfaces and identifiers. Shared values must agree; other placeholders are interpreted from that device's perspective.
Shared: KEY-ID, SHARED-SECRET
Each peer points to the other device. Both need compatible authentication if configured.
Syslog sends event messages to local destinations or a remote collector. Severity levels run from 0 (emergencies) to 7 (debugging).
Local logging buffer Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
service timestamps log datetime msec
logging buffered [BUFFER-BYTES][SEVERITY]
end
Command parameters
[BUFFER-BYTES]
Local logging buffer capacity in bytes.
[SEVERITY]
Syslog severity name or number from 0 to 7.
Remote IPv4 Syslog Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
service timestamps log datetime msec
logging host [SERVER-IP]
logging trap [SEVERITY]
logging on
end
Command parameters
[SERVER-IP]
IPv4 address of the relevant server.
[SEVERITY]
Syslog severity name or number from 0 to 7.
Optional logging source interface Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
logging source-interface [SOURCE-INTERFACE]
end
Command parameters
[SOURCE-INTERFACE]
Local source interface used for probes or management traffic.
SNMPv2c
SNMPv2c allows a manager to poll device information and receive notifications using a community string. It lacks modern authenticated encryption and is included for the exam.
Read-only community with ACL Recommended / essential starting point
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
ip access-list standard [MGMT-ACL]
permit host [MANAGER-IP]
exit
snmp-server community [COMMUNITY] RO [MGMT-ACL]
end
Command parameters
[MGMT-ACL]
Management ACL name.
[MANAGER-IP]
Authorized SNMP manager IPv4 address.
[COMMUNITY]
SNMPv2c community string; keep secret.
Optional read-write community with ACL Optional when requested
Start in privileged EXEC; block enters and exits configuration mode.Section link
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
Command parameters
[MGMT-ACL]
Management ACL name.
[MANAGER-IP]
Authorized SNMP manager IPv4 address.
[COMMUNITY]
SNMPv2c community string; keep secret.
SNMPv2c trap destination Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
snmp-server host [MANAGER-IP] traps version 2c [COMMUNITY]
snmp-server enable traps snmp linkdown linkup
end
Command parameters
[MANAGER-IP]
Authorized SNMP manager IPv4 address.
[COMMUNITY]
SNMPv2c community string; keep secret.
Device location and contact Task-specific configuration — essential if selected
Start in privileged EXEC; block enters and exits configuration mode.Section link
enable
configure terminal
snmp-server location [LOCATION]
snmp-server contact [CONTACT]
end
Command parameters
[LOCATION]
SNMP device location string.
[CONTACT]
SNMP administrative contact string.
Save configuration
Run after successful verification. Confirm the destination filename if prompted.
copy running-config startup-config
Verify All
Read-only checks. Lines containing placeholders are commented; choose and adapt before running. Do not share unredacted configuration output.
! Pcornel Finals - Case Skills Exam / L2 Switch Verify All
! Content version: 1.1-draft
! Privileged EXEC. Run the relevant checks; commands with placeholders require replacement.
! The show running-config/startup-config output may contain sensitive credentials.
! Disruptive tests and credential-bearing tests are excluded.
! VLAN
show vlan brief
! show interfaces [INTERFACE] switchport
show ip interface brief
show ipv6 interface brief
! 802.1Q Trunking
show interfaces trunk
! EtherChannel
show etherchannel summary
show etherchannel port-channel
show lacp neighbor
show pagp neighbor
! STP
! show spanning-tree vlan [VLAN-ID]
show spanning-tree
show spanning-tree summary
! PortFast
! show spanning-tree interface [INTERFACE] detail
! BPDU Guard
show interfaces status err-disabled
show errdisable recovery
! IPv4 and IPv6 Addressing
! show interfaces [INTERFACE]
! Password Hashing Algorithms
show running-config | include ^username
show running-config | include ^enable secret
show running-config | include ^service password-encryption
! AAA
show running-config | section ^aaa
show running-config | section ^line
show users
! RADIUS
show aaa servers
show radius statistics
! ACL
show ip access-lists
! show ip interface [INTERFACE]
show ipv6 access-list
! show ipv6 interface [INTERFACE]
! NTP
show ntp associations
show ntp status
show clock detail
! Syslog
show logging
show running-config | include ^logging
! SNMPv2c
show snmp
show snmp host
show running-config | include ^snmp-server
! Final device verification
show interfaces status
show mac address-table
show interfaces switchport
show running-config
show startup-config
Case Skills Exam · L2 Switch — Golden Script
! Pcornel Finals - Case Skills Exam / L2 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
! no ip routing (only on supported Layer 2 devices; do not disable routing on L3 devices)
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 2 management SVI
! Use the default gateway only when the device is not routing IP.
! enable
! configure terminal
! vlan [VLAN-ID]
! name [VLAN-NAME]
! exit
! interface vlan [VLAN-ID]
! ip address [IP-ADDRESS][SUBNET-MASK]
! no shutdown
! exit
! ip default-gateway [NEXT-HOP]
! 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
! 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 / L2 switch IPv6 management SVI
! This is host management, not IPv6 routing. Use a platform that supports IPv6 host/SVI functions. Off-link traffic requires a learned IPv6 default router, normally through Router Advertisements.
! Check the exact model, IOS release, feature image and show sdm prefer before IPv6 management. On supported Catalyst 2960 LAN Base models, select sdm prefer dual-ipv4-and-ipv6 default in global configuration, then end, save the configuration and schedule a reload; verify the active template with show sdm prefer after reboot. Reload interrupts service and is a separate preparation step, not part of this script.
! Do not apply the 2960 template requirement to every switch: Cisco documents that the dual template is not required on 2960-S and is unavailable on 2960 LAN Lite. Confirm support in the matching platform guide.
! enable
! configure terminal
! vlan [VLAN-ID]
! name [VLAN-NAME]
! exit
! interface vlan [VLAN-ID]
! ipv6 address [IPV6-ADDRESS]/[PREFIX-LENGTH]
! no shutdown
! exit
! end
! IPv4 and IPv6 Addressing / L2 switch IPv4 management SVI
! Use ip default-gateway on a nonrouting switch.
! enable
! configure terminal
! vlan [VLAN-ID]
! name [VLAN-NAME]
! exit
! interface vlan [VLAN-ID]
! ip address [IP-ADDRESS][SUBNET-MASK]
! no shutdown
! exit
! ip default-gateway [NEXT-HOP]
! end
! IPv4 and IPv6 Addressing / L2 switch IPv6 management SVI using SLAAC
! Requires IPv6 host/SVI support for the exact model, IOS release and feature image. Apply the same model-dependent SDM preparation described for the static IPv6 management SVI; do not insert template changes or reload into a Golden Script.
! ipv6 address autoconfig is an interface command for host SLAAC. The management SVI must be up/up with an active VLAN member; a router on that VLAN must advertise a /64 prefix with autonomous addressing enabled. Off-link management also needs a usable default router advertised by RA. A static IPv6 address alone does not provide a default router; ip default-gateway is IPv4 only. Do not enable ipv6 unicast-routing for this L2 host example.
! enable
! configure terminal
! vlan [VLAN-ID]
! exit
! interface vlan [VLAN-ID]
! ipv6 address autoconfig
! no shutdown
! 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 / 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.
Verify All
! Pcornel Finals - Case Skills Exam / L2 Switch Verify All
! Content version: 1.1-draft
! Privileged EXEC. Run the relevant checks; commands with placeholders require replacement.
! The show running-config/startup-config output may contain sensitive credentials.
! Disruptive tests and credential-bearing tests are excluded.
! VLAN
show vlan brief
! show interfaces [INTERFACE] switchport
show ip interface brief
show ipv6 interface brief
! 802.1Q Trunking
show interfaces trunk
! EtherChannel
show etherchannel summary
show etherchannel port-channel
show lacp neighbor
show pagp neighbor
! STP
! show spanning-tree vlan [VLAN-ID]
show spanning-tree
show spanning-tree summary
! PortFast
! show spanning-tree interface [INTERFACE] detail
! BPDU Guard
show interfaces status err-disabled
show errdisable recovery
! IPv4 and IPv6 Addressing
! show interfaces [INTERFACE]
! Password Hashing Algorithms
show running-config | include ^username
show running-config | include ^enable secret
show running-config | include ^service password-encryption
! AAA
show running-config | section ^aaa
show running-config | section ^line
show users
! RADIUS
show aaa servers
show radius statistics
! ACL
show ip access-lists
! show ip interface [INTERFACE]
show ipv6 access-list
! show ipv6 interface [INTERFACE]
! NTP
show ntp associations
show ntp status
show clock detail
! Syslog
show logging
show running-config | include ^logging
! SNMPv2c
show snmp
show snmp host
show running-config | include ^snmp-server
! Final device verification
show interfaces status
show mac address-table
show interfaces switchport
show running-config
show startup-config