Pages

Friday, April 30, 2010

OSPF DR BDR election - GNS3


we'll configure OSPF Hub and Spokes network, on router R1 we'll use sub-interface to connect to R2 and R3. setup the network as below's configuration

R1

interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
!
interface FastEthernet0/0.2
 encapsulation dot1Q 2
 ip address 192.168.2.1 255.255.255.0
!
interface FastEthernet0/0.3
 bandwidth 100000
 encapsulation dot1Q 3
 ip address 192.168.3.1 255.255.255.0


router ospf 1
 log-adjacency-changes
 network 192.168.2.0 0.0.0.255 area 0
 network 192.168.3.0 0.0.0.255 area 0


R2

interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.2.2 255.255.255.0
 duplex auto
 speed auto


router ospf 1
 log-adjacency-changes
 network 192.168.2.0 0.0.0.255 area 0


R3
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
 bandwidth 100000
 ip address 192.168.3.3 255.255.255.0
 duplex auto
 speed auto

router ospf 1
 log-adjacency-changes
 network 192.168.3.0 0.0.0.255 area 0



for the SW2,
port 11 = dot1q
port 12 = access vlan2
port 13 = access vlan3


by default, the highest int IP address will elected as BDR, and if there's no DR yet inside that network then it'll be promoted as DR

in this case for
 network 192.168.2.X, R2 will be the DR
 network 192.168.3.X, R3 will be the DR

for the Router ID (RID), the highest IP on Loopback will win (if no Loopback then fall to highest physical address)

let's check, there's a few ways, let use this 3 command ; show ip ospf neighbor , show ip ospf interface [int number]'


*bear in mind, IF a HIGHER priority OSPF router comes online AFTER the election has taken place, it will not become DR or BDR until (at least) the DR and BDR fail.


R1#sh ip os ne


Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/DR         00:00:39    192.168.3.3     FastEthernet0/0.3
2.2.2.2           1   FULL/DR         00:00:37    192.168.2.2     FastEthernet0/0.2

3.3.3.3 and 2.2.2.2 are RID for R3 and R2, they became a DR because they have a higher priority on interface IP address (higher ip address)

R1>sh ip os int fa 0/0.2
FastEthernet0/0.2 is up, line protocol is up
  Internet Address 192.168.2.10/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 2.2.2.2, Interface address 192.168.2.2
  Backup Designated router (ID) 1.1.1.1, Interface address 192.168.2.1
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    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 4 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 2.2.2.2  (Designated Router)
  Suppress hello for 0 neighbor(s)

but this is Hub-Spokes network, Spokes should never become a DR, to make sure this we must make sure interface in Spokes never take place in the election

set the interface priority to 0, on R2 and R3

R3(config)#int fa 0/0
R3(config-if)#ip ospf priority 0

check on R1

R1>sh ip os ne

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           0   FULL/DROTHER    00:00:35    192.168.2.2     FastEthernet0/0.2
3.3.3.3           0   FULL/DROTHER    00:00:37    192.168.3.3     FastEthernet0/0.3

DROTHER mean it's not DR, and not BDR, now we looks good , but let's confirm this

on R2 or R3

R2#sh ip os int fa 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.2.2/24, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 0
  Designated Router (ID) 1.1.1.1, Interface address 192.168.2.1
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:00
  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
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 1.1.1.1  (Designated Router)
  Suppress hello for 0 neighbor(s)

now we confirm this interface will never participate in the election, because now we have no BDR in this network and this interface is the only option, and it is not taking action in the election

ok, let's prove this some more

shutdown interface on R1, to see what gonna happen to this interface

R1(config)#int fa 0/0
R1(config-if)#shut

it's gonna take sometime, by default it's 40sec after no reply then the neighbor is considered death

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:25    192.168.2.1     FastEthernet0/0
R2#sh ip os ne

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:22    192.168.2.1     FastEthernet0/0
R2#sh ip os ne

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:20    192.168.2.1     FastEthernet0/0
R2#sh ip os ne

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:12    192.168.2.1     FastEthernet0/0
R2#sh ip os ne

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:03    192.168.2.1     FastEthernet0/0
R2#sh ip os ne

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:00    192.168.2.1     FastEthernet0/0
R2#
*Mar  1 08:00:52.910: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Dead timer expired

if you keep 'show ip ospf neighbor' , you will see the increment of Dead time before it's reach 40sec and the neighbor is declared as Death

now check who is the DR 


R2#sh ip os int fa 0/0
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.2.2/24, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DROTHER, Priority 0
  No designated router on this network
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    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
  Neighbor Count is 0, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)

yes, as configured, they'll no DR since this interface is not participate in the election

1 comment: