+OSPF Config - v3
+OSPF Config - v3
(!!! Before configuration make sure all necessary interfaces are “up” and “up” with: R1#show ip interface brief )
R2(config)#router ? (Shows routing protocols)
OSPF
“Adjacency: Hello Intervals, Dead Intervals and Network Types must be the same!”
Hello Interval Dead Interval = 4 x Hello Interval Removing route from LS Database
10 sec. – BMA + P-P 40 sec. – BMA + P-P Router floods LS Info about down neighbor out all OSPF enabled
interfaces.
30 sec. – NBMA 120 sec. – NBMA
OSPF Hello and Dead intervals can be modified manually using the following interface commands on Adjacency Routers:
OSPF Uses Dijkstra´s SPF Algorithm: because of Flapping link – up and down and
recalculation of SPF Algorithm...
- Initial SPF shedule delay 5000 ms = 5 sec (R waits after receiving LSU before running SPF Algorithm.)
- Minimum hold time between two consecutive SPFs 10 000 ms = 10 sec (R waits after running the SPF Algorithm before rerunning the algorithm again.)
- Maximum wait time between two consecutive SPFs 10 000 ms = 10 sec
(OSPF is enabled with the router ospf process-id that is a number 1-65535. Thep rocess-id is locally significant, which means that it does not have to match
other OSPF routers in order to establish adjacencies with those neighbors. This differs from EIGRP. The EIGRP process ID or autonomous system number does
need to match for two EIGRP neighbors to become adjacent.)
1
R1(config-router)#network <network_number wild_card> area <area_ID>
(The area-id refers to the OSPF area = group of routers that share link-state information. All OSPF routers in the same area must have the same link-state
information in their link-state databases. This is accomplished by routers flooding their individual link-states to all other routers in the area. This is known as
single-area OSPF. There are several advantages to configuring large OSPF networks as multiple areas OSPF, to be able to isolate unstable network problems
within an area.)
(Although any area-id can be used, it is good practice to use an area-id of 0 with single-area
OSPF. This convention makes it easier if the network is later configured as multiple OSPF
areas where area 0 becomes the backbone area.)
R1(config)#router ospf 1
R1(config-router)#router-id 11.11.11.11 (router-id must be unique!)
1) Introduced in IOS 12.0(T) and takes precedence over loopback and physical interface IP
addresses for determining the Router ID.
2) If the OSPF router-id command is not used and loopback interfaces are configured, OSPF
will choose highest IP address of any of its loopback interfaces.
3) If no loopback interfaces are configured, the router chooses highest active IP address of
any of its physical interfaces.
or R1(config)#interface Lo0
(for router-id use Loopback <lo> interface, is always up and number 0 can be the same within
each router with /32)
(Note: Because some IOS versions do not support the router-id command, use the loopback 0 address method for assigning router IDs. Modifying a router ID with
a new loopback or physical interface IP address may require reloading the router.
The router ID can be modified with the IP address from a subsequent OSPF router-id command by reloading the router or by using the following command:
Router#clear ip ospf process
OSPF Metric:
The Cisco IOS uses the cumulative bandwidths of the outgoing interfaces from
the router to the destination network as the cost value. All serial links are set to
default bandwidth (T1) 1544kbps.
(no bandwidth – restores the default value 1544 kbps, immediatelly check
all interfaces on Routers : R1#show interface serial 0/0/0 and 0/0/1 →
attention! – command show ip interface serial 0/0/0, is different in its
result)
2
Multiaccess networks
can create two challenges for OSPF regarding the flooding of LSAs:
1. Creation of multiple adjacencies, one adjacency for every pair of routers. „BMA“
2. Extensive flooding of LSAs (Link-State Advertisements).
DROthers only form FULL adjacencies networks with the DR and BDR, but will
still form a neighbor adjacency with any DROthers that join the network area-id.
The DR and BDR election process takes place as soon as the first router with an
OSPF enabled interface is active on the multiaccess network. This can happen
when the routers are powered-on or when the OSPF network command for that
interface is configured. The election process only takes a few seconds. If all of the
routers on the multiaccess network have not finished booting, it is possible that a router with a lower router ID will become the DR. This could be a lower-end router
that took less time to boot.
DR collects and distributes LSAs, it is important for this router to have sufficient CPU and memory capacity to handle the responsibility. Instead of relying on the
router ID to decide which routers are elected the DR and BDR, it is better to control the election of these routers with the ip ospf priority (PRI) interface command.
Router(config-if)#ip ospf priority {0 - 255} (0=DROther only, 1=default value, Highest number in area-id=DR, Second highest number in area-id=BDR)
RD(config)#interface fa0/0
RD(config-if)#ip ospf priority 100
RD(config-if)#shutdown
RD(config-if)#no shutdown
RD(config-if)#end
RD#show ip ospf neighbor
Enable Default Static Route on Autonomous System Boundary Router (ASBR): here is R1
R1(config)#interface loopback 1
R1(config-if)#ip add 171.30.1.1 255.255.255.252
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 loopback 1
R1(config)#router ospf 1
R1(config-router)#default-information originate
R1(config-if)#end
3
R1#copy running-config startup-config
R2#show ip route
O*E2 0.0.0.0/0 [110/1] via 192.168.10.10, 00:05:34, Serial0/0/1 (E2 denotes that this route is an OSPF External Type 2 route. )
OSPF external routes: External Type 1 (E1) or External Type 2 (E2). The difference between the two is in the way the OSPF cost of the route is calculated at
each router. OSPF accumulates cost for an E1 route as the route is being propagated throughout the OSPF area. This process is identical to cost calculations for
normal OSPF internal routes. However, the cost of an E2 route is always the external cost, irrespective of the interior cost to reach that route. In this topology,
because the default route has an external cost of 1 on the R1 router, R2 and R3 also show a cost of 1 for the default E2 route. E2 routes at a cost of 1 are the default
OSPF configuration. Changing these defaults, as well as more external route information, is discussed in CCNP.
Step 1. On a router:
• Enable "simple" or "MD5" authentication for "all interfaces on a router" in OSPF 10 proccesses packets traversing through area 0.
• OSPF authentication Types:
▪ 0 - OSPF with no authentication;
▪ 1 - OSPF with "plain-text" password = simple authentication;
▪ 2 - OSPF with "MD 5" hash encryption algorithm.
R1(config)#router ospf 10
R1(config-router)#area 0 authentication (Enables simple authentication for all router´s interfaces in area 0. Clear text
passwords.)
R1(config-router)#area 0 authentication message-digest (Enables MD 5 authentication for all router´s interfaces in area 0.)
Step 2. On an interface:
• Enable "simple" or "MD5" authentication for "specific interfaces on a router"
• Create an "authentication-key" or "message-digest-key 1" with value of cisco123 or cisco that will be used for authentication.
• Neighboring routers on the same network (adjacent interfaces) must have the same password!!!
R1(config)#interface s0/0/0
R1(config-if)#ip ospf authentication (Enables simple authentication for router´s interface s0/0/0 only!!! Clear text passwords.)
R1(config-if)#ip ospf authentication-key cisco123 (To set the authentication key = password to cisco123 on s0/0/0.)
or
R1(config-if)#ip ospf authentication message-digest (Enables MD 5 authentication for router´s interface s0/0/0 only!!! Passwords encrypted by
MD5)
R1(config-if)#ip ospf message-digest-key 1 md5 cisco (To set the authentication key = password to cisco on s0/0/0.)
R1#clear ip route* (to force the routers to rebuild their routing tables)
R1#clear ip route ospf
R1#show ip traffic [….] (info about number and type of packets sent and received)
SUMMARY OSPF:
R1(config)#ip classless (or no ..., forwarding packets to the best supernet or default route. Classless routing behavior is by default from IOS 11.3.)
R1(config)#router ospf 10 (Ospf proces ID = 1-65 535; can be different on each router on area 0; on EIGRP must be the same for adjacencies)
R1(config-router)#router-id 1.1.1.1 (Static router-id must be unique for each router, or highest virtual, or highest physical interface ID)
R1(config-router)#log-adjacency-changes [detail] (Command without detail is by default, good for reporting up-down events)
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0 (***Interface with an address of 1.1.1.1 255.255.255.255 is to be put into area 0)
R1(config-router)#network 192.168.10.0 0.0.0.3 area 0 (Any interface with an address of 192.168.10.0 255.255.255.252 is to be put into area 0)
***To define the range or specific interfaces on the router which will be included in area 0 in OSPF. The router creates its advertisements based on the subnet mask configured on each
interface.
If your network is more complex, or you have multiple areas, or your network changes a lot, a very good habit to get into is specifying each interface address explicitly. The advantage
here is that you don't accidentally slip up and put an interface in the wrong area. The wildcard mask 0.0.0.0 means each statement only applies to a single IP address and won't
accidentally overlap another interface. If you're using a lot of VLSM, that can be challenging to troubleshoot.
An example of where this could cause trouble is if you had a router that joined an OSPF network to an EIGRP network, and you were redistributing between the protocols... If you
accidentally included an interface in OSPF when you thought it was only in EIGRP, then your router may behave much differently than you anticipate.***
R1(config-router)#passive-interface fa 0/0 (it will stop sending of Hello packets on interface – no adjacency!)
R1(config-router)#neighbor 10.1.1.2 (next hop exchanging info neighbor)
R1(config-router)#default-information originate [olways] (R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0 Propagate the default route on ASBR)
[olways] – Propagate the default route even if it is not configured on ASBR.
R1(config-router)#area 0 authentication (Enables simple authentication for all R1 interfaces in area 0. Clear text passwords.)
R1(config-router)#area 0 authentication message-digest (Enables MD 5 authentication for all R1 interfaces: encrypted passwords by MD5 hash algrthm)
R1(config-router)#auto-cost reference-bandwidth 10000 (Change OSPF reference BW-value on each router in the same area-id from 100 to 10 000 Mbps
on all interfaces for future preferencies…10 Gbps Eth.)
4
R1(config)#interface s0/0/0
R1(config-if)#ip ospf network point-to-point (force OSPF to advertise loopback networks with assigned mask and not with /32 bit mask only)
R1(config-if)#ip ospf cost 1562 Reference BW fa0/0 : BW fa0/0 = cost 1 (cost by default); cost 1562 = 64 kbps; cost 64 = 1544 kbps;
Reference BW 10 GB (10 000 Mbps) : BW fa 0/0 (100 Mbps) = cost 10 (cost after: auto-cost reference-bandwidth 10000)
R1(config-if)#ip ospf authentication (Enables simple authentication for router´s interface s0/0/0 only!!! Clear text passwords.)
R1(config-if)#ip ospf authentication-key cisco123 (To set the authentication key = password to cisco123 on s0/0/0.)
or
R1(config-if)#ip ospf authentication message-digest (Enables MD 5 authentication for router´s interface s0/0/0 only!!! Passwords encrypted by MD5)
R1(config-if)#ip ospf message-digest-key 1 md5 cisco (To set the authentication key = password to cisco on s0/0/0.)
R1#show interfaces (view actual BW on interfaces – displays all timers of updates of Routing Protocols )
R1#show ip interface serial 0/0/0 (verify that OSPF on serial interface only – displays all timers Hello, Dead, … of updates of Routing Protocols)
R1#show ip ospf interfaces (fa0/0)
R1#clear ip ospf ?
R1#clear ip ospf process
R1#show ip ospf
R1#show ip ospf neighbor (detail)
R1#show ip ospf database (Link-State Database = must be the same on all routers in one area)
R1#show ip ospf 10 0 database (Link-State Database of process ID = 10 and of area 0)
R1#show ip ospf border-routers
R1#show ip protocol (verify that OSPF is enabled, displays all metrics, timers of updates of Routing Protocols)
R1#show protocols (verify BW… on all intefaces – 2. Data Link Layer of the OSI)