← All labs Lab 8 · Packet Tracer

Single-area OSPF

router-id, network with wildcards, passive interfaces and neighbors

Level: Intermediate Time: 35 min Domain 3.0 IP Connectivity

Scenario

Three routers in a row: R1 – R2 – R3. R2 already runs OSPF (process 1, router-id 2.2.2.2). Your job is to configure R1 and R3 so the LANs at both ends can reach each other without a single static route.

Use process 1 and area 0. Set the router-id (1.1.1.1 on R1 and 3.3.3.3 on R3) before advertising the networks, advertise all their connected networks and make the LAN interface passive, since there's no router to talk to there. Verify the neighbors with show ip ospf neighbor.

Topology

PC1R1R2R3PC3Fa0Gi0/0Gi0/1Gi0/0Gi0/1Gi0/0Gi0/1Fa0

Devices and cabling

FromToCable
PC1 Fa0R1 Gi0/0Crossover
R1 Gi0/1R2 Gi0/0Crossover
R2 Gi0/1R3 Gi0/0Crossover
R3 Gi0/1PC3 Fa0Crossover

If in doubt, the automatic connection cable (the lightning bolt) picks the right one. Rule: straight-through between different devices (PC or router to switch) and crossover between alike ones.

Addressing

DeviceInterfaceAddressMaskDefault gateway
R1G0/0192.168.1.1255.255.255.0—
R1G0/110.0.12.1255.255.255.252—
R2G0/010.0.12.2255.255.255.252—
R2G0/110.0.23.1255.255.255.252—
R3G0/010.0.23.2255.255.255.252—
R3G0/1192.168.3.1255.255.255.0—
PC1NIC192.168.1.10255.255.255.0192.168.1.1
PC3NIC192.168.3.10255.255.255.0192.168.3.1

Starting configuration

In the app this is already done. In Packet Tracer, before you start, enter each device with enable and configure terminal and type (or paste) these lines.

R1hostname R1 no ip domain-lookup interface g0/0 ip address 192.168.1.1 255.255.255.0 no shutdown interface g0/1 ip address 10.0.12.1 255.255.255.252 no shutdown
R2hostname R2 no ip domain-lookup interface g0/0 ip address 10.0.12.2 255.255.255.252 no shutdown interface g0/1 ip address 10.0.23.1 255.255.255.252 no shutdown router ospf 1 router-id 2.2.2.2 network 10.0.12.0 0.0.0.3 area 0 network 10.0.23.0 0.0.0.3 area 0
R3hostname R3 no ip domain-lookup interface g0/0 ip address 10.0.23.2 255.255.255.252 no shutdown interface g0/1 ip address 192.168.3.1 255.255.255.0 no shutdown

PCs and servers (Desktop › IP Configuration)

Tasks

What must end up working. In the app, each one ticks itself off as soon as you get it.

  1. R1: OSPF 1 with router-id 1.1.1.1
  2. R1 advertises both its networks in area 0
  3. R1: G0/0 passive
  4. R3: router-id 3.3.3.3 and both its networks
  5. R3: G0/1 passive
  6. R2 has R1 and R3 as FULL neighbors
  7. PC1 reaches PC3
  8. Checked with show ip ospf neighbor
In Packet Tracer
  • Routers are joined with crossover cables, and each PC to its router also with crossover.
  • Do the starting configuration of all three routers. R2's OSPF is already part of it.
Hints
  • R1: OSPF 1 with router-id 1.1.1.1: router ospf 1 → router-id 1.1.1.1. If it already had neighbors, IOS asks for clear ip ospf process.
  • R1 advertises both its networks in area 0: network 192.168.1.0 0.0.0.255 area 0 and network 10.0.12.0 0.0.0.3 area 0 (the wildcard is the inverted mask)
  • R1: G0/0 passive: passive-interface g0/0 inside router ospf 1
  • R3: router-id 3.3.3.3 and both its networks: Same as R1, with 10.0.23.0 0.0.0.3 and 192.168.3.0 0.0.0.255
  • R3: G0/1 passive: passive-interface g0/1
  • R2 has R1 and R3 as FULL neighbors: Neighbors need the same area, the same subnet and a non-passive interface
  • PC1 reaches PC3: From PC1: ping 192.168.3.10
  • Checked with show ip ospf neighbor: show ip ospf neighbor on R1 or R3

Step-by-step solution

Try it on your own first: you learn much more by typing the commands yourself.

Show the solution

1Start OSPF and set the router ID R1

The router ID is chosen when the process starts. If you change it once there are neighbors, IOS asks for clear ip ospf process to apply it.

R1enable configure terminal router ospf 1 router-id 1.1.1.1

2Advertise the networks R1

network uses a wildcard (the inverted mask) and enables OSPF on the interfaces whose IP matches.

R1network 192.168.1.0 0.0.0.255 area 0 network 10.0.12.0 0.0.0.3 area 0

3Make the LAN interface passive R1

A passive interface is still advertised but sends no hellos: there are no routers to talk to on the LAN.

R1passive-interface g0/0 end

4Do the same on R3 R3

R3enable configure terminal router ospf 1 router-id 3.3.3.3 network 10.0.23.0 0.0.0.3 area 0 network 192.168.3.0 0.0.0.255 area 0 passive-interface g0/1 end

Verification

R2 has 1.1.1.1 and 3.3.3.3 in FULL state. On an Ethernet link one will be DR and the other BDR.

R2R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 3.3.3.3 1 FULL/DR 00:00:37 10.0.23.2 GigabitEthernet0/1 1.1.1.1 1 FULL/BDR 00:00:39 10.0.12.1 GigabitEthernet0/0

R1 learns R3's network and the R2–R3 link through OSPF (O), with distance 110.

R1R1#show ip route ospf Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set 10.0.0.0/30 is subnetted, 1 subnets O 10.0.23.0/30 [110/2] via 10.0.12.2, 00:00:12, GigabitEthernet0/1 O 192.168.3.0/24 [110/3] via 10.0.12.2, 00:00:12, GigabitEthernet0/1

Reaching one end from the other without a single static route is the final proof.

PC1C:\>ping 192.168.3.10 Pinging 192.168.3.10 with 32 bytes of data: Reply from 192.168.3.10: bytes=32 time<1ms TTL=125 Reply from 192.168.3.10: bytes=32 time<1ms TTL=125 Reply from 192.168.3.10: bytes=32 time<1ms TTL=125 Reply from 192.168.3.10: bytes=32 time<1ms TTL=125 Ping statistics for 192.168.3.10: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms

Common mistakes

Practice this lab on your phone

RoutingLab has this lab with a simulated IOS terminal: abbreviations, ? help, the same error messages and objectives that check themselves. The first two labs are free.

Get RoutingLab