Cisco CCNP - OSPF Lab 1
This article will describe the first CCNP MPLS lab.
Initial Configuration
Getting Command Line Access
Answer no to the initial configuration dialogue.
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]: n
Change from user mode
to privileged mode
Router>enable
Router#
Change to configure mode
Router#configure
Configuring from terminal, memory, or network [terminal]? terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Adding Base Configuration
configure terminal
hostname R1
ip domain-name infoitech.co.uk
Securing Access
Saving the Configuration
R1#copy running-config startup-config
Destination filename [startup-config]? startup-config
Building configuration...
[OK]
Configuring Interfaces
Let's configure the interfaces according to the diagram below.
show interfaces description
Interface Status Protocol Description
Gi0/0 up up "R1 to R2"
Gi0/1 up up "R1 to R3"
Gi0/2 admin down down
Gi0/3 admin down down
Lo0 up up
Repeat the steps above for R2 and R3 changing the commands accordingly.
Configuring OSPF
Enabling OSPF
Let's enable debug mode on OSPF hello messages.
debug ospf hello
Let's enable the OSPF process.
configure terminal
router ospf 1
The number 1 is the process number and is local to the router. The purpose of the process is to allow for multiple OSPF instances on the router.
OSPF Network Configuration
OSPF can be configured on an interface in two ways. In the example below, OSPF is configured using subnets, and the interfaces configured with the specified subnets will be OSPF enabled.
This LAB uses a single OSPF area 0 on the CORE routers.
The network
command enables OSPF in any interface that matches the subnet and wildcard mask. A wildcard 0.0.0.0
will match only a single IP address.
configure terminal
router ospf 1
network 10.1.2.1 0.0.0.0 area 0
network 10.1.3.1 0.0.0.0 area 0
As seen in the output from the command below. The interface GigabitEthernet0/1
OSPF configuration was attached via a network statement.
show ip ospf interface
GigabitEthernet0/1 is up, line protocol is up
Internet Address 10.1.3.1/24, Area 0, Attached via Network Statement
Process ID 1, Router ID 10.0.0.1, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 10.0.0.1, Interface address 10.1.3.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/2/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
OSPF Interface Configuration
OSPF can also be configured on the interface. Let's configure an interface in R2 using the per-interface commands.
configure terminal
interface gigabitEthernet0/0
ip ospf 1 area 0
exit
Using the command below, we can see that the interface gigabitEthernet0/0
is reporting that OSPF was attached via Interface Enable.
show ip ospf interface
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.1.2.2/24, Area 0, Attached via Interface Enable
Process ID 1, Router ID 10.0.0.2, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Enabled by interface config, including secondary ip addresses
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 10.0.0.2, Interface address 10.1.2.2
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:05
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/1/1, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
OSPF Network Type
By default, the OSPF network type is set as BROADCAST
and it needs to be changed to point-to-point
which is considered practice.
The command below shows the OSPF details on an interface.
show ip ospf interface
GigabitEthernet0/1 is up, line protocol is up
Internet Address 10.1.3.1/24, Area 0, Attached via Network Statement
Process ID 1, Router ID 10.0.0.1, Network Type BROADCAST, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 10.0.0.1, Interface address 10.1.3.1
No backup designated router on this network
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:06
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/2/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
To change the type we use the commands below.
configure terminal
interface GigabitEthernet0/0
ip ospf network point-to-point
exit
interface GigabitEthernet0/1
ip ospf network point-to-point
GigabitEthernet0/1 is up, line protocol is up
Internet Address 10.1.3.1/24, Area 0, Attached via Network Statement
Process ID 1, Router ID 10.0.0.1, Network Type POINT_TO_POINT, Cost: 1
Topology-MTID Cost Disabled Shutdown Topology Name
0 1 no no Base
Transmit Delay is 1 sec, State POINT_TO_POINT
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
oob-resync timeout 40
Hello due in 00:00:05
Supports Link-local Signaling (LLS)
Cisco NSF helper support enabled
IETF NSF helper support enabled
Index 1/2/2, flood queue length 0
Next 0x0(0)/0x0(0)/0x0(0)
Last flood scan length is 0, maximum is 0
Last flood scan time is 0 msec, maximum is 0 msec
Neighbor Count is 0, Adjacent neighbor count is 0
Suppress hello for 0 neighbor(s)
Since we enabled debug
mode the router will notify us about hello messages sent to neighbours.
*Nov 20 15:37:57.904: OSPF-1 HELLO Gi0/0: Send hello to 224.0.0.5 area 0 from 10.1.2.1
*Nov 20 15:38:02.425: OSPF-1 HELLO Gi0/1: Send hello to 224.0.0.5 area 0 from 10.1.3.1
A full analysis of the Hello Packet
can be found on this link.
OSPF Adjacency
*Nov 21 14:00:22.138: %OSPF-5-ADJCHG: Process 1, Nbr 10.0.0.2 on GigabitEthernet0/0 from LOADING to FULL, Loading Done