How to configure OSPF for CCNA students


(Arindom N) #41

Hi Rene,
i am trying to doing your LAB one by one…
Based on below mention topic when i am trying to change router id automatically based on highest ip address on interface why its not changing after clear ip ospf process

R2#sh version
Cisco IOS Software, 7200 Software (C7200P-SPSERVICESK9-M), Version 12.4(15)T9, RELEASE SOFTWARE (fc5)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2009 by Cisco Systems, Inc.
Compiled Tue 28-Apr-09 20:04 by prod_rel_team

ROM: System Bootstrap, Version 12.4(12.2r)T, RELEASE SOFTWARE (fc1)
BOOTLDR: Cisco IOS Software, 7200 Software (C7200P-KBOOT-M), Version 12.4(15)T9, RELEASE SOFTWARE (fc5)

R2 uptime is 4 days, 22 hours, 58 minutes
System returned to ROM by power-on
System image file is "disk0:c7200p-spservicesk9-mz.124-15.T9.bin"


This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.

A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.html

If you require further assistance please contact us by sending email to
export@cisco.com.

Cisco 7201 (c7201) processor (revision B) with 917504K/65536K bytes of memory.
Processor board ID 78009046
MPC7448 CPU at 1666Mhz, Implementation 0, Rev 2.2
1 slot midplane, Version 2.1

Last reset from power-on
1 FastEthernet interface
4 Gigabit Ethernet interfaces
2045K bytes of NVRAM.

254464K bytes of ATA PCMCIA card at slot 0 (Sector size 512 bytes).
65536K bytes of Flash internal SIMM (Sector size 512K).
Configuration register is 0x2102


R2(config)#inter loopback 0
R2(config-if)#ip address 2.2.2.2 255.255.255.0
R2(config-if)#end

R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.23.2
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.12.0 0.0.0.255 area 0
    192.168.23.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.23.3         110      00:03:33
  Distance: (default is 110)

R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.23.2
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.12.0 0.0.0.255 area 0
    192.168.23.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.23.3         110      00:03:54
  Distance: (default is 110)

R2#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R2#
*Mar 14 00:32:19.074: OSPF: Interface GigabitEthernet0/3 going Down
*Mar 14 00:32:19.074: OSPF: 192.168.23.2 address 192.168.23.2 on GigabitEthernet0/3 is dead, state DOWN
*Mar 14 00:32:19.074: OSPF: Neighbor change Event on interface GigabitEthernet0/3
*Mar 14 00:32:19.074: OSPF: DR/BDR election on GigabitEthernet0/3
*Mar 14 00:32:19.074: OSPF: Elect BDR 0.0.0.0
*Mar 14 00:32:19.074: OSPF: Elect DR 192.168.23.3
*Mar 14 00:32:19.074: OSPF: Elect BDR 0.0.0.0
*Mar 14 00:32:19.074: OSPF: Elect DR 192.168.23.3
*Mar 14 00:32:19.074:        DR: 192.168.23.3 (Id)   BDR: none
*Mar 14 00:32:19.074: OSPF: 192.168.23.3 address 192.168.23.3 on GigabitEthernet0/3 is dead, state DOWN
*Mar 14 00:32:19.074: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.3 on GigabitEthernet0/3 from FULL to DOWN, Neighbor Down: Interface down or detached
*Mar 14 00:32:19.074: OSPF: Neighbor change Event on interface GigabitEthernet0/3
*Mar 14 00:32:19.074: OSPF: DR/BDR election on GigabitEthernet0/3
*Mar 14 00:32:19.074: OSPF: Elect BDR 0.0.0.0
*Mar 14 00:32:19.074: OSPF: Elect DR 0.0.0.0
*Mar 14 00:32:19.074:        DR: none    BDR: none
*Mar 14 00:32:19.074: OSPF: Remember old DR 192.168.23.3 (id)
*Mar 14 00:32:19.074: OSPF: Interface GigabitEthernet0/0 going Down
*Mar 14 00:32:19.074: OSPF: 192.168.23.2 address 192.168.12.2 on GigabitEthernet0/0 is dead, state DOWN
*Mar 14 00:32:19.074: OSPF: Neighbor change Event on interface GigabitEthernet0/0
*Mar 14 00:32:19.074: OSPF: DR/BDR election on GigabitEthernet0/0
*Mar 14 00:32:19.074: OSPF: Elect BDR 0.0.0.0
*Mar 14 00:32:19.074: OSPF: Elect DR 0.0.0.0
*Mar 14 00:32:19.074: OSPF: Elect BDR 0.0.0.0
*Mar 14 00:32:19.074: OSPF: Elect DR 0.0.0.0
*Mar 14 00:32:19.074:        DR: none    BDR: none
*Mar 14 00:32:19.074: OSPF: Flush network LSA immediately
*Mar 14 00:32:19.074: OSPF: Remember old DR 192.168.23.2 (id)
*Mar 14 00:32:19.074: OSPF: Interface GigabitEthernet0/3 going Up
*Mar 14 00:32:19.074: OSPF: Interface GigabitEthernet0/0 going Up
*Mar 14 00:32:19.574: OS
R2#PF: Build router LSA for area 0, router ID 192.168.23.2, seq 0x80000001, process 1
*Mar 14 00:32:19.574: OSPF: We are not DR to build Net Lsa for interface GigabitEthernet0/0
*Mar 14 00:32:21.538: OSPF: OSPF: Rcv pkt from GigabitEthernet0/3 src 192.168.23.3 dst 224.0.0.5 id 192.168.23.3 type 5 if_state 2 : ignored due to unknown neighbor
*Mar 14 00:32:21.602: OSPF: 2 Way Communication to 192.168.23.3 on GigabitEthernet0/3, state 2WAY
*Mar 14 00:32:21.602: OSPF: Backup seen Event before WAIT timer on GigabitEthernet0/3
*Mar 14 00:32:21.602: OSPF: DR/BDR election on GigabitEthernet0/3
*Mar 14 00:32:21.602: OSPF: Elect BDR 192.168.23.2
*Mar 14 00:32:21.602: OSPF: Elect DR 192.168.23.3
*Mar 14 00:32:21.602: OSPF: Elect BDR 192.168.23.2
*Mar 14 00:32:21.602: OSPF: Elect DR 192.168.23.3
*Mar 14 00:32:21.602:        DR: 192.168.23.3 (Id)   BDR: 192.168.23.2 (Id)
*Mar 14 00:32:21.602: OSPF: Send DBD to 192.168.23.3 on GigabitEthernet0/3 seq 0x120 opt 0x52 flag 0x7 len 32
*Mar 14 00:32:21.606: OSPF: Rcv DBD from 192.168.23.3 on GigabitEthernet0/3 seq 0x22DD opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
*Mar 14 00:32:21.606: OSPF: NBR Negotiation Done. We are the SLAVE
*Mar 14 00:32:21.606: OSPF: Send DBD to 192.168.23.3 on GigabitEthernet0/3 seq 0x22DD opt 0x52 flag 0x2 len 52
*Mar 14 00:32:21.606: OSPF: Rcv DBD from 192.168.23.3 on GigabitEthernet0/3 seq 0x22DE opt 0x52 flag 0x3 len 52  mtu 1500 state EXCHANGE
*Mar 14 00:32:21.606: OSPF: Send DBD to 192.168.23.3 on GigabitEthernet0/3 seq 0x22DE opt 0x52 flag 0x0 len 32
*Mar 14 00:32:21.610: OSPF: Rcv DBD from 192.168.23.3 on GigabitEthernet0/3 seq 0x22DF opt 0x52 flag 0x1 len 32  mtu 1500 state EXCHANGE
*Mar 14 00:32:21.610: OSPF: Exchange Done with 192.168.23.3 on GigabitEthernet0/3
*Mar 14 00:32:21.610: OSPF: Send LS REQ to 192.168.23.3 length 12 LSA count 1
*Mar 14 00:32:21.610: OSPF: Send DBD to 192.168.23.3 on GigabitEthernet0/3 seq 0x22DF opt 0x52 flag 0x0 len 32
*Mar 14 00:32:21.610: OSPF: Rcv LS UPD from 192.168.23.3 on GigabitEthernet0/3 length 76 LSA count 1
*Mar 14 00:32:21.610: OSPF: Synchronized with 192.168.23.3 on GigabitEthernet0/3, state FULL
*Mar 14 00:32:21.610: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.3 on GigabitEthernet0/3 from LOADING to FULL, Loading Done
*Mar 14 00:32:24.574: OSPF: Rcv LS UPD from 192.168.23.3 on GigabitEthernet0/3 length 76 LSA count 1
*Mar 14 00:32:24.606: OSPF: Rcv LS UPD from 192.168.23.3 on GigabitEthernet0/3 length 60 LSA count 1
*Mar 14 00:32:26.454: OSPF: Rcv LS UPD from 192.168.23.3 on GigabitEthernet0/3 length 76 LSA count 1
*Mar 14 00:32:27.102: OSPF: Build router LSA for area 0, router ID 192.168.23.2, seq 0x80000007, process 1
*Mar 14 00:32:31.610: OSPF: Neighbor change Event on interface GigabitEthernet0/3
*Mar 14 00:32:31.610: OSPF: DR/BDR election on GigabitEthernet0/3
*Mar 14 00:32:31.610: OSPF: Elect BDR 192.168.23.2
*Mar 14 00:32:31.610: OSPF: Elect DR 192.168.23.3
*Mar 14 00:32:31.610:        DR: 192.168.23.3 (Id)   BDR: 192.168.23.2 (Id)
*Mar 14 00:32:59.074: OSPF: end of Wait on interface GigabitEthernet0/0
*Mar 14 00:32:59.074: OSPF: DR/BDR election on GigabitEthernet0/0
*Mar 14 00:32:59.074: OSPF: Elect BDR 192.168.23.2
*Mar 14 00:32:59.074: OSPF: Elect DR 192.168.23.2
*Mar 14 00:32:59.074: OSPF: Elect BDR 0.0.0.0
*Mar 14 00:32:59.074: OSPF: Elect DR 192.168.23.2
*Mar 14 00:32:59.074:        DR: 192.168.23.2 (Id)   BDR: none
*Mar 14 00:32:59.574: OSPF: No full nbrs to build Net Lsa for interface GigabitEthernet0/0
R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.23.2
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.12.0 0.0.0.255 area 0
    192.168.23.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.23.3         110      00:01:26
  Distance: (default is 110)

R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.23.2
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.12.0 0.0.0.255 area 0
    192.168.23.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.23.3         110      00:03:12
  Distance: (default is 110)

R2#sh inter br
R2#sh ip inter br
R2#sh ip inter brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES NVRAM  administratively down down
GigabitEthernet0/0         192.168.12.2    YES manual up                    up
GigabitEthernet0/1         unassigned      YES manual down                  down
GigabitEthernet0/2         unassigned      YES manual down                  down
GigabitEthernet0/3         192.168.23.2    YES manual up                    up
Loopback0                  2.2.2.2         YES manual up                    up
Loopback1                  unassigned      YES manual up                    up
R2#

R2#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.23.3      1   FULL/DR         00:00:37    192.168.23.3    GigabitEthernet0/3

Thanks & Regards,
Arindom


(Lazaros Agapides) #42

Hello Arindom

Indeed with the config as you have it set up, the router ID should become 2.2.2.2 since it is the highest loopback ID. However, 192.168.23.2 does remain the router ID even after the clear ip ospf process command.

The only thing i can think of is that you have the router ID explicitly configured in the OSPF process as 192.168.23.2 and this is why it is not changing. Please confirm that you have no configured router ID in the OSPF configuration.

If all else fails, try rebooting the device. Let us know your results.

I hope this has been helpful!

Laz


OSPF Router ID
(Arindom N) #43

HI Laz,
sorry for late reply…i went to out side for few days so didn’t reply you sorry for this…

I didn’t configure the router ID manually…i checked multiple times but why i do reboot ?
I think i didn’t any mistake but If you want to see the configuration i can show you…As i mentioned previously that if i reboot the router (which is not valid process)the ID will change or if i remove the OSPF configuration and add again(which is not valid process) then the ID will change so why the command “clear ip opsf process” is not changing the Router ID ?

Waiting for your reply…

Thanks & Regards,
Arindom


(Arindom N) #44

HI Laz,
Plz go through my steps and suggest me…sharing you for better understanding…i did tried to do LAB in GNS3 again few mintues back with 2 router(R1& R2)…topology is very simple and tried in R2 basically and shared the R1 configuration as well for your reference…

R2#sh version
Cisco IOS Software, 3700 Software (C3745-ADVIPSERVICESK9-M), Version 12.4(25d), RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2010 by Cisco Systems, Inc.
Compiled Wed 18-Aug-10 08:18 by prod_rel_team

ROM: ROMMON Emulation Microcode
ROM: 3700 Software (C3745-ADVIPSERVICESK9-M), Version 12.4(25d), RELEASE SOFTWARE (fc1)


R2#sh running-config
Building configuration...

Current configuration : 1370 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
interface Loopback0
 ip address 11.11.11.1 255.255.255.0
!
interface Loopback1
 ip address 22.22.22.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
interface Serial1/0
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/1
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/2
 no ip address
 shutdown
 serial restart-delay 0
!
interface Serial1/3
 no ip address
 shutdown
 serial restart-delay 0
!
router ospf 1
 log-adjacency-changes
 network 192.168.1.0 0.0.0.255 area 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end


R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 11.11.11.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 110)

R2#sh ip inter brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.1.2     YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  unassigned      YES unset  administratively down down
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down
Loopback0                  11.11.11.1      YES manual up                    up
Loopback1                  22.22.22.1      YES manual up                    up

R2#clear ip ospf process
Reset ALL OSPF processes? [no]: y
R2#
*Mar  1 00:09:54.095: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on FastEthernet0/0 from FULL to DOWN, Neighbor     Down: Interface down or detached
*Mar  1 00:09:54.231: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on FastEthernet0/0 from LOADING to FULL, Loadi    ng Done


R2#sh ip ospf database

            OSPF Router with ID (11.11.11.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.10.10.1      10.10.10.1      55          0x80000003 0x00090A 1
11.11.11.1      11.11.11.1      45          0x80000003 0x00DA31 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.1     10.10.10.1      55          0x80000001 0x0078F5

R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 11.11.11.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 110)

If i am trying to remove the OSPF then its working ---------------------------------

R2#conf ter
R2(config)#no router ospf 1
R2(config)#
*Mar  1 00:11:57.031: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached
R2(config)#end
R2#con
*Mar  1 00:11:59.319: %SYS-5-CONFIG_I: Configured from console by console
R2#conf ter
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router os
R2(config)#router ospf 1
R2(config-router)#network 192.168.1.0 0.0.0.255 area 0
R2(config-router)#end
R2#
*Mar  1 00:12:22.699: %SYS-5-CONFIG_I: Configured from console by console

R2#sh ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 22.22.22.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 110)


R2#sh ip ospf database

            OSPF Router with ID (22.22.22.1) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.10.10.1      10.10.10.1      60          0x80000005 0x00050C 1
22.22.22.1      22.22.22.1      59          0x80000002 0x004684 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.1.1     10.10.10.1      60          0x80000001 0x000647

I am trying to do with Router R1 & R2 so R1 configuration is very simple as well,share for your refarance------------------

R1#sh running-config
Building configuration...

Current configuration : 945 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
ip tcp synwait-time 5
!
!
!
!
no ip domain lookup
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
 ip address 10.10.10.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 duplex auto
 speed auto
!
router ospf 1
 log-adjacency-changes
 network 192.168.1.0 0.0.0.255 area 0
!
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
!
!
control-plane
!
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
line vty 0 4
 login
!
!
end

Thanks & Regards,
Arindom
India


(Pradeep M) #45

which route is chosen as best route in OSPF, if two same routes are redistributed in to OSPF by different routing protocol(say RIP and EIGRP)? will it depend on administrative distance values of external routing protocols? if so once they are redistributed by ASBR into OSPF, OSPF’s Administrative distance values for both of same routes will be same(110) …Is my understanding correct?


(Lazaros Agapides) #46

Hello Pradeep

When the same route is redistributed into OSPF from two different routing protocols, which is chosen depends on the metric. When an EIGRP route is redistributed into OSPF for example, we have to use what is called a seed metric. This is used to convert the metric of one protocol to the other. This doesn’t happen automatically, so we have to tell the router what this seed metric is in order for conversion to take place. If the same route is advertised via RIP and is redistributed into OSPF, once again, you have to state what the seed metric will be for that route. Whichever route has the lowest resulting OSPF metric will be the one that will be chosen. More on redistribution can be found here:

Now, the question is, when would we use Administrative Distance? Well AD would be used if a single router has learned about a single destination DIRECTLY from multiple routing protocols. In other words, this could only occur on routers that are running multiple routing protocols. From the point of view of OSPF, this would happen only on an ASBR where some interfaces are running OSPF and others are participating in other routing protocols. If multiple routing protocols advertise a route to the same destination, only then would the AD be used to determine which one will be installed in the routing table.

I hope this has been helpful!

Laz