Hostname wijzigen
Switch(config)# hostname SW1
Uitschakelen domain lookup (typefouten)
Switch(config)# no ip domain-lookup
Enable password
SW1(config)# enable password Wachtwoord123 Plaintext
Enable (secret) password
SW1(config)# enable secret Wachtwoord123 MD5 encryptie (sterke encryptie)
Encryptie van alle wachtwoorden in config
SW1(config)# service password-encryption Zwakke encryptie van alle wachtwoorden, maar niet direct leesbaar.
Console wachtwoord (console-poort)
SW1(config)# line con 0
SW1(config-line)# password Wachtwoord123
SW1(config-line)# login
Nog voordat je de User Exec mode kunt bereiken.
Banner (inlogboodschap)
SW1(config)# banner motd # Je bericht # Het begin- en eindteken (#) mag je zelf kiezen.
Opslaan configuratie (lokaal)
SW1# copy running-config startup-config
Destination filename [startup-config]?
Building configuration…
[OK]
Opslaan configuratie als backup (TFTP server)
SW1# copy running-config tftp
Address or name of remote hosts []? 10.0.0.1
Destination filename []? SW1_backup
Writing running-config……!!
[OK – 552 bytes]
Telnet configureren
SW1(config)# line vty 0 4
SW1(config-line)# password Telnet123
SW1(config-line)# login
SW1(config-line)# exec-timeout 3
SSH configureren
Switch(config)# hostname SW1
SW1(config)# ip domain-name abc.nl
SW1(config)# username admin password Wachtwoord123
SW1(config)# crypto key generate rsa
How many bits in the modulus [512]: 1024
SW1(config)# ip ssh version 2
SW1(config)# line vty 0 4
SW1(config-line)# login local
SW1(config-line)# transport input ssh
Show commando’s
show users
show ip interface brief
show ip interface vlan 1
show version
show boot
show flash:
copy tftp: flash:
boot system flash:<image>.bin
copy run start
erase startup-config
delete flash:vlan.dat
reload
Switch basis & VLAN
interface vlan 1
ip address 172.16.1.11 255.255.255.0
no shutdown
ip default-gateway 172.16.1.1
show vlan brief
show interfaces trunk
show interfaces status
vlan 10 name Directie
vlan 20 name Inkoop
switchport mode access
switchport access vlan 10
switchport nonegotiate
switchport mode trunk
switchport trunk native vlan 20
switchport trunk allowed vlan 10,20,30
STP & Etherchannel
show spanning-tree
show interfaces | begin Vlan1
spanning-tree vlan 1 priority 4096
interface range gi0/1-2
channel-group 1 mode active
show etherchannel summary
Layer 3 Switch
ip routing
no switchport
switchport
Router-on-a-stick
interface g0/0
no shutdown
interface g0/0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
interface g0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
Routing
show ip route
ip route 0.0.0.0 0.0.0.0 172.16.0.1
ip route 192.168.12.0 255.255.255.0 g0/2
DHCP
ip dhcp excluded-address 192.168.0.1 192.168.0.50
ip dhcp pool NAME
network 192.168.0.0 255.255.255.0
default-router 192.168.0.1
dns-server 192.168.0.1
NAT
ip nat inside
ip nat outside
ip nat inside source static 192.168.1.10 2.2.2.2
ip nat pool NAME 2.2.2.20 2.2.2.23 netmask 255.255.255.0
ip nat inside source list 1 pool NAME
ip nat inside source list 1 interface g0/0 overload
HSRP
standby 1 ip 192.168.1.1
standby 1 priority 105
standby 1 preempt
standby 1 track g0/0
show standby
show standby brief
ACL
access-list 1 permit 192.168.1.0 0.0.0.255
access-list 100 deny tcp any any eq www
access-list 100 permit ip any any
ip access-group 1 out
access-class 1 in
show access-lists 1
ip access-list standard NAME
ip access-list extended NAME
Routing Protocols
router rip
version 2
no auto-summary
network 172.16.0.0
router ospf 1
network 172.16.0.0 0.0.255.255 area 0
default-information originate
DHCP Snooping & Security
ip dhcp snooping
ip dhcp snooping vlan 1-1005
ip dhcp snooping trust
spanning-tree bpduguard enable
switchport port-security
switchport port-security maximum 2
switchport port-security violation shutdown
Network Discovery
show cdp neighbors
show lldp neighbors
no cdp run
lldp run
NTP & Logging
ntp server 192.168.10.150
show clock
show ntp status
logging 192.168.10.200
service timestamps log datetime msec