Update OSPF configuration in ospf_cost_priority.md to create a new area (0.0.0.4) and adjust interface costs for prioritization. Changed all relevant interfaces from 'backbone' to 'ihor-swe-area' for consistency across HOME, MSK-IHOR, and SWE-HIPHOST setups.
This commit is contained in:
+56
-32
@@ -44,28 +44,36 @@ graph TB
|
||||
### На HOME (home.rt.shx.su):
|
||||
|
||||
```shell
|
||||
# Создать area 0.0.0.4
|
||||
/routing ospf area
|
||||
add name=ihor-swe-area instance=default area-id=0.0.0.4
|
||||
|
||||
# Настроить cost для приоритизации маршрутов
|
||||
/routing ospf interface-template
|
||||
|
||||
# IHOR (приоритетный) - низкий cost
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
|
||||
# SWE (резервный) - высокий cost
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=ihor-swe-area
|
||||
```
|
||||
|
||||
### На MSK-IHOR (msk.ihor.rt.shx.su):
|
||||
|
||||
```shell
|
||||
# Создать area 0.0.0.4
|
||||
/routing ospf area
|
||||
add name=ihor-swe-area instance=default area-id=0.0.0.4
|
||||
|
||||
# Настроить cost для туннелей к HOME
|
||||
/routing ospf interface-template
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
|
||||
# Настроить cost для туннеля к SWE
|
||||
add interfaces=gre-SWE-HIPHOST cost=10 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST cost=10 area=ihor-swe-area
|
||||
|
||||
# Статический маршрут через SWE
|
||||
/ip route
|
||||
@@ -79,13 +87,17 @@ set [ find default=yes ] redistribute=connected,static
|
||||
### На SWE-HIPHOST (swe.hiphost.rt.shx.su):
|
||||
|
||||
```shell
|
||||
# Создать area 0.0.0.4
|
||||
/routing ospf area
|
||||
add name=ihor-swe-area instance=default area-id=0.0.0.4
|
||||
|
||||
# Настроить cost для туннелей к HOME (высокий cost)
|
||||
/routing ospf interface-template
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=ihor-swe-area
|
||||
|
||||
# Настроить cost для туннеля к IHOR (низкий cost)
|
||||
add interfaces=gre-IHOR-SWE cost=10 area=backbone
|
||||
add interfaces=gre-IHOR-SWE cost=10 area=ihor-swe-area
|
||||
|
||||
# OSPF redistribute
|
||||
/routing ospf instance
|
||||
@@ -117,12 +129,12 @@ set [ find default=yes ] redistribute=connected,static
|
||||
# На HOME
|
||||
/routing ospf interface-template
|
||||
# IHOR (приоритетный)
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
|
||||
# SWE (резервный) - очень высокий cost
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=5000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=10000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=5000 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=10000 area=ihor-swe-area
|
||||
```
|
||||
|
||||
### Вариант 2: Минимальная разница
|
||||
@@ -130,12 +142,12 @@ add interfaces=gre-SWE-HIPHOST-MTS cost=10000 area=backbone
|
||||
# На HOME
|
||||
/routing ospf interface-template
|
||||
# IHOR (приоритетный)
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
|
||||
# SWE (резервный) - небольшая разница
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=100 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=200 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=100 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=200 area=ihor-swe-area
|
||||
```
|
||||
|
||||
### Вариант 3: По провайдерам
|
||||
@@ -143,12 +155,12 @@ add interfaces=gre-SWE-HIPHOST-MTS cost=200 area=backbone
|
||||
# На HOME
|
||||
/routing ospf interface-template
|
||||
# Ростелеком (основной провайдер)
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=100 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=100 area=ihor-swe-area
|
||||
|
||||
# МТС (резервный провайдер)
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=1000 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=1000 area=ihor-swe-area
|
||||
```
|
||||
|
||||
## Проверка настройки
|
||||
@@ -271,15 +283,19 @@ set [ find where interfaces=gre-MSK-IHOR-MTS ] cost=100
|
||||
|
||||
### HOME (home.rt.shx.su):
|
||||
```shell
|
||||
# Создать area 0.0.0.4
|
||||
/routing ospf area
|
||||
add name=ihor-swe-area instance=default area-id=0.0.0.4
|
||||
|
||||
# OSPF интерфейсы с приоритизацией по cost
|
||||
/routing ospf interface-template
|
||||
# IHOR (приоритетный) - низкий cost
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
|
||||
# SWE (резервный) - высокий cost
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=ihor-swe-area
|
||||
|
||||
# Routing table YouTube
|
||||
/routing table
|
||||
@@ -318,11 +334,15 @@ add dst-address=0.0.0.0/0 gateway=10.100.4.2 routing-table=YouTube distance=1
|
||||
/interface gre add name=gre-SWE-HIPHOST remote-address=<SWE_WAN_IP> local-address=<IHOR_WAN_IP>
|
||||
/ip address add address=10.200.2.1/30 interface=gre-SWE-HIPHOST
|
||||
|
||||
# Создать area 0.0.0.4
|
||||
/routing ospf area
|
||||
add name=ihor-swe-area instance=default area-id=0.0.0.4
|
||||
|
||||
# OSPF интерфейсы
|
||||
/routing ospf interface-template
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST cost=10 area=backbone
|
||||
add interfaces=gre-MSK-IHOR-RTK cost=10 area=ihor-swe-area
|
||||
add interfaces=gre-MSK-IHOR-MTS cost=100 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST cost=10 area=ihor-swe-area
|
||||
|
||||
# Статический маршрут через SWE
|
||||
/ip route
|
||||
@@ -339,11 +359,15 @@ set [ find default=yes ] redistribute=connected,static
|
||||
/interface gre add name=gre-IHOR-SWE remote-address=<IHOR_WAN_IP> local-address=<SWE_WAN_IP>
|
||||
/ip address add address=10.200.2.2/30 interface=gre-IHOR-SWE
|
||||
|
||||
# Создать area 0.0.0.4
|
||||
/routing ospf area
|
||||
add name=ihor-swe-area instance=default area-id=0.0.0.4
|
||||
|
||||
# OSPF интерфейсы
|
||||
/routing ospf interface-template
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=backbone
|
||||
add interfaces=gre-IHOR-SWE cost=10 area=backbone
|
||||
add interfaces=gre-SWE-HIPHOST-RTK cost=1000 area=ihor-swe-area
|
||||
add interfaces=gre-SWE-HIPHOST-MTS cost=2000 area=ihor-swe-area
|
||||
add interfaces=gre-IHOR-SWE cost=10 area=ihor-swe-area
|
||||
|
||||
# OSPF redistribute
|
||||
/routing ospf instance
|
||||
|
||||
Reference in New Issue
Block a user