tests: Make ospf convergence predictable by setting if priority

Added OSPF priorities to force a predictable DR/Backup router selection

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
Martin Winter 2020-11-23 23:34:51 +01:00
parent a3014b9ac7
commit 3636b6c158
No known key found for this signature in database
GPG Key ID: 05A4ECF8C0102306
32 changed files with 85 additions and 69 deletions

View File

@ -4,17 +4,16 @@ debug ospf6 neighbor
! !
interface r1-lo interface r1-lo
! !
interface r1-eth0
!
interface r1-eth1 interface r1-eth1
ipv6 ospf6 priority 10
! !
interface r1-eth2 interface r1-eth2
ipv6 ospf6 priority 10
! !
router ospf6 router ospf6
ospf6 router-id 192.168.0.1 ospf6 router-id 192.168.0.1
log-adjacency-changes log-adjacency-changes
interface r1-lo area 0.0.0.0 interface r1-lo area 0.0.0.0
interface r1-eth0 area 0.0.0.0
interface r1-eth1 area 0.0.0.0 interface r1-eth1 area 0.0.0.0
interface r1-eth2 area 0.0.0.0 interface r1-eth2 area 0.0.0.0
! !

View File

@ -2,14 +2,14 @@
"neighbors":{ "neighbors":{
"192.168.0.2":[ "192.168.0.2":[
{ {
"priority":1, "priority":5,
"state":"Full\/DR" "state":"Full\/Backup"
} }
], ],
"192.168.0.3":[ "192.168.0.3":[
{ {
"priority":1, "priority":5,
"state":"Full\/DR" "state":"Full\/Backup"
} }
] ]
} }

View File

@ -3,6 +3,16 @@ log file ospfd.log
debug ospf event debug ospf event
debug ospf zebra debug ospf zebra
! !
interface r1-eth1
ip ospf hello-interval 2
ip ospf dead-interval 10
ip ospf priority 10
!
interface r1-eth2
ip ospf hello-interval 2
ip ospf dead-interval 10
ip ospf priority 10
!
router ospf router ospf
ospf router-id 192.168.0.1 ospf router-id 192.168.0.1
log-adjacency-changes log-adjacency-changes
@ -13,11 +23,4 @@ router ospf
refresh timer 10 refresh timer 10
! !
line vty line vty
interface r1-eth1
ip ospf hello-interval 2
ip ospf dead-interval 10
!
interface r1-eth2
ip ospf hello-interval 2
ip ospf dead-interval 10
! !

View File

@ -4,17 +4,16 @@ debug ospf6 neighbor
! !
interface r2-lo interface r2-lo
! !
interface r2-eth0
!
interface r2-eth1 interface r2-eth1
ipv6 ospf6 priority 5
! !
interface r2-eth2 interface r2-eth2
ipv6 ospf6 priority 10
! !
router ospf6 router ospf6
ospf6 router-id 192.168.0.2 ospf6 router-id 192.168.0.2
log-adjacency-changes log-adjacency-changes
interface r2-lo area 0.0.0.0 interface r2-lo area 0.0.0.0
interface r2-eth0 area 0.0.0.0
interface r2-eth1 area 0.0.0.0 interface r2-eth1 area 0.0.0.0
interface r2-eth2 area 0.0.0.0 interface r2-eth2 area 0.0.0.0
! !

View File

@ -2,14 +2,14 @@
"neighbors":{ "neighbors":{
"192.168.0.1":[ "192.168.0.1":[
{ {
"priority":1, "priority":10,
"state":"Full\/Backup" "state":"Full\/DR"
} }
], ],
"192.168.0.3":[ "192.168.0.3":[
{ {
"priority":1, "priority":5,
"state":"Full\/DR" "state":"Full\/Backup"
} }
] ]
} }

View File

@ -3,6 +3,16 @@ log file ospfd.log
debug ospf event debug ospf event
debug ospf zebra debug ospf zebra
! !
int r2-eth1
ip ospf hello-interval 2
ip ospf dead-interval 10
ip ospf priority 5
!
int r2-eth2
ip ospf hello-interval 2
ip ospf dead-interval 10
ip ospf priority 10
!
router ospf router ospf
ospf router-id 192.168.0.2 ospf router-id 192.168.0.2
log-adjacency-changes log-adjacency-changes
@ -12,12 +22,5 @@ router ospf
timers throttle lsa all 0 timers throttle lsa all 0
refresh timer 10 refresh timer 10
! !
int r2-eth1
ip ospf hello-interval 2
ip ospf dead-interval 10
int r2-eth2
ip ospf hello-interval 2
ip ospf dead-interval 10
!
line vty line vty
! !

View File

@ -4,17 +4,16 @@ debug ospf6 neighbor
! !
interface r3-lo interface r3-lo
! !
interface r3-eth0
!
interface r3-eth1 interface r3-eth1
ipv6 ospf6 priority 5
! !
interface r3-eth2 interface r3-eth2
ipv6 ospf6 priority 5
! !
router ospf6 router ospf6
ospf6 router-id 192.168.0.3 ospf6 router-id 192.168.0.3
log-adjacency-changes log-adjacency-changes
interface r3-lo area 0.0.0.0 interface r3-lo area 0.0.0.0
interface r3-eth0 area 0.0.0.0
interface r3-eth1 area 0.0.0.0 interface r3-eth1 area 0.0.0.0
interface r3-eth2 area 0.0.0.0 interface r3-eth2 area 0.0.0.0
! !

View File

@ -2,14 +2,14 @@
"neighbors":{ "neighbors":{
"192.168.0.1":[ "192.168.0.1":[
{ {
"priority":1, "priority":10,
"state":"Full\/Backup" "state":"Full\/DR"
} }
], ],
"192.168.0.2":[ "192.168.0.2":[
{ {
"priority":1, "priority":10,
"state":"Full\/Backup" "state":"Full\/DR"
} }
] ]
} }

View File

@ -3,6 +3,16 @@ log file ospfd.log
debug ospf event debug ospf event
debug ospf zebra debug ospf zebra
! !
int r3-eth1
ip ospf hello-interval 2
ip ospf dead-interval 10
ip ospf priority 5
!
int r3-eth2
ip ospf hello-interval 2
ip ospf dead-interval 10
ip ospf priority 5
!
router ospf router ospf
ospf router-id 192.168.0.3 ospf router-id 192.168.0.3
log-adjacency-changes log-adjacency-changes
@ -12,12 +22,5 @@ router ospf
timers throttle lsa all 0 timers throttle lsa all 0
refresh timer 10 refresh timer 10
! !
int r3-eth1
ip ospf hello-interval 2
ip ospf dead-interval 10
int r3-eth2
ip ospf hello-interval 2
ip ospf dead-interval 10
!
line vty line vty
! !

View File

@ -8,4 +8,5 @@ router ospf
int r1-eth0 int r1-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !

View File

@ -2,7 +2,7 @@
"neighbors":{ "neighbors":{
"2.2.2.2":[ "2.2.2.2":[
{ {
"priority":1, "priority":2,
"state":"Full\/DR", "state":"Full\/DR",
"address":"10.0.1.2", "address":"10.0.1.2",
"ifaceName":"r1-eth0:10.0.1.1" "ifaceName":"r1-eth0:10.0.1.1"

View File

@ -8,8 +8,10 @@ router ospf
int r2-eth0 int r2-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !
int r2-eth1 int r2-eth1
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !

View File

@ -5,15 +5,12 @@
"priority":1, "priority":1,
"state":"Full\/Backup", "state":"Full\/Backup",
"address":"10.0.1.1", "address":"10.0.1.1",
"ifaceName":"r2-eth0:10.0.1.2", "ifaceName":"r2-eth0:10.0.1.2"
"retransmitCounter":0,
"requestCounter":0,
"dbSummaryCounter":0
} }
], ],
"3.3.3.3":[ "3.3.3.3":[
{ {
"priority":1, "priority":2,
"state":"Full\/Backup", "state":"Full\/Backup",
"address":"10.0.2.3", "address":"10.0.2.3",
"ifaceName":"r2-eth1:10.0.2.2" "ifaceName":"r2-eth1:10.0.2.2"
@ -21,7 +18,7 @@
], ],
"4.4.4.4":[ "4.4.4.4":[
{ {
"priority":1, "priority":3,
"state":"Full\/DR", "state":"Full\/DR",
"address":"10.0.2.4", "address":"10.0.2.4",
"ifaceName":"r2-eth1:10.0.2.2" "ifaceName":"r2-eth1:10.0.2.2"

View File

@ -9,4 +9,5 @@ router ospf
int r3-eth0 int r3-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !

View File

@ -10,7 +10,7 @@
], ],
"4.4.4.4":[ "4.4.4.4":[
{ {
"priority":1, "priority":3,
"state":"Full\/DR", "state":"Full\/DR",
"address":"10.0.2.4", "address":"10.0.2.4",
"ifaceName":"r3-eth0:10.0.2.3" "ifaceName":"r3-eth0:10.0.2.3"

View File

@ -8,4 +8,5 @@ router ospf
int r4-eth0 int r4-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 3
! !

View File

@ -11,7 +11,7 @@
], ],
"3.3.3.3":[ "3.3.3.3":[
{ {
"priority":1, "priority":2,
"state":"Full\/Backup", "state":"Full\/Backup",
"address":"10.0.2.3", "address":"10.0.2.3",
"ifaceName":"r4-eth0:10.0.2.4" "ifaceName":"r4-eth0:10.0.2.4"

View File

@ -8,4 +8,5 @@ router ospf
int r1-eth0 int r1-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !

View File

@ -2,7 +2,7 @@
"neighbors":{ "neighbors":{
"2.2.2.2":[ "2.2.2.2":[
{ {
"priority":1, "priority":2,
"state":"Full\/DR", "state":"Full\/DR",
"address":"10.0.1.2", "address":"10.0.1.2",
"ifaceName":"r1-eth0:10.0.1.1" "ifaceName":"r1-eth0:10.0.1.1"

View File

@ -8,8 +8,10 @@ router ospf
int r2-eth0 int r2-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !
int r2-eth1 int r2-eth1
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !

View File

@ -5,15 +5,12 @@
"priority":1, "priority":1,
"state":"Full\/Backup", "state":"Full\/Backup",
"address":"10.0.1.1", "address":"10.0.1.1",
"ifaceName":"r2-eth0:10.0.1.2", "ifaceName":"r2-eth0:10.0.1.2"
"retransmitCounter":0,
"requestCounter":0,
"dbSummaryCounter":0
} }
], ],
"3.3.3.3":[ "3.3.3.3":[
{ {
"priority":1, "priority":2,
"state":"Full\/Backup", "state":"Full\/Backup",
"address":"10.0.2.3", "address":"10.0.2.3",
"ifaceName":"r2-eth1:10.0.2.2" "ifaceName":"r2-eth1:10.0.2.2"
@ -21,7 +18,7 @@
], ],
"4.4.4.4":[ "4.4.4.4":[
{ {
"priority":1, "priority":3,
"state":"Full\/DR", "state":"Full\/DR",
"address":"10.0.2.4", "address":"10.0.2.4",
"ifaceName":"r2-eth1:10.0.2.2" "ifaceName":"r2-eth1:10.0.2.2"

View File

@ -9,4 +9,5 @@ router ospf
int r3-eth0 int r3-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !

View File

@ -10,7 +10,7 @@
], ],
"4.4.4.4":[ "4.4.4.4":[
{ {
"priority":1, "priority":3,
"state":"Full\/DR", "state":"Full\/DR",
"address":"10.0.2.4", "address":"10.0.2.4",
"ifaceName":"r3-eth0:10.0.2.3" "ifaceName":"r3-eth0:10.0.2.3"

View File

@ -8,4 +8,5 @@ router ospf
int r4-eth0 int r4-eth0
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 3
! !

View File

@ -11,7 +11,7 @@
], ],
"3.3.3.3":[ "3.3.3.3":[
{ {
"priority":1, "priority":2,
"state":"Full\/Backup", "state":"Full\/Backup",
"address":"10.0.2.3", "address":"10.0.2.3",
"ifaceName":"r4-eth0:10.0.2.4" "ifaceName":"r4-eth0:10.0.2.4"

View File

@ -8,8 +8,10 @@ router ospf
int r1-eth1 int r1-eth1
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !
int r1-eth2 int r1-eth2
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !

View File

@ -4,8 +4,8 @@
{ {
"dbSummaryCounter": 0, "dbSummaryCounter": 0,
"retransmitCounter": 0, "retransmitCounter": 0,
"priority": 1, "priority": 2,
"state": "Full/DR", "state": "Full\/DR",
"address": "10.0.1.2", "address": "10.0.1.2",
"ifaceName": "r1-eth1:10.0.1.1", "ifaceName": "r1-eth1:10.0.1.1",
"requestCounter": 0 "requestCounter": 0
@ -15,8 +15,8 @@
{ {
"dbSummaryCounter": 0, "dbSummaryCounter": 0,
"retransmitCounter": 0, "retransmitCounter": 0,
"priority": 1, "priority": 2,
"state": "Full/DR", "state": "Full\/DR",
"address": "10.0.2.3", "address": "10.0.2.3",
"ifaceName": "r1-eth2:10.0.2.1", "ifaceName": "r1-eth2:10.0.2.1",
"requestCounter": 0 "requestCounter": 0

View File

@ -8,8 +8,10 @@ router ospf
int r2-eth1 int r2-eth1
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !
int r2-eth2 int r2-eth2
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 1
! !

View File

@ -3,7 +3,7 @@
"1.1.1.1": [ "1.1.1.1": [
{ {
"priority":1, "priority":1,
"state":"Full/Backup", "state":"Full\/Backup",
"address":"10.0.1.1", "address":"10.0.1.1",
"ifaceName":"r2-eth1:10.0.1.2", "ifaceName":"r2-eth1:10.0.1.2",
"retransmitCounter":0, "retransmitCounter":0,
@ -13,8 +13,8 @@
], ],
"3.3.3.3": [ "3.3.3.3": [
{ {
"priority":1, "priority":2,
"state":"Full/DR", "state":"Full\/DR",
"address":"10.0.3.3", "address":"10.0.3.3",
"ifaceName":"r2-eth2:10.0.3.2", "ifaceName":"r2-eth2:10.0.3.2",
"retransmitCounter":0, "retransmitCounter":0,

View File

@ -8,8 +8,10 @@ router ospf
int r3-eth1 int r3-eth1
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !
int r3-eth2 int r3-eth2
ip ospf hello-interval 2 ip ospf hello-interval 2
ip ospf dead-interval 10 ip ospf dead-interval 10
ip ospf priority 2
! !

View File

@ -3,7 +3,7 @@
"1.1.1.1": [ "1.1.1.1": [
{ {
"priority":1, "priority":1,
"state":"Full/Backup", "state":"Full\/Backup",
"address":"10.0.2.1", "address":"10.0.2.1",
"ifaceName":"r3-eth1:10.0.2.3", "ifaceName":"r3-eth1:10.0.2.3",
"retransmitCounter":0, "retransmitCounter":0,
@ -14,7 +14,7 @@
"2.2.2.2": [ "2.2.2.2": [
{ {
"priority":1, "priority":1,
"state":"Full/Backup", "state":"Full\/Backup",
"address":"10.0.3.2", "address":"10.0.3.2",
"ifaceName":"r3-eth2:10.0.3.3", "ifaceName":"r3-eth2:10.0.3.3",
"retransmitCounter":0, "retransmitCounter":0,