Spiekbriefje voor Datacom Toets

Overzicht van commando's voor Packet Tracer: Switches configureren, VLANs, Trunk Ports, etc.

Basisconfiguratie van een Switch

Hostname instellen

Switch> enable
Switch# configure terminal
Switch(config)# hostname Switch1
Switch1(config)#

Enable Password instellen

Switch(config)# enable secret wachtwoord

Console Password instellen

Switch(config)# line console 0
Switch(config-line)# password wachtwoord
Switch(config-line)# login

VTY Password instellen (voor remote toegang)

Switch(config)# line vty 0 15
Switch(config-line)# password wachtwoord
Switch(config-line)# login

Interface configureren (bijv. FastEthernet 0/1)

Switch(config)# interface fastEthernet 0/1
Switch(config-if)# description Beschrijving
Switch(config-if)# no shutdown

VLAN Configuratie

VLAN maken

Switch(config)# vlan 10
Switch(config-vlan)# name VLAN10
Switch(config-vlan)# exit

Poorten toewijzen aan VLAN (Access Mode)

Switch(config)# interface fastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

VLANs bekijken

Switch# show vlan brief

VLAN verwijderen

Switch(config)# no vlan 10

Trunk Ports Configureren

Poort als Trunk instellen

Switch(config)# interface fastEthernet 0/24
Switch(config-if)# switchport mode trunk

Native VLAN instellen (optioneel)

Switch(config-if)# switchport trunk native vlan 1

Allowed VLANs op Trunk beperken

Switch(config-if)# switchport trunk allowed vlan 10,20,30

Trunk informatie bekijken

Switch# show interfaces trunk

Dot1Q instellen op Routers

Hoe Dot1Q instellen op routers

R1> Enable
        R1# Conf t
        R1(config)# interface G0/0
        R1(config-if)# no shut
        R1(config-if)# interface G0/0.13
        R1(config-subif)# ip address 10.0.0.1 255.255.255.128
        R1(config-subif)# encapsulation dot1Q 13
        R1(config-subif)# ip address 10.0.0.1 255.255.255.128
        R1(config-subif)# interface G0/0.24
        R1(config-subif)# encapsulation dot1Q 24
        R1(config-subif)# ip address 10.0.0.129 255.255.255.128 
      

Access Ports Configureren

Poort als Access instellen

Switch(config)# interface fastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

Access poort beveiliging (Port Security)

Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 1
Switch(config-if)# switchport port-security violation shutdown

IP Adressen Toekennen

IP adres toekennen aan VLAN interface (voor management)

Switch(config)# interface vlan 1
Switch(config-if)# ip address 192.168.1.1 255.255.255.0
Switch(config-if)# no shutdown

Default Gateway instellen

Switch(config)# ip default-gateway 192.168.1.254

IP configuratie bekijken

Switch# show ip interface brief

Forwarding en Andere Commando's

MAC Address Table bekijken

Switch# show mac address-table

Interface status bekijken

Switch# show interfaces

Running Configuration bekijken

Switch# show running-config

Startup Configuration opslaan

Switch# copy running-config startup-config

Switch resetten naar fabrieksinstellingen

Switch# erase startup-config
Switch# reload

STP (Spanning Tree Protocol) configureren

Switch(config)# spanning-tree mode pvst
Switch(config)# spanning-tree vlan 10 root primary

STP informatie bekijken

Switch# show spanning-tree

Veelgebruikte Commando's die het leven wat makkelijker maken

Missing VLANs

Switch# show vlan brief
Switch# show interfaces switchport

Switch Trunk Port issues

Switch# show interfaces trunk
Switch# show running-config

Switch Access Port Issues

Switch# show interfaces switchport
Switch# ipconfig

Router Configuration Issues

R1# show ip interface brief
R1# show interfaces

Extra Onderwerpen

DHCP Configuratie (op Switch)

Switch(config)# ip dhcp pool VLAN10
Switch(dhcp-config)# network 192.168.10.0 255.255.255.0
Switch(dhcp-config)# default-router 192.168.10.1
Switch(dhcp-config)# dns-server 8.8.8.8

EtherChannel (Port Bundling)

Switch(config)# interface range fastEthernet 0/1 - 2
Switch(config-if-range)# channel-group 1 mode on
Switch(config-if-range)# exit
Switch(config)# interface port-channel 1
Switch(config-if)# switchport mode trunk

VTP (VLAN Trunking Protocol)

Switch(config)# vtp mode server
Switch(config)# vtp domain mijnDomein
Switch(config)# vtp password wachtwoord

CDP (Cisco Discovery Protocol)

Switch# show cdp neighbors

LLDP (Link Layer Discovery Protocol)

Switch(config)# lldp run
Switch# show lldp neighbors

Port Mirroring (SPAN)

Switch(config)# monitor session 1 source interface fastEthernet 0/1
Switch(config)# monitor session 1 destination interface fastEthernet 0/2