router-id, network with wildcards, passive interfaces and neighbors
Level: IntermediateTime: 35 minDomain 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
Devices and cabling
R1, R2, R3·2911
PC1, PC3·PC-PT
From
To
Cable
PC1Fa0
R1Gi0/0
Crossover
R1Gi0/1
R2Gi0/0
Crossover
R2Gi0/1
R3Gi0/0
Crossover
R3Gi0/1
PC3Fa0
Crossover
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
Device
Interface
Address
Mask
Default gateway
R1
G0/0
192.168.1.1
255.255.255.0
—
R1
G0/1
10.0.12.1
255.255.255.252
—
R2
G0/0
10.0.12.2
255.255.255.252
—
R2
G0/1
10.0.23.1
255.255.255.252
—
R3
G0/0
10.0.23.2
255.255.255.252
—
R3
G0/1
192.168.3.1
255.255.255.0
—
PC1
NIC
192.168.1.10
255.255.255.0
192.168.1.1
PC3
NIC
192.168.3.10
255.255.255.0
192.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)
PC1: IP 192.168.1.10, mask 255.255.255.0, gateway 192.168.1.1
PC3: IP 192.168.3.10, mask 255.255.255.0, gateway 192.168.3.1
Tasks
What must end up working. In the app, each one ticks itself off as soon as you get it.
R1: OSPF 1 with router-id 1.1.1.1
R1 advertises both its networks in area 0
R1: G0/0 passive
R3: router-id 3.3.3.3 and both its networks
R3: G0/1 passive
R2 has R1 and R3 as FULL neighbors
PC1 reaches PC3
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)
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
Typing the mask instead of the wildcard in network (255.255.255.0 instead of 0.0.0.255).
Different areas on each side of the link: the routers never become neighbors.
Making the interface toward another router passive: it's advertised, but no adjacency forms.
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.