Схема:

Исходная конфигурация:
cluster
cluster-interface bridge 10
unit 1
mac-address a2:00:00:02:00:00
exit
unit 2
mac-address a2:00:00:01:10:00
exit
enable
exit
hostname Unit-1 unit 1
hostname Unit-2 unit 2
syslog program-name
syslog console
virtual-serial
exit
vlan 10
exit
router ospf 1
router-id loopback 1
area 0.0.0.0
enable
exit
enable
exit
bridge 10
vlan 10
ip firewall disable
ip address 192.168.1.2/24 unit 1
ip address 192.168.1.3/24 unit 2
vrrp 1
ip address 192.168.1.1/24
group 10
enable
exit
no spanning-tree
enable
exit
interface gigabitethernet 1/0/1
ip firewall disable
ip address 10.0.0.1/24
ip ospf instance 1
ip ospf
exit
interface gigabitethernet 1/0/2
ip firewall disable
ip address 172.16.0.1/24
ip ospf instance 1
ip ospf
exit
interface gigabitethernet 1/0/8
mode switchport
switchport access vlan 10
exit
interface gigabitethernet 2/0/1
ip firewall disable
ip address 10.0.0.2/24
ip ospf instance 1
ip ospf
exit
interface gigabitethernet 2/0/2
ip firewall disable
ip address 172.16.0.2/24
ip ospf instance 1
ip ospf
exit
interface gigabitethernet 2/0/8
mode switchport
switchport access vlan 10
exit
interface loopback 1
ip address 1.1.1.1/24 unit 1
ip address 1.1.1.2/24 unit 2
exit |
Проблема: При настройке кластера оба юнита анонсируют два одинаковых маршрута на маршрутизатор ESR-2. В результате, при включённом ECMP на ESR-2 трафик распределяется между обоими юнитами, хотя требуется, чтобы маршруты анонсировались только от active юнита.
Решение: настроить track который будет отслеживать мастерство и на Standby будет повышать стоимость маршрутов пока не станет Active.
Данное решение доступно с версии ПО 1.37. |
В текущий момент, в таблице маршрутизации на ESR-2, мы видим два равнозначных маршрута до 10.0.0.100:
ESR-2# show ip route 10.0.0.100
Codes: C - connected, S - static, R - RIP derived,
O - OSPF derived, IA - OSPF inter area route,
E1 - OSPF external type 1 route, E2 - OSPF external type 2 route,
B - BGP derived, D - DHCP derived, K - kernel route, V - VRRP route,
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area,
H - NHRP, * - FIB route
O * 10.0.0.0/24 [150/2] multipath [ospf1 10:37:29 from 198.0.0.1] (198.0.0.1)
via 172.16.0.1 on br10 weight 1
via 172.16.0.2 on br10 weight 1 |
Создадим track для последующего управления анонсами маршрутов в кластере:
Unit-2(config)# track 1 Unit-2(config-track)# track vrrp id 1 state not master Unit-2(config-track)# enable Unit-2(config-track)# exit |
Для интерфейсов, участвующих в OSPF-маршрутизации, добавим cost который будет включаться на основе track:
Если устройство - не VRRP мастер, увеличиваем OSPF-метрику интерфейса до 200 через ip ospf cost 200, управляемое объектом track, привязанным к состоянию VRRP. |
Unit-2(config)# interface gigabitethernet 1/0/1 Unit-2(config-if-gi)# ip firewall disable Unit-2(config-if-gi)# ip address 10.0.0.1/24 Unit-2(config-if-gi)# ip ospf instance 1 Unit-2(config-if-gi)# ip ospf cost 200 track 1 Unit-2(config-if-gi)# ip ospf Unit-2(config-if-gi)# exit Unit-2(config)# interface gigabitethernet 2/0/1 Unit-2(config-if-gi)# ip firewall disable Unit-2(config-if-gi)# ip address 10.0.0.2/24 Unit-2(config-if-gi)# ip ospf instance 1 Unit-2(config-if-gi)# ip ospf cost 200 track 1 Unit-2(config-if-gi)# ip ospf Unit-2(config-if-gi)# exit |
Вывод:
В случае когда unit 1 в роли Active (Master)
Unit-1# show cluster status Unit Hostname Role MAC address State IP address ---- -------------------- ---------- ----------------- -------------- --------------- 1* Unit-1 Active a2:00:00:02:00:00 Joined 192.168.1.2 2 Unit-2 Standby a2:00:00:01:10:00 Joined 192.168.1.3 Unit-1# show vrrp Unit 1* 'Unit-1' ---------------- Virtual router Virtual IP Priority Preemption State Inherit Sync group ID -------------- --------------------------------- -------- ---------- ------ ------- ------------- 1 192.168.1.1/24 100 Enabled Master -- 10 Unit 2 'Unit-2' --------------- Virtual router Virtual IP Priority Preemption State Inherit Sync group ID -------------- --------------------------------- -------- ---------- ------ ------- ------------- 1 192.168.1.1/24 100 Enabled Backup -- 10 |
ESR-2# show ip route 10.0.0.100
Codes: C - connected, S - static, R - RIP derived,
O - OSPF derived, IA - OSPF inter area route,
E1 - OSPF external type 1 route, E2 - OSPF external type 2 route,
B - BGP derived, D - DHCP derived, K - kernel route, V - VRRP route,
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area,
H - NHRP, * - FIB route
O * 10.0.0.0/24 [150/2] via 172.16.0.1 on br10 [ospf1 10:42:56 from 198.0.0.1] (198.0.0.1) |
В случае когда unit 2 станет Active (Master)
Unit-2# show cluster status Unit Hostname Role MAC address State IP address ---- -------------------- ---------- ----------------- -------------- --------------- 1 Unit-1 Standby a2:00:00:02:00:00 Joined 192.168.1.2 2* Unit-2 Active a2:00:00:01:10:00 Joined 192.168.1.3 Unit-2# show vrrp Unit 1 'Unit-1' --------------- Virtual router Virtual IP Priority Preemption State Inherit Sync group ID -------------- --------------------------------- -------- ---------- ------ ------- ------------- 1 192.168.1.1/24 100 Enabled Backup -- 10 Unit 2* 'Unit-2' ---------------- Virtual router Virtual IP Priority Preemption State Inherit Sync group ID -------------- --------------------------------- -------- ---------- ------ ------- ------------- 1 192.168.1.1/24 100 Enabled Master -- 10 |
ESR-2# show ip route 10.0.0.100
Codes: C - connected, S - static, R - RIP derived,
O - OSPF derived, IA - OSPF inter area route,
E1 - OSPF external type 1 route, E2 - OSPF external type 2 route,
B - BGP derived, D - DHCP derived, K - kernel route, V - VRRP route,
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area,
H - NHRP, * - FIB route
O * 10.0.0.0/24 [150/2] via 172.16.0.2 on br10 [ospf1 10:47:56 from 198.0.0.1] (198.0.0.1) |