=== Stock Commands === !Switch> enable !Switch# conf t !Switch(config)# ipv6 unicast-routing !Router only (or layer3 switch?) ip default-gateway 1.1.1.1 !Switch only?? do NORMAL_COMMAND HERE !!!! Not part of configuration, just a shortcut no ip domain-lookup service password-encryption hostname DEVICE_NAME !!!! Changes based on topology banner motd #Unauthorized access is strictly prohibited.# !!# can be any character, it just has to match. line con 0 !Switch(config-line)# password cisco login !Enable authentication using just a password. logging sync !Tries to copy your pending command to a new line when announcements happen. line vty 0 15 password cisco login !Enable authentication using just a password. logging sync !Tries to copy your pending command to a new line when announcements happen. === Interface === !Switch(config)# int f0/0 !Varies depending on topology, on switches f0/0 doesn't exist (1 indexed). int range f0/0-10,f0/12,f0/13 !Range doesn't work for serial links (fuck you cisco). !Switch(config-if)# ip address 1.0.0.0 255.255.255.0 !Adds the ip address 10.0.0.0/24 to this interface. (Can have more than 1 but is weird) ipv6 address 2001:DB8:ACAD::1/64 ipv6 address FE80::1 link-local clockrate 128000 !Serial links! no shutdown !Required at the end to fix some stupid shit and bring it online. === Switch === !!!!These commands are mainly to assign name, and is required to be done before assigning the SVI interface due to cisco bugs. !Switch(config)# vlan 10 !Switch(config-vlan)# name THIS_IS_A_NAME !!!END COMMANDS !Switch(config-if)# switchport mode access switchport access vlan 1337 switchport mode trunk !Some switches need "switchport trunk encap dot1q" first. switchport trunk allowed vlan 1,2,3,4-10,13 switchport trunk allowed vlan all switchport trunk native vlan 1337 === Spanning Tree === !Switch(config)# spanning-tree mode pvst !Per Vlan Spanning tree mode spanning-tree mode rapid !Per-Vlan rapid spanning tree mode spanning-tree vlan 1,2,3,4-10,13 root primary !!Assign as primary root for these vlans spanning-tree vlan 1,2,3,4-10,13 root secondary !!Assign as secondary root for these vlans spanning-tree portfast bpduguard default !Auto applies bpduguard to access ports. spanning-tree portfast default !auto applies portfast to access ports. !Switch(config-if)# spanning-tree portfast spanning-tree bpduguard enable === EtherChannel === Switch(config-if)# !PAgP is desirable / auto !LACP is active/passive channel-group 13 mode desirable === ROUTERS === !Router(config)# ip route 1.1.1.1 255.255.255.0 f0/0 !Screams in pain ip route 1.1.1.1 255.255.255.0 1.1.1.2 !Better !Router(config-if)# bandwidth 1000 !Kbit/s used purely for dynamic routing protocols, does not affect speeds. === OSPF === !Router(config)# router ospf 1 !the 1 is process id, doesn't do shit. ipv6 router ospf 1 !the 1 is process id, doesn't do shit. !Router(config-router)# router-id 1.1.1.1 !Always ipv4 even for ipv6 land. default-information originate auto-cost reference-bandwidth 1000 !Mbit/s area 0 authentication message-digest area 0 range 1.0.0.0 255.255.255.0 passive-interface INTERFACE !!ipv4 only network 1.0.0.0 0.0.0.255 area 0 !Advertises 1.0.0.0/24 to area 0. (second section is wildcard mask) !Router(config-if)# !Commands with ip can also be ipv6 ip ospf cost 16000 !1 is keyID, MD5KEY is password. ip ospf message-digest-key 1 md5 MD5KEY !Only needed if not set on area. ip ospf authentication message-digest !ipv6 only ipv6 ospf 1 area 0 !This is the equivilant to the network command for ipv4 ipv6 ospf network point-to-point !for loopback interfaces only === EIGRP === !Router(config)# router eigrp 1 !1 is the autonomous system number ipv6 router eigrp 1 key chain KEY_NAME !Router(config-keychain)# key 1 !Router(config-keychain-key)# key-string cisco !Router(config-router)# router-id 1.1.1.1 !always ipv4 address, ios 15+ has it in eigrp subcommand. redistribute static !without giving a wildcard mask, it defaults to classful boundary. network 10.0.0.0 network 10.0.0.0 0.0.0.255 passive-interface INTERFACE no shut !ipv6 requires this. !Router(config-if)# ip summary-address eigrp 0 10.0.0.0 255.255.255.0 !as number 0, 10.0.0.0/24 ip bandwidth-percent eigrp 0 75 !use the link for AS number 0 75% of the time. ip hello-interval eigrp 0 60 !set it to 60 seconds for AS 0 ip hold-time eigrp 0 180 !set it to 180 seconds for AS 0 ip authentication key-chain eigrp 0 KEY_NAME ip authentication mode eigrp 0 md5 === Virtual Routing === !Router(config-if)# !!!!START HSRP!!!! !!1 is the group ID standby 1 ip 1.0.0.1 standby 1 priority 150 !Only on active standby 1 preempt !Only on active !!!!!END HSRP!!!!! !!!!START GLBP!!!! !!1 is the group ID glbp 1 ip 1.0.0.1 glbp 1 preempt !Only on active glbp 1 priority 150 !Only on active glbp 1 load-balancing round-robin !!!!!END GLBP!!!!! === Debug / Troubleshoot === !all of these are ipv6 too (ipv6 instead of ip) unless otherwise specified. !Switch# ping 1.1.1.1 tracert 1.1.1.1 show run show ip interface brief show vlan brief show ip route show ip protocols show interface INTERFACE !!!spanning-tree show spanning-tree !!!virtual routing show glbp brief show standby brief !!!etherchannel show etherchannel summary show interfaces INTERFACE switchport !!!OSPF show ip ospf database !pretty much useless show ip ospf interface brief !partially useless show ip ospf neighbor !very useful clear ip ospf process !!!EIGRP show ip eigrp topology show ip eigrp neighbors !very useful show ip eigrp interfaces detail