Basic setup

! naming
hostname sw1
ip domain-name james.local

! authentication
username admin secret cisco
enable secret cisco

! ssh
crypto key generate rsa general-keys modulus 1024
ip ssh v 2
line con 0
login local
line vty 0 4
login local
transport input ssh

! vlan and stp
int range f0/1-24,g0/1-2
switchport mode access
switchport access vlan 10
switchport nonegotiate
spanning-tree portfast

! cdp
cdp run

! if router exists
ip default-gateway 10.0.0.1

! save
copy run start

Checks

show mac address-table

show ip arp
show ip int brief
show ip route
show ip ospf int g0/0

show vlan

show cdp neighbors

show int trunk

debug ip rip
debug ip ospf events
! turn off all debug
u all

Interface

int g0/1

! sub interface
int f0/0.10

! clear
default interface g0/1

! speed and duplex
speed auto
duplex auto

! access
switchport mode access
switchport access vlan 10

! trunk
switchport mode trunk
switchport trunk allowed vlan 10,20,30,40

! restart
no shut

VLAN

vlan 10

! int
int vlan10
ip address 10.0.0.2 255.255.255.0
no shut

Router

! l2 to l3 switch
ip routing

! gateway of last resort / default gateway
ip route 0.0.0.0 0.0.0.0 172.16.0.2

! trunk
int f0/0.10
encapsulation dot1Q 10
ip address 10.0.0.1 255.255.255.0
no shut

! can have all three at the same time

! rip (classful)
show ip route
router rip
version 2
! for non classful
no auto-summary
! add all from show
network 10.0.0.0

! ospf, need a group number -> most popular
router ospf 10
! wildcard mask, must be area 0 unless multiple
network 10.0.0.0 0.0.0.255 area 0
! bandwidth
auto-cost reference-bandwidth 1000
! or/also?
int g0/0
bandwidth 100

! eigrp, need a group number
router eigrp 10
no auto-summary
! wildcard mask
network 10.0.0.0 0.0.0.255

Labs

Layer 3 Switch Static Route


! conf mode
conf t

! routing mode
ip routing

! create vlan
vlan 30
exit

! check interface
show cdp neighbors
! configure interface
int g0/1
switchport trunk allowed vlan add 30

! configure vlan
int vlan 30
ip address 172.16.0.2 255.255.255.252
no shut

! show route
show ip route
! add
ip route 10.20.0.0 255.255.255.0 172.16.0.1

! save
copy run start
! if it doesn't work
reload