Перейти к основному содержимому

Установка приоритета

Этот пример показывает, как установить приоритет для интерфейса. Установите высокий приоритет для маршрутизатора, чтобы сделать его назначенным маршрутизатором (Designated Router, DR). Маршрутизатор SW3 настроен с приоритетом 10, который выше, чем приоритет по умолчанию (1) у SW1 и SW2, что делает его DR.

Топология

Image

Рисунок 4-61: Установка приоритета OSPF

SW3

#configure terminalПерейти в режим конфигурации
(config)#interface eth2Перейти в режим конфигурации интерфейса.
(config-if)#ip ospf priority 10Указать приоритет маршрутизатора (10), чтобы сделать SW3 назначенным маршрутизатором (DR).
(config-if)#exitВыйти из режима конфигурации интерфейса.
(config)#router ospf 100Настроить процесс маршрутизации и указать идентификатор процесса (Process ID) (100). Идентификатор процесса должен быть уникальным положительным числом, идентифицирующим процесс маршрутизации.
(config-router)#network 10.10.10.0/24 area 0Определить интерфейс (10.10.10.0/24), на котором работает OSPF, и связать идентификатор area (0) с интерфейсом.

SW1

#configure terminalПерейти в режим конфигурации
(config)#router ospf 100Настроить процесс маршрутизации и указать идентификатор процесса (Process ID) (100). Идентификатор процесса должен быть уникальным положительным числом, идентифицирующим процесс маршрутизации.
(config-router)#network 10.10.10.0/24 area 0Определить интерфейс (10.10.10.0/24), на котором работает OSPF, и связать идентификатор area (0) с интерфейсом (идентификатор area 0 указывает на магистральную area).

SW2

#configure terminalПерейти в режим конфигурации
(config)#router ospf 200Настроить процесс маршрутизации и указать идентификатор процесса (Process ID) (200). Идентификатор процесса должен быть уникальным положительным числом, идентифицирующим процесс маршрутизации.
(config-router)#network 10.10.10.0/24 area 0Определить интерфейс (10.10.10.0/24), на котором работает OSPF, и связать идентификатор area (0) с интерфейсом.
Проверка

SW1

#sh ip ospf neighbor
Total number of full neighbors: 2 OSPF process 100 VRF(default):
Neighbor ID     Pri   State            Dead Time   Address         Interface
Instance ID
10.12.26.89       1   Full/DROther     00:00:39    10.10.10.11     eth2                    0
10.12.26.90      10   Full/DR          00:00:32    10.10.10.13     eth2                    0
#sh ip ospf interface
eth2 is up, line protocol is up
Internet Address 10.10.10.10/24, Area 0.0.0.0, MTU 1500
Process ID 100, VRF (default), Router ID 10.12.26.88, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec,  State Backup, Priority 1, TE Metric 1
Designated Router (ID) 10.12.26.90, Interface Address 10.10.10.13
Backup Designated Router (ID) 10.12.26.88, Interface Address 10.10.10.10
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:10
Neighbor Count is 2, Adjacent neighbor count is 2
Suppress hello for 0 neighbor(s)
Hello received 30 sent 19, DD received 6 sent 8
LS-Req received 2 sent 2, LS-Upd received 16 sent 6
LS-Ack received 8 sent 7, Discarded 0
No authentication
#sh running-config
!
no service password-encryption
!
hostname rtr1
!
logging monitor 7
!
ip vrf management
!
ip domain-lookup
!
ip pim register-rp-reachability
!
interface lo
mtu 65536
ip address 127.0.0.1/8
ipv6 address ::1/128
!
interface eth0
ip address 10.12.26.88/24
!
interface eth1
!
interface eth2
ip address 10.10.10.10/24
!
interface eth3
!
interface eth4
!
interface eth5
!
interface eth6
!
interface eth7
!
router ospf 100
network 10.10.10.0/24 area 0.0.0.0
cspf disable-better-protection
!
line con 0
login line vty 0 39
login
!
end

SW2

#sh running-config
!
no service password-encryption
!
hostname SW2
!
logging monitor 7
!
ip vrf management
!
ip domain-lookup
!
ip pim register-rp-reachability
!
interface lo
mtu 65536
ip address 127.0.0.1/8
ipv6 address ::1/128
!
interface eth0
ip address 10.12.26.89/24
!
interface eth1
!
interface eth2
ip address 10.10.10.11/24
!
interface eth3
!
interface eth4
!
interface eth5
!
interface eth6
!
router ospf 200
network 10.10.10.0/24 area 0.0.0.0
cspf disable-better-protection
!
line con 0
login line vty 0 39
login
!
end
#sh ip ospf neighbor
Total number of full neighbors: 2 OSPF process 200 VRF(default):
Neighbor ID     Pri   State            Dead Time   Address         Interface           Instance ID
10.12.26.88       1   Full/Backup      00:00:30    10.10.10.10     eth2                    0
10.12.26.90      10   Full/DR          00:00:31    10.10.10.13     eth2                    0
SW2#
SW2#sh ip ospf interface eth2 is up, line protocol is up
Internet Address 10.10.10.11/24, Area 0.0.0.0, MTU 1500
Process ID 200, VRF (default), Router ID 10.12.26.89, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec,  State DROther, Priority 1, TE Metric 1
Designated Router (ID) 10.12.26.90, Interface Address 10.10.10.13
Backup Designated Router (ID) 10.12.26.88, Interface Address 10.10.10.10
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:08
Neighbor Count is 2, Adjacent neighbor count is 2
Suppress hello for 0 neighbor(s)
Hello received 71 sent 36, DD received 7 sent 7
LS-Req received 2 sent 2, LS-Upd received 9 sent 4
LS-Ack received 3 sent 4, Discarded 1   No authentication

SW3

#sh running-config
!
no service password-encryption
!
hostname SW3
!
logging monitor 7
!
ip vrf management
!
ip domain-lookup
spanning-tree mode provider-rstp
data-center-bridging enable
ethernet cfm enable
!
interface lo
mtu 65536
ip address 127.0.0.1/8
ipv6 address ::1/128
!
interface eth0
ip address 10.12.26.90/24
!
interface eth1
!
interface eth2
ip address 10.10.10.13/24
ip ospf priority 10
!
interface eth3
!
interface eth4
!
interface eth5
!
interface eth6
!
router ospf 100
network 10.10.10.0/24 area 0.0.0.0
cspf disable-better-protection
!
line con 0
login line vty 0 39
login
!
end
#sh ip ospf neighbor
Total number of full neighbors: 2 OSPF process 100 VRF(default):
Neighbor ID     Pri   State            Dead Time   Address         Interface
Instance ID
10.12.26.88       1   Full/Backup      00:00:33    10.10.10.10     eth2                    0
10.12.26.89       1   Full/DROther     00:00:30    10.10.10.11     eth2                    0
#sh ip ospf interface
eth2 is up, line protocol is up
Internet Address 10.10.10.13/24, Area 0.0.0.0, MTU 1500
Process ID 100, VRF (default), Router ID 10.12.26.90, Network Type BROADCAST, Cost: 1
Transmit Delay is 1 sec,  State DR, Priority 10, TE Metric 1
Designated Router (ID) 10.12.26.90, Interface Address 10.10.10.13
Backup Designated Router (ID) 10.12.26.88, Interface Address 10.10.10.10
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:05
Neighbor Count is 2, Adjacent neighbor count is 2
Suppress hello for 0 neighbor(s)
Hello received 99 sent 60, DD received 8 sent 6
LS-Req received 2 sent 2, LS-Upd received 9 sent 12
LS-Ack received 9 sent 6, Discarded 1
No authentication