Cisco 2 notitie’s

Trunking commando’s / OSPF / Basic

OSPF commands

OSPF Commando’s

Enter OSPF router configuration mode using process ID 56. (OSPF Router config mode ID 56)

R1(config)# router ospf 56

Show directly connected networks on Router (Laat zien welke kabels zijn direct verbonden aan de router)

R1(config)# do show ip route connected

C is directly connected, GigabitEthernet0/1
C is directly connected, Loopback1

Configure a static router ID for each router ( for R1, for R2). (Stel voor elke router een ID aan, zodat je later kan aangeven welke DR of BDR router is)

R1(config-router)# router-id

R2(config-router)# router-id

Configure a network statement for the network between R1 and R2 placing it in area 0. (Maak een netwerk aan zodat router kan zien welke devices zijn verbonden aan andere router, daar gebruik je het ip adres wat verbonden is direct connected lijn en wildcard adres:

R1(config-router)# network area 0

R2(config-router)# network area 0

On R2 only, add the configuration necessary to advertise the Loopback 1 network into OSPF area 0. 

R2(config-router)# network area 0


R2(config)# interface loopback1
R2(config-if)# ip ospf 56 area 0

Verify OSPFv2 is operational between the routers. Issue the command to verify R1 and R2 have formed an adjacency. ( for R1, for R2). (Laat zien buurman’s OSPF status met ID en ip adres)

R1# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface           1   FULL/DR         00:00:33       GigabitEthernet0/0/1
R2# show ip ospf neighbor
Neighbor ID     Pri   State           Dead Time   Address         Interface           1   FULL/BDR        00:00:37       GigabitEthernet0/0/1

On R1, configure the interface G0/0/1 OSPF priority to 50 to ensure R1 is the Designated Router.). (Stel R1 als DR router denk hierbij aan een verkeersleider en geef hem prio 50)

R1(config)# interface g0/0/1
R1(config-if)# ip ospf priority 50

Configure the OSPF timers on the G0/0/1 of each router for a hello timer of 30 seconds. (OSPF gebruikt hello packets om te kijken of twee routers nog leven)

R1(config)# interface g0/0/1
R1(config-if)# ip ospf hello-interval 30

R2(config)# interface g0/0/1
R1(config-if)# ip ospf hello-interval 30

On R1, configure a default static route that uses interface Loopback 1 as the exit interface. Then, propagate the default route into OSPF. Note the console message after setting the default route. (Gebruik hiervoor default route en zorgen ervoor dat default route samen voegen met OSPF)

R1(config)# ip route loopback 1
%Default route without gateway, if not a point-to-point interface, may impact performance
R1(config)# router ospf 56
R1(config-router)# default-information originate

On R2 only, add the configuration necessary for OSPF to treat R2 Loopback 1 like a point-to-point network. This results in OSPF advertising Loopback 1 using the interface subnet mask.(Geef aan in loopback 1 interface dat het een netwerk point-to-point is.)

R2(config)# interface loopback 1
R2(config-if)# ip ospf network point-to-point
R2(config-if)# exit

On R2 only, add the configuration necessary to prevent OSPF advertisements from being sent to the Loopback 1 network.(Passive: blokkeert pakketten die worden doorgestuurd via die lijn, ze willen niks via Loopback 1 interface gestuurd worden op R2, dus maak een passive-interface loopback 1 aan.)

R2(config)# router ospf 56
R2(config-router)# passive-interface loopback 1
R2(config-router)# exit

Change the reference bandwidth on each router to 1Gbs. After this configuration, restart OSPF using the clear ip ospf process command. Note the console message after setting the new reference bandwidth.

R1(config)# router ospf 56
R1(config-router)# auto-cost reference-bandwidth 1000
%OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers.
R1(config-router)# end
R1# clear ip ospf process
Reset ALL OSPF processes? [no]: yes

R2(config)# router ospf 56
R2(config-router)# auto-cost reference-bandwidth 1000
%OSPF: Reference bandwidth is changed.
Please ensure reference bandwidth is consistent across all routers.
R2(config-router)# end
R2# clear ip ospf process
Reset ALL OSPF processes? [no]: yes

Basic commands

Basic Device Settings Commando’s

Console into the router and enable privileged EXEC mode.

router> enable

Enter configuration mode.

router# config terminal

Assign a device name to the router.

router(config)# hostname R1

Disable DNS lookup to prevent the router from attempting to translate incorrectly entered commands as though they were host names.

R1(config)# no ip domain lookup

Assign class as the privileged EXEC encrypted password.

R1(config)# enable secret class

Assign cisco as the console password and enable login.

R1(config)# line vty 0 15

R1(config-line)# password cisco

R1(config-line)# login

Encrypt the plaintext passwords.

R1(config)# service password-encryption

Create a banner that warns anyone accessing the device that unauthorized access is prohibited.

R1(config)# banner motd ‘Alleen voor Nova studenten! ‘

Save the running configuration to the startup configuration file.

R1# copy running-config startup-config

Set the clock on the router.

R1# clock set 15:30:00 27 Aug 2022


VLAN commando’s

Shut down all interfaces that will not be used. (Sluit poorten die je niet gebruikt doormiddel een range command, kan je meer poorten selecteren en daarna sluiten)

S1(config)# interface range f0/2-5, f0/7-24, g0/1-2
S1(config-if-range)# shutdown

Set the clock on the switch.

S1# clock set 15:30:00 21 September 2022

Create VLANs on both switches. (Maak een VLAN aan)

S1(config)# vlan 10

S1(config-vlan)# name Management

S1(config-vlan)# vlan 20

S1(config-vlan)# name Sales

S1(config-vlan)# vlan 30

S1(config-vlan)# name Operations

S1(config-vlan)# vlan 999

S1(config-vlan)# name Parking_Lot

S1(config-vlan)# vlan 1000

S1(config-vlan)# name Native

S1(config-vlan)# exit

Configure the management interface and default gateway on each switch using the IP address information in the Addressing Table. (Voeg IP-adres toe en default-gateway aan de VLAN en zorg dat hij aangaat)

S1(config)# interface vlan 10

S1(config-if)# ip address

S1(config-if)# no shutdown

S1(config-if)# exit

S1(config)# ip default-gateway

Assign all unused ports on the switch to the Parking_Lot VLAN, configure them for static access mode, and administratively deactivate them. (Sluit poorten die je niet nodig heb en voeg ze aan de VLAN Parking_Lot toe)

S1(config)# interface range f0/2 – 4 , f0/7 – 24 , g0/1 – 2

S1(config-if-range)# switchport mode access

S1(config-if-range)# switchport access vlan 999

S1(config-if-range)# shutdown

Assign used ports to the appropriate VLAN (specified in the VLAN table above) and configure them for static access mode. (Instellen op Access mode zodat hij niet Trunking gebruikt op die lijn’en’ en zorgen dat VLAN 20 volgens het table toegevoegd is op F0/6)

S1(config)# interface f0/6

S1(config-if)# switchport mode access

S1(config-if)# switchport access vlan 20

Verify that the VLANs are assigned to the correct interfaces. (VLAN’s bekijken op welke poort ze staan ingesteld)

S1# show vlan brief

VLAN Name                             Status    Ports

—- ——————————– ——— ——————————-

1    default                          active    Fa0/1, Fa0/5

10   Management                       active

20   Sales                            active    Fa0/6

30   Operations                       active

999  Parking_Lot                      active    Fa0/2, Fa0/3, Fa0/4, Fa0/7

                                                Fa0/8, Fa0/9, Fa0/10, Fa0/11

                                                Fa0/12, Fa0/13, Fa0/14, Fa0/15

                                                Fa0/16, Fa0/17, Fa0/18, Fa0/19

                                                Fa0/20, Fa0/21, Fa0/22, Fa0/23

                                                Fa0/24, Gi0/1, Gi0/2


Trunking commando’s

Configure static trunking on interface F0/1 for both switches.

S1(config)# interface f0/1

S1(config-if)# switchport mode trunk


S2(config)# interface f0/1

S2(config-if)# switchport mode trunk

Set the native VLAN to 1000 on both switches. (Zorgt ervoor dat VLAN 1000 niet met een VLAN Tag doorgezien word)

S1(config)# interface f0/1

S1(config-if)# switchport trunk native vlan 1000

S2(config)# interface f0/1 

S2(config-if)# switchport trunk native vlan 1000

Specify that VLANs 10, 20, 30, and 1000 are allowed to cross the trunk. (Zorg dat de VLAN’s over trunk kabel mogen, in dit geval bedoelen ze de kabel tussen de 2 switches)

S1(config)# interface f0/1

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


S2(config)# interface f0/1

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

Router Trunking / Vlan

Router instellen voor Vlan

Configure sub-interfaces for each VLAN as specified in the IP addressing table. All sub-interfaces use 802.1Q encapsulation. Ensure the sub-interface for the native VLAN does not have an IP address assigned. Include a description for each sub-interface.

(802.1Q word gebruikt voor VLAN met een subinterface toe te voegen

R1(config)# interface g0/1.10

R1(config-subif)# description Management Network

R1(config-subif)# encapsulation dot1q 10

R1(config-subif)# ip address

R1(config-subif)# interface g0/1.20

R1(config-subif)# encapsulation dot1q 20

R1(config-subif)# description Sales Network

R1(config-subif)# ip address

R1(config-subif)# interface g0/1.30

R1(config-subif)# encapsulation dot1q 30

R1(config-subif)# description Operations Network

R1(config-subif)# ip address

R1(config-subif)# interface g0/1.1000

R1(config-subif)# encapsulation dot1q 1000 native

R1(config-subif)# description Native VLAN

Verify the sub-interfaces are operational (Kijken dat je de Subinterface heb goed ingesteld op de router)

R1# show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol

GigabitEthernet0/0/0   unassigned      YES NVRAM  down                  down

GigabitEthernet0/0/1   unassigned      YES NVRAM  up                    up

Gi0/0/1.10       YES manual up                    up

Gi0/0/1.20       YES manual up                    up

Gi0/0/1.30       YES manual up                    up

Gi0/0/1.1000           unassigned      YES unset  up                    up

GigabitEthernet0       unassigned      YES NVRAM  down                  down