OSPF (Open Shorted Path
First)
1. OSPF is a link-state routing protocol, that Works on layer 3 (Network Layer), It is an open standard protocol. OSPF runs directly over IPv4 and the port uses UDP port no 89. It supports VLSM/CIDR, it is a classless protocol, and the administrative distance is 110. Metric uses bandwidth, max hop counts unlimited, uses SPF and Dijkstra algorithm, supports manual summarization, uses fast convergence, Supports authentication plane text and MD5.
OSPF Terms -
Neighbors An OSPF neighbor is a router that shares a common OSPF-enabled network link. OSPF routers discover other neighbors via the OSPF hello packets. An adjacent OSPF neighbor is an OSPF neighbor that shares a synchronized OSPF database between the two neighbors. Each OSPF process maintains a table for adjacent OSPF neighbors and the state of each router.
OSPF Process ID- A router can run multiple OSPF processes. Each process maintains its own unique database, and routes learned in one OSPF process are not available to a different OSPF process without redistribution of routes between processes. The OSPF process numbers are locally significant and do not have to match among routers. Running OSPF process number 1 on one router and running OSPF process number 1234 will still allow the two routers to become neighbors
OSPF Area- An OSPF area is a logical grouping of routers or, more specifically, a logical grouping of router interfaces. Area membership is set at the interface level, and the area ID is included in the OSPF hello packet. An interface can belong to only one area. All routers within the same OSPF area maintain an identical copy of the link-state database (LSDB). OSPF area ID starts from 0 to 4.2 billion.
OSPF Messages Types-
Hello- These packets are for discovering and maintaining neighbors. Packets are sent out periodically on all OSPF interfaces to discover new neighbors while ensuring that other adjacent neighbors are still online.
DBD- These packets are for summarizing database contents. Packets are exchanged when an OSPF adjacency is first being formed. These packets are used to describe the contents of the LSDB.
LSR- These packets are for database downloads. When a router thinks that part of its LSDB is stale, it may request a portion of a neighbor’s database by using this packet type.
LSU- These packets are for database updates. This is an explicit LSA for a specific network link and normally is sent in direct response to an LSR.
LSAck- These packets are for flooding acknowledgments. These packets are sent in response to the flooding of LSAs, thus making flooding a reliable transport feature
OSPF Hello Packet Field-
1. Router ID- A unique 32-bit ID within an OSPF domain.
2. Authentication option- A field that allows secure communication between OSPF routers to prevent malicious activity. Options are none, clear text, or MD5 authentication.
3. Area ID- The OSPF area that the OSPF interface belongs to. It is 32-bit no.
4. Interface address mask- The network mask for the primary IP address for the interface out which the hello is sent.
5. Interface Priority- The router interface priority for DR elections.
6. Hello Interval- The time span, in seconds, that a router sends out hello packets on the interface.
7. Dead Interval- The time span, in seconds, that a router wait to hear a hello from a neighbour router before it declares that router down.
8. DR and BDR- The IP addresses of DR and BDR for the network link.
9. Active Neighbour- A list of OSPF neighbours seen on the network segment. A router must have received a hello from the neighbour within the dead interval.
Hello Timer - Hello, the time is 10 sec and the dead interval 40 sec. The default OSPF hello timer interval varies based on the OSPF network type. OSPF allows modification to the hello timer interval with values between 1 and 65,535 seconds. Changing the hello timer interval modifies the default dead interval, too. The OSPF hello timer is modified with the interface configuration submode command ip ospf hello-interval 1–65535.
Dead Interval Timer The dead interval timer can be changed to a value between 1 and 65,535 seconds. The OSPF dead interval timer can be changed with the command ip ospf dead-interval 1–65535 under the interface configuration sub-mode.
OSPF Neighbour State-
Down- This is the initial state of a neighbour relationship. It indicates that the router has not received any OSPF hello packets.
Attempt- This state is relevant to NBMA networks that do not support broadcast and require explicit neighbour configuration. This state indicates that no information has been received recently, but the router is still attempting communication.
Init- This state indicates that a hello packet has been received from another router, but bidirectional communication has not been established.
2-Way- Bidirectional communication has been established. If a DR and BDR is needed, the election occurs during this state.
ExStart- This is the first state in forming the adjacency, The Router identifies which router will be the master and slave for the LSDB synchronization.
Exchange- During this state, routers are exchanging link states by using DBD packets.
Loading- LSR packets are sent to the neighbour, asking for the more recent LSAs that have been discovered (but not received) in the exchange state.
Full- Neighbouring routers are fully adjacent.
OSPF Tables-
It maintains three tables Neighbour table, Database table, and Routing table (the neighbour table contains directly connected neighbour details, the database table contains all area routes and the routing table contains the best route)
Passive Interface- Making the network interface passive still adds the network segment into the LSDB but prohibits the interface from forming OSPF adjacencies. A passive interface does not send out OSPF hellos and does not process any received OSPF packets. The command passive interface-id under the OSPF process makes the interface passive, and the command passive interface default makes all interfaces passive. To allow for an interface to process OSPF packets, the command no passive interface-id is used
OSPF area types-
1. Backbone area – area 0 will be the backbone area and every OSPF
speak router should be directly connected with the backbone area,
2. ABR (Autonomous boundary router)- two routers belonging from two
different areas will become ABR,
3. ASBR (Autonomous system boundary router)- when two routing protocols
are configured on an OSPF router will become ASBR. Single-area OSPF means when OSPF
routers belong to only one area, and multi-area OSPF means when OSPF routers
belong to more than one area.
■ RIDs must be unique between the two devices. They should be unique for the entire OSPF routing domain to prevent errors.
■ The interfaces must share a common subnet. OSPF uses the interface’s primary IP address when sending out OSPF hellos. The network mask (netmask) in the hello packet is used to extract the network ID of the hello packet.
■ The MTUs (maximum transmission units) on the interfaces must match. The OSPF protocol does not support fragmentation, so the MTUs on the interfaces should match.
■ The area ID must match for the segment.
■ The DR enablement must match for the segment.
■ OSPF hello and dead timers must match for the segment.
■ Authentication type and credentials (if any) must match for the segment.
■
Area type flags must match for the segment (for example, Stub, NSSA). (These
are not discussed in this book.)
OSPF DR and BDR- it uses DR for better management of traffic, DR and BDR are created only on broadcast and NBMA networks, point-to-point and multipoint networks have no election for DR and BDR DR election- The highest IP add of any physical interface will become DR and the second highest interface will become BDR, if any logical interface is available then the highest IP add of any logical interface will become DR and the second highest IP add of any logical interface will become BDR.
All SPF Routers have IPv4 address 224.0.0.5 or MAC address 01:00:5E:00:00:05. All routers running OSPF should be able to receive these packets. All DR Router IPv4 address 224.0.0.6 or MAC address 01:00:5E:00:00:06. Communication with designated routers (DRs) uses this address.
How OSPF Select DR and BDR:
Router Priority:
Each OSPF router in the network segment is assigned a priority value.
The router priority is a numerical value between 0 and 255. The router with the
highest priority becomes the DR, and the router with the second-highest
priority becomes the BDR.
Router ID:
If two or more routers have the same priority, OSPF uses the router ID
to break the tie. The router ID is a 32-bit value that uniquely identifies each
router within the OSPF autonomous system.
The router with the highest router ID among routers with equal priority
becomes the DR, and the router with the second-highest router ID becomes the
BDR.
Loopback Interface:
If router priorities and router IDs are still equal, OSPF looks at the
highest IP address of the loopback interfaces. The router with the highest
loopback IP address becomes the DR, and the router with the second-highest
loopback IP address becomes the BDR.
Physical Interface IP Address:
If all else is equal, OSPF compares the IP addresses of the physical
interfaces. The router with the highest IP address on a physical interface
becomes the DR, and the router with the second-highest IP address becomes the
BDR.
Default Router Priority:
If no router priority is configured, OSPF assigns a default priority of
1 to all routers. In this case, the router with the highest router ID becomes
the DR, and the router with the second-highest router ID becomes the BDR.
Broadcast Broadcast media such as
Ethernet are better defined as broadcast multi-access to distinguish them from
non-broadcast multi-access (NBMA) networks. Broadcast networks are multiaccess
in that they are capable of connecting more than two devices, and broadcasts
sent out one interface are capable of reaching all interfaces attached to that
segment
Point-to-Point Networks A network circuit that allows only
two devices to communicate is considered a point-topoint (P2P) network. Because
of the nature of the medium, point-to-point networks do not use Address
Resolution Protocol (ARP), and broadcast traffic does not become the limiting
factor. The OSPF network type is set to point-to-point by default for serial
interfaces (HDLC or PPP encapsulation), generic routing encapsulation (GRE)
tunnels, and point-to-point Frame Relay subinterfaces. Only two nodes can exist
on this type of network medium, so OSPF does not waste CPU cycles on DR
functionality. The hello timer is set to 10 seconds on OSPF point-to-point
network types.
OSPF Network Types:
1. Broadcast- default setting on OSPF-enabled ethernet links. DR and
BDR election occurs, hello time 10 sec and dead interval 40 sec.
2. Non-Broadcast- default setting on OSPF-enabled Frame Relay main
interface or Frame Relay multipoint sub interfaces, . DR and BDR election occurs,
hello time 30 sec and dead interval 120 sec.
3. Point-to-point- default setting on OSPF-enabled Frame Relay Point-to-point
sub-interface.
4. Point-to-multipoint- not enabled by default on any interface type.
Interface is advertised as a host route (/32) and set the next-hop address to
the outbound interface. Primarily used for hub-and-spoke topologies.
5. Loopback- Default setting on OSPF-enabled loopback interfaces. Interface
is advertised as a host route (/32).
OSPF LSA Types-
·
LSA Type 1: (Router
LSA) packets are sent
between routers within the same area of origin and do not leave the area. An
OSPF router uses LSA
Type 1 packets to describe its own interfaces but also
carries information about its neighbors to adjacent routers in the same area.
·
LSA Type 2: (Network
LSA) packets are
generated by the Designated
Router (DR)
to describe all routers connected to its segment directly. LSA Type 2 packets
are flooded between neighbors in the same area of origin and remain within that
area.
·
LSA Type 3: (Summary
LSA) packets are
generated by Area Border
Routers (ABR) to summarize its
directly connected area, and advertise inter-area router information to other
areas the ABR is
connected to, with the use of a summary prefix (e.g 192.168.0.0/22). LSA Type 3 packets
are flooded to multiple areas throughout the network and help with OSPF’s
scalability with the use of summary prefixes.
·
LSA Type 4: (ASBR
Summary LSA) packets are the
LSAs that advertise the presence of an Autonomous System Border Router (ASBR)
to other areas
·
LSA Type 5: (ASBR
External LSA) packets are
generated by the ASBR to
advertise external redistributed routes into the OSPF’s AS
·
LSA Type 6: (Group
Membership LSA) packets were
designed for Multicast OSPF (MOSPF), a protocol that supports multicast routing
through OSPF. MOSPF is not supported by Cisco and is not widely used and is
expected to be retired soon.
·
LSA Type 7: (NSSA
External LSA) packets are used
for some special area types that do not allow external distributed routes to go
through and thus block LSA
Type 5 packets from flooding through them, LSA Type 7 packets
act as a mask for LSA
Type 5 packets to allow them to move through these special
areas and reach the ABR that
is able to translate LSA
Type 7 packets back to LSA Type 5 packets.
·
LSA Type 8: (External
Attributes LSA -OSPFv2-/ Link Local LSA -OSPFv3-) in OSPFv2 (IPv4)
are called External
Attribute LSAs, and are used to transit BGP attributes through
an OSPF network while BGP destinations are conveyed via LSA Type 5 packets,
however, this feature isn’t supported by most routers. With OSPFv3 IPv6), LSA Type 8 is
redefined to carry IPv6 information
through OSPF network.
·
LSA Type 9: OSPF
Link Scope Opaque is defined as
a Link Scope Opaque
LSA for carrying OSPF information. For OSPFv3 it’s
redefined to handle a communication prefix for a special area type called Stub Area. LSA Type 10: OSPF Area Scope Opaque LSA
(LSA Type 9 in OSPFv2 (IPv4) is defined as
a Link Scope Opaque
LSA for carrying OSPF information. For OSPFv3 it’s
redefined to handle a communication prefix for a special area type called Stub Area.
·
LSA Type 10 (OSPF Area Scope
Opaque LSA) packets are used to flood OSPF information through other area
routers even if these routers do not process this information in order to
extend OSPF functionality, this LSA is used for traffic engineering to
advertise MPLS and other protocols.
·
LSA Type 11 (OSPF AS (Autonomous System) Scope Opaque LSA) packets serve the
same purpose as LSA Type 10 packets but are not flooded into
special area types (Stub areas).
LSA Sequences OSPF uses the sequence
number to overcome problems caused by delays in LSA propagation in a network.
The LSA sequence number is a 32-bit number for controlling versioning. When the
originating router sends out LSAs, the LSA sequence number is incremented. If a
router receives an LSA sequence that is greater than the one in the LSDB, it
processes the LSA. If the LSA sequence number is lower than the one in the
LSDB, the router deems the LSA old and discards the LSA.
LSA Age and Flooding Every
OSPF LSA includes an age that is entered into the local LSDB and that will
increment by 1 every second. When a router’s OSPF LSA age exceeds 1800 seconds
(30 minutes) for its networks, the originating router advertises a new LSA with
the LSA age set to 0. As each router forwards the LSA, the LSA age is
incremented with a calculated (minimal) delay that reflects the link. If the
LSA age reaches 3600, the LSA is deemed invalid and is purged from the LSDB.
The repetitive flooding of LSAs is a secondary safety mechanism to ensure that
all routers maintain a consistent LSDB within an area.
OSPF
Path Selection-
1.
Intra-area 2. Interarea 3.
External routes
Intra-Area Routes Routes advertised via a
type 1 LSA for an area are always preferred over type 3 LSAs. If multiple
intra-area routes exist, the path with the lowest total path metric is
installed in the OSPF Routing Information Base (RIB), which is then presented
to the router’s global RIB. If there is a tie in metric, both routes install
into the OSPF RIB
Interarea Routes The next priority for
selecting a path to a network is selection of the path with the lowest total
path metric to the destination. If there is a tie in metric, both routes
install into the OSPF RIB. All interarea paths for a route must go through Area
0 to be considered.
Equal-Cost Multipathing If OSPF identifies
multiple paths in the path selection algorithms, those routes are installed
into the routing table as equal-cost multipathing (ECMP) routes. The default
maximum number of ECMP paths is four paths. The default ECMP setting can be
overwritten with the command maximum-paths maximum-paths under the OSPF process
to modify the default setting.
Interarea Summarization Interarea summarization
reduces the number of type 3 LSAs that an ABR advertises into an area when it
receives type 1 LSAs. The network summarization range is associated with a
specific source area for type 1 LSAs
How to Configure OSPF
R1 Configuration -
Router(config)#router ospf 1
Router(config-router)#network 4.0.0.0 0.255.255.255 area 0
Router(config-router)#network 1.0.0.0 0.255.255.255 area 0
Router(config-router)#router-id 9.9.9.9
Router(config-router)#do clear ip
ospf process
Router(config-router)#do show ip ospf interface
Serial0/0 is up, line
protocol is up
Interface address is 1.1.1.1/8, Area 0
Process ID 1, Router ID 9.9.9.9, Network Type
POINTERFACE-TO-POINTERFACE, Cost: 64
Transmit Delay is 1 sec, State POINTERFACE-TO-POINTERFACE,
Timer interfac configured, Hello 10, Dead 40,
Wait 40, Retransmit 5
Hello due in 00:00:08
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0
msec
Neighbour Count is 1 , Adjacent neighbour
count is 1
Adjacent with neighbour 2.1.1.1
Suppress hello for 0 neighbour(s)
Serial0/1 is up, line
protocol is up
Interface address is 4.1.1.1/8, Area 0
Process ID 1, Router ID 9.9.9.9, Network Type
POINTERFACE-TO-POINTERFACE, Cost: 64
Transmit Delay is 1 sec, State POINTERFACE-TO-POINTERFACE,
Timer interface configured, Hello 10, Dead
40, Wait 40, Retransmit 5
Hello
due in 00:00:08
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
Router(config-router)#do show ip route
C 1.0.0.0/8 is directly connected, Serial0/0
O IA 2.0.0.0/8
[110/128] via 1.1.1.2, 00:23:20, Serial0/0
C 4.0.0.0/8 is directly connected, Serial0/1
O IA 5.0.0.0/8
[110/128] via 4.1.1.2, 00:03:59, Serial0/1
O E2 6.0.0.0/8
[110/20] via 4.1.1.2, 00:03:59, Serial0/1
11.0.0.0/32 is subnetwork, 1 subnetworks
C 11.11.11.11 is directly connected,
Loopback0
O E2 20.0.0.0/8
[110/20] via 4.1.1.2, 00:03:59, Serial0/1
Router(config-router)#do show ip ospf database
OSPF Router with ID (9.9.9.9)
(Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.1.1.1 2.1.1.1 373 0x80000006 0x006329 2
4.1.1.1 4.1.1.1 432 0x80000010 0x00a20e 5
9.9.9.9 9.9.9.9 357 0x80000014 0x007af7 5
5.1.1.1 5.1.1.1 357 0x80000007 0x007906 2
Summary Network Link States (Area
0)
Link ID ADV Router Age Seq# Checksum
5.0.0.0 5.1.1.1 1716 0x80000001 0x008889
2.0.0.0 2.1.1.1 1506 0x80000001 0x00ca4d
Summary ASB Link States (Area
0)
Link ID ADV Router Age Seq# Checksum
6.1.1.1 5.1.1.1 1006 0x80000002 0x004ac1
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
6.0.0.0 6.1.1.1 1011 0x80000001 0x003081 0
20.0.0.0 6.1.1.1 1011 0x80000001 0x00792a 0
R2 Configuration -
Router#show ip interface brief
Interfaceerface IP-Address OK? Method Status Protocol
FastEthernetwork0/0 unassigned YES unset
administratively down down
FastEthernetwork0/1 unassigned YES unset
administratively down down
Serial0/0 4.1.1.2 YES manual up up
Serial0/1 5.1.1.1 YES manual up up
Router(config)#router ospf 1
Router(config-router)#network 4.0.0.0 0.255.255.255 area 0
Router(config-router)#network 5.0.0.0 0.255.255.255 area 2
Router(config-router)#do wr
Router#show ip ospf border-routers
R3 Configuration -
Router(config)#do show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernetwork0/0 unassigned YES unset
administratively down down
FastEthernetwork0/1 unassigned YES unset
administratively down down
Serial0/0 5.1.1.2 YES manual up up
Serial0/1 6.1.1.1 YES manual up up
Router(config)#router ospf 1
Router(config-router)#network 5.0.0.0 0.255.255.255 area 2
Router(config-router)#do wr
Router(config-router)#router eigrp 10
Router(config-router)#network 6.0.0.0
Router(config-router)#no auto-summary
Router(config-router)#do wr
Router(config-router)#redistribute eigrp 10 subnetworks
Router(config-router)#router eigrp 10
Router(config-router)#redistribute ospf 1 metric 10 10 10 10 10
Router(config-router)#do wr
R4 Configuration -
Router(config)#do show ip interface brief
Interfaceerface IP-Address OK? Method Status Protocol
FastEthernetwork0/0 20.0.0.1 YES manual up up
FastEthernetwork0/1 unassigned YES unset
administratively down down
Serial0/0 6.1.1.2 YES manual up up
Serial0/1 unassigned YES unset
administratively down down
Router(config)#router eigrp 10
Router(config-router)#network 6.0.0.0
Router(config-router)#network 20.0.0.0
Router(config-router)#no auto-summary
Router#show ip route
D EX 1.0.0.0/8
[170/256514560] via 6.1.1.1, 00:01:45, Serial0/0
D EX 2.0.0.0/8
[170/256514560] via 6.1.1.1, 00:01:45, Serial0/0
D EX 4.0.0.0/8
[170/256514560] via 6.1.1.1, 00:01:45, Serial0/0
D EX 5.0.0.0/8
[170/256514560] via 6.1.1.1, 00:01:45, Serial0/0
C 6.0.0.0/8 is directly connected, Serial0/0
C 20.0.0.0/8 is directly connected, FastEthernetwork0/0
R5 Configuration -
Router(config)#do show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernetwork0/0 unassigned YES unset
administratively down down
FastEthernetwork0/1 unassigned YES unset
administratively down down
Serial0/0 2.1.1.1 YES manual up up
Serial0/1 1.1.1.2 YES manual up up
Router(config)#router ospf 1
Router(config-router)#network 1.0.0.0 0.255.255.255 area 0
Router(config-router)#network 2.0.0.0 0.255.255.255 area 1
Router(config-router)#do wr
Router(config-router)#do show ip ospf interface
Serial0/1 is up, line
protocol is up
Interface address is 1.1.1.2/8, Area 0
Process ID 1, Router ID 2.1.1.1, Network Type
POINTERFACE-TO-POINTERFACE, Cost: 64
Transmit Delay is 1 sec, State POINTERFACE-TO-POINTERFACE,
Timer interface configured, Hello 10, Dead
40, Wait 40, Retransmit 5
Hello due in 00:00:07
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0
msec
Neighbour Count is 1 , Adjacent neighbour
count is 1
Adjacent with neighbour 4.1.1.1
Suppress hello for 0 neighbour(s)
Serial0/0 is up, line
protocol is up
Interface address is 2.1.1.1/8, Area 1
Process ID 1, Router ID 2.1.1.1, Network Type
POINTERFACE-TO-POINTERFACE, Cost: 64
Transmit Delay is 1 sec, State POINTERFACE-TO-POINTERFACE,
Timer interface configured, Hello 10, Dead
40, Wait 40, Retransmit 5
Hello due in 00:00:01
Index 2/2, flood queue length 0
Next 0x0(0)/0x0(0)
R6 Configuration -
Router(config)#do show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernetwork0/0 unassigned YES unset
administratively down down
FastEthernetwork0/1 3.1.1.1 YES manual up up
Serial0/0 2.1.1.2 YES manual up up
Serial0/1 unassigned YES manual administratively down down
Router(config)#router ospf 1
Router(config-router)#network 2.0.0.0 0.255.255.255 area 1
Router(config-router)#network 3.0.0.0 0.255.255.255 area 500
Router(config-router)#do wr
Router#show ip ospf interface
Serial0/0 is up, line
protocol is up
Interface address is 2.1.1.2/8, Area 1
Process ID 1, Router ID 3.1.1.1, Network Type
POINTERFACE-TO-POINTERFACE, Cost: 64
Transmit Delay is 1 sec, State POINTERFACE-TO-POINTERFACE,
Timer interface configured, Hello 10, Dead
40, Wait 40, Retransmit 5
Hello due in 00:00:05
Index 1/1, flood queue length 0
Next 0x0(0)/0x0(0)
Last flood scan length is 1, maximum is 1
Last flood scan time is 0 msec, maximum is 0
msec
Neighbour Count is 1 , Adjacent neighbour
count is 1
Adjacent with neighbour 2.1.1.1
Suppress hello for 0 neighbour(s)
FastEthernetwork0/1
is up, line protocol is up
Interface address is 3.1.1.1/8, Area 500
Process ID 1, Router ID 3.1.1.1, Network Type
BRIEFOADCAST, Cost: 1
Transmit Delay is 1 sec, State DR, Priority 1
Designated Router (ID) 3.1.1.1, Interface
address 3.1.1.1
Backup Designated Router (ID) 10.0.0.1, Interface
address 3.1.1.2
Timer interface configured, Hello 10, Dead
40, Wait 40, Retransmit 5
Router#show ip ospf neighbour
Neighbour ID Pri
State Dead Time Address Interface
2.1.1.1 0
FULL/ - 00:00:31 2.1.1.1 Serial0/0
10.0.0.1 1
FULL/BDR 00:00:32 3.1.1.2 FastEthernetwork0/1
R7 Configuration -
Router(config)#do show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernetwork0/0 10.0.0.1 YES manual up up
FastEthernetwork0/1 3.1.1.2 YES manual up up
Serial0/0 unassigned YES unset
administratively down down
Serial0/1 unassigned YES unset
administratively down down
Router(config)#router ospf 1
Router(config-router)#network 3.0.0.0 0.255.255.255 area 500
Router(config-router)#network 10.0.0.0 0.255.255.255 area 500
Router(config-router)#do wr
Router#show ip ospf neighbour
Neighbour ID Pri
State Dead Time Address Interface
3.1.1.1 1
FULL/DR 00:00:30 3.1.1.1 FastEthernetwork0/1
Router#do show ip ospf database
OSPF Router with ID (10.0.0.1)
(Process ID 1)
Router Link States (Area 500)
Link ID ADV Router Age Seq# Checksum Link count
3.1.1.1 3.1.1.1 1359 0x80000002 0x00e952 1
10.0.0.1 10.0.0.1 1357 0x80000003 0x00cd47 2
Network Link States (Area 500)
Link ID ADV Router Age Seq# Checksum
3.1.1.1 3.1.1.1 1359 0x80000001 0x00f3d7
Summary ASB Link States (Area
500)
Link ID ADV Router Age Seq# Checksum
6.1.1.1 3.1.1.1 967 0x80000001 0x005eb0
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
6.0.0.0 6.1.1.1 972 0x80000001 0x003081 0
20.0.0.0 6.1.1.1 972
OSPF Authentication
OSPF authentication secures OSPF
routers to make neighbor relationships and exchange routing updates securely. You
can enable OSPF authentication between router interfaces.
There are two types of OSPF authentication-
1. Plain text password authentication – Password information is exchanged
in plain text and it is not secure.
2. MD5 Authentication – Password information is exchanged in a secure
encrypted format and it is a very secure way to authenticate OSPF routers.
Command Syntax to Plain Text Authentication –
#IP OSPF Authentication-Key Password
#IP OSPF Authentication
Command Syntax to Plain Text Authentication –
#IP OSPF Message-Digest-Key MD5 Secret
#IP OSPF Authentication Message-Digest
How to Configure Simple Password Authentication-
R1(config)#int se 0/0
R1(config-if)#ip ospf authentication
R1(config-if)#ip
ospf authentication-key cisco
R2(config)#int se 0/0
R2(config-if)#ip
ospf authentication
R2(config-if)#ip
ospf authentication-key cisco
How to Configure MD5 Authentication-
R1(config)#int se 0/1
R1(config-if)#ip
ospf authentication
R1(config-if)#ip
ospf authentication message-digest key md5 secret
R2(config)#int se 0/1
R2(config-if)#ip
ospf authentication
R2(config-if)#ip
ospf authentication message-digest key md5 secret
According to the OSPF area concept, all areas in an
OSPF autonomous system must be physically connected to the backbone area. But in
some cases physical connection is not possible, you can use a virtual link to
connect to the backbone with the help of a non-backbone area. you can also use
virtual links to connect two parts of a partitioned backbone through a
non-backbone area. The area through which you configure the virtual link, known
as a transit area, must have full routing information. The transit area cannot
be a stub area.
R1 Configuration-
Router#conf t
Router(config)#int se 0/0
Router(config-if)#ip add 1.1.1.1
255.0.0.0
Router(config-if)#no shut
Router(config-if)#int fa 0/0
Router(config-if)#ip add 10.0.0.1
255.0.0.0
Router(config-if)#no shut
Router(config-if)#int lo 0
Router(config-if)#ip add 3.3.3.3
255.255.255.255
Router(config-if)#router ospf 1
Router(config-router)#net 1.0.0.0
0.255.255.255 area 1
Router(config-router)#net 10.0.0.0
0.255.255.255 area 0
Router(config-router)#do wr
Building configuration...
[OK]
Router(config-router)#area 1
virtual-link 5.5.5.5
R2 Configuration-
Router#conf t
Router(config)#int se 0/0
Router(config-if)#ip add 1.1.1.2
255.0.0.0
Router(config-if)#no shut
Router(config-if)#int se 0/1
Router(config-if)#ip add 2.1.1.1
255.0.0.0
Router(config-if)#no shut
Router(config-if)#int lo 0
Router(config-if)#ip add 4.4.4.4
255.255.255.255
Router(config-if)#router ospf 1
Router(config-router)#net 1.0.0.0
0.255.255.255 area 1
Router(config-router)#net 2.0.0.0
0.255.255.255 area 1
Router(config-router)#do wr
Building configuration...
[OK]
R3 Configuration-
Router#conf t
Router(config)#int se 0/0
Router(config-if)#ip add 2.1.1.2
255.0.0.0
Router(config-if)#no shut
Router(config-if)#int lo 0
Router(config-if)#ip add 5.5.5.5
255.255.255.255
Router(config-if)#router ospf 1
Router(config-router)#net 20.0.0.0
0.255.255.255 area 2
Router(config-router)#net 2.0.0.0
0.255.255.255 area 1
Router(config-router)#do wr
Building configuration...
[OK]
Router(config-router)#area 1
virtual-link 3.3.3.3
No comments:
Post a Comment