router eigrp 1
#запущен процесс маршрутизации EIGRP 1
network 10.0.0.0
#Маршрутизировать все сети, подключенные к этому маршрутизаторы с
адресами, попадающими в диапазон 10.0.0.0/8.
no auto-summary
#отключить автоматическую суммаризацию.
ip cef
#включена коммутация Cisco Express Forwarding
Current configuration : 1122 bytes
!
version 12.3
!
hostname Router_B
!
ip cef
no tag-switching ip
!
interface Loopback0
ip address 10.108.254.45 255.255.255.255
!
interface FastEthernet0/0
ip address 10.18.1.1 255.255.255.0
!
interface Serial0/0:0
description Router_C
ip address 10.108.253.190 255.255.255.252
!
interface Serial0/1:0
description Router_A
ip address 10.108.253.201 255.255.255.252
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
end
Router_B(config)# mpls ip
Router_B#show debug
MPLS:
MPLS events debugging is on
LFIB data structure changes debugging is on
LFIB enable/disable state debugging is on
MPLS adjacency debugging is on
MPLS ldp:
LDP Label Information Base (LIB) changes debugging is on
LDP received messages, excluding periodic Keep Alives debugging is on
LDP sent PDUs, excluding periodic Keep Alives debugging is on
LDP transport events debugging is on
LDP transport connection events debugging is on
LDP session state machine (low level) debugging is on
Router_B(config)#interface Serial0/0:0
Router_B(config-if)#tag-switching ip
01:32:07: mpls: Add mpls app; Serial0/0:0
01:32:07: mpls: Add mpls app; Serial0/0:0
01:32:07: mpls: Add mpls app; i/f status change; Serial0/0:0
01:32:07: ldp: enabling ldp on Serial0/0:0
#Подготовка к запуску MPLS01:32:07: LFIB: enable entered, table does not exist,enabler type=0x1
01:32:07: LFIB: enable, TFIB allocated, size 6032 bytes, maxtag = 500
#База LFIB создана01:32:07: tib: find route tags: 10.18.1.0/24, Fa0/0, nh 0.0.0.0, res nh 0.0.0.0
01:32:07: tagcon: tibent(10.18.1.0/24): created; find route tags request
01:32:07: tagcon: tibent(10.18.1.0/24): label 1 (#2) assigned
01:32:07: tagcon: announce labels for: 10.18.1.0/24; nh 0.0.0.0, Fa0/0,inlabel imp-null,
outlabel unknown (from 0.0.0.0:0), find route tags
01:32:07: tib: find route tags: 10.108.253.188/30, Se0/0:0, nh 0.0.0.0, res nh 0.0.0.0
01:32:07: tagcon: tibent(10.108.253.188/30): created; find route tags request
01:32:07: tagcon: tibent(10.108.253.188/30): label 1 (#4) assigned
01:32:07: tagcon: announce labels for: 10.108.253.188/30; nh 0.0.0.0, Se0/0:0, inlabel imp-null
outlabel unknown (from 0.0.0.0:0), find route tags
01:32:07: tib: find route tags: 10.108.253.200/30, Se0/1:0, nh 0.0.0.0, res nh 0.0.0.0
01:32:07: tagcon: tibent(10.108.253.200/30): created; find route tags request
01:32:07: tagcon: tibent(10.108.253.200/30): label 1 (#6) assigned
01:32:07: tagcon: announce labels for: 10.108.253.200/30; nh 0.0.0.0, Se0/1:0, inlabel imp-null,
outlabel unknown (from 0.0.0.0:0), find route tags
01:32:07: tib: find route tags: 10.108.254.40/32, Se0/0:0, nh 10.108.253.189, res nh 10.108.253.189
01:32:07: tagcon: tibent(10.108.254.40/32): created; find route tags request
01:32:07: tagcon: tibent(10.108.254.40/32): label 16 (#8) assigned
#Маршрутизатор начинает расставлять локальные метки на маршруты
находящиеся в таблице маршрутизации01:32:07: mpls: Enable MPLS forwarding on Serial0/0:0
01:32:07: ldp: enabling ldp on Serial0/0:0
#После привязки меток маршрутизатор готов к работе по MPLS на
интерфейсе Serial0/0:0. Стартует LDP/TDP.01:32:07: ldp: Got LDP Id, ctx 0
01:32:07: ldp: LDP Hello process inited
01:32:07: ldp: Start MPLS discovery Hellos for Serial0/0:0
01:32:07: ldp: Got TDP UDP socket for port 711
01:32:07: ldp: Got LDP UDP socket for port 646
#Как видно из сообщений IOS открывает порты для обоих протоколов
распространения меток, внезависимости от значения команды mpls label
protocol. И разумеется первыми исходят сообщения Hello.01:32:07: ldp: Send tdp hello; Serial0/0:0, src/dst 10.108.253.190/255.255.255.255, inst_id 0
01:32:08: ldp: Ignore Hello from 10.108.253.202, Serial0/1:0; no intf
#Хотя на интерфейсе Serial0/1:0 у нас находится маршрутизатор, готовый
работать по MPLS, на этом интерфейсе у нас не разрешен MPLS, поэтому
пакеты LDP/TDP игнорируются01:32:09: ldp: Rcvd tdp hello; Serial0/0:0, from 10.108.253.189 (10.108.254.40:0), intf_id 0, opt 0x4
#Ура сосед ответил01:32:09: ldp: tdp Hello from 10.108.253.189 (10.108.254.40:0) to 255.255.255.255, opt 0x4
01:32:09: ldp: New adj 0x82EA0510 for 10.108.254.40:0, Serial0/0:0
#Обнаружен новый сосед с ID 10.108.254.40 на Serial 0/0:001:32:09: ldp: adj_addr/xport_addr 10.108.253.189/10.108.254.40
01:32:09: ldp: local idb = Serial0/0:0, holdtime = 15000, peer 10.108.253.189 holdtime = 15000
01:32:09: ldp: Link intvl min cnt = 2, intvl = 5000, idb = Serial0/0:0
01:32:09: ldp: Opening tdp conn; adj 0x82EA0510, 10.108.254.45 <-> 10.108.254.40; with normal priority
#Оба маршрутизатора обменялись своими ID и устанавливают соединение по
TDP01:32:09: ldp: ptcl_adj:10.108.253.189(0x82EA0A60): Non-existent -> Opening Xport
01:32:09: ldp: create ptcl_adj: tp = 0x82EA0A60, ipaddr = 10.108.253.189
01:32:09: ldp: ptcl_adj:10.108.253.189(0x82EA0A60): Event: Xport opened;
Opening Xport -> Init sent
01:32:09: ldp: tdp conn is up; adj 0x82EA0510, 10.108.254.45:11000 <-> 10.108.254.40:711
01:32:09: ldp: Sent open PIE to 10.108.254.40 (pp 0x0)
01:32:09: ldp: Rcvd open PIE from 10.108.254.40 (pp 0x0)
01:32:09: ldp: ptcl_adj:10.108.253.189(0x82EA0A60): Event: Rcv Init;
Init sent -> Init rcvd actv
01:32:09: ldp: Rcvd keep_alive PIE from 10.108.254.40:0 (pp 0x0)
01:32:09: ldp: ptcl_adj:10.108.253.189(0x82EA0A60): Event: Rcv KA;
Init rcvd actv -> Oper
01:32:09: tagcon: Assign peer id; 10.108.254.40:0: id 0
01:32:09: %LDP-5-NBRCHG: TDP Neighbor 10.108.254.40:0 is UP
#Маршрутизаторы договорились между собой, установили соседские
отношения и теперь информацию о соседе можно получить, выполнив команду
show mpls ldp neighbor01:32:09: ldp: Sent address PIE to 10.108.254.40:0 (pp 0x82EA0C10)
01:32:09: ldp: Sent bind PIE to 10.108.254.40:0 (pp 0x82EA0C10)
#PIE это protocol information element, если я правильно понял это у нас
теперь так пакет с данным называется01:32:09: ldp: Rcvd address PIE from 10.108.254.40:0 (pp 0x82EA0C10)
01:32:09: tagcon: 10.108.254.40:0: 10.108.254.40 added to addr<->ldp ident map
01:32:09: tagcon: 10.108.254.40:0: 10.108.253.189 added to addr<->ldp ident map
01:32:09: ldp: Rcvd bind PIE from 10.108.254.40:0 (pp 0x82EA0C10)
01:32:09: tagcon: tibent(10.108.253.188/30): label imp-null from 10.108.254.40:0 added
#Получаем метки от соседа и передаем их в LFIB01:32:09: tib: Not OK to announce label; nh 0.0.0.0 not bound to 10.108.254.40:0
01:32:09: tagcon: omit announce labels for: 10.108.253.188/30; nh 0.0.0.0, Se0/0:0,
from 10.108.254.40:0: add rem binding: connected route
01:32:09: tagcon: tibent(10.108.254.40/32): label imp-null from 10.108.254.40:0 added
01:32:09: tagcon: announce labels for: 10.108.254.40/32; nh 10.108.253.189, Se0/0:0,
inlabel 16, outlabel imp-null (from 10.108.254.40:0), add rem binding
01:32:09: LFIB: set loadinfo,tag=16,no old loadinfo,no new loadinfo
01:32:09: LFIB: delete tag rew, incoming tag 16
01:32:09: LFIB: create tag rewrite: inc 16,outg Imp_null
-------------------------------------------------
01:32:09: tagcon: tibent(10.108.254.39/32): label 19 from 10.108.254.40:0 added
01:32:09: tib: Not OK to announce label; nh 10.108.253.202 not bound to 10.108.254.40:0
01:32:09: tagcon: omit announce labels for: 10.108.254.39/32; nh 10.108.253.202, Se0/1:0,
from 10.108.254.40:0: add rem binding: next hop = 10.108.253.202
01:32:11: ldp: Send tdp hello; Serial0/0:0, src/dst 10.108.253.190/255.255.255.255, inst_id 0
01:32:13: ldp: Rcvd tdp hello; Serial0/0:0, from 10.108.253.189 (10.108.254.40:0), intf_id 0, opt 0x4
01:32:15: ldp: Send tdp hello; Serial0/0:0, src/dst 10.108.253.190/255.255.255.255, inst_id 0
01:32:17: ldp: Rcvd tdp hello; Serial0/0:0, from 10.108.253.189 (10.108.254.40:0), intf_id 0, opt 0x4g
#Процесс установления соседских отношений завершен, обмен необходимой
информацией закончен и маршрутизаторы обмениваются пакетами HelloRouter_B(config)#interface Serial0/1:0
Router_B(config-if)# tag-switching ip
Router_B#show mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Pop tag 10.108.254.40/32 214 Se0/0:0 point2point
17 Pop tag 10.108.254.39/32 170 Se0/1:0 point2point
Router_B#
Router_B#show mpls ip binding
10.108.254.39/32
in label: 17
out label: imp-null lsr: 10.108.254.39:0 inuse
10.108.254.40/32
in label: 16
out label: imp-null lsr: 10.108.254.40:0 inuse
10.108.254.254/32 (no route)
in label: 20
out label: 17 lsr: 10.108.254.39:0
out label: 17 lsr: 10.108.254.40:0
Router_B#
Router_B#show mpls ldp bindings
tib entry: 10.108.254.39/32, rev 12
local binding: tag: 17
remote binding: tsr: 10.108.254.40:0, tag: 19
remote binding: tsr: 10.108.254.39:0, tag: imp-null
tib entry: 10.108.254.40/32, rev 8
local binding: tag: 16
remote binding: tsr: 10.108.254.40:0, tag: imp-null
remote binding: tsr: 10.108.254.39:0, tag: 19
Router_B#
Router_B#show mpls ldp bindings
tib entry: 10.108.254.39/32, rev 12
local binding: tag: 17
remote binding: tsr: 10.108.254.40:0, tag: 19
remote binding: tsr: 10.108.254.39:0, tag: exp-null
tib entry: 10.108.254.40/32, rev 8
local binding: tag: 16
remote binding: tsr: 10.108.254.40:0, tag: exp-null
remote binding: tsr: 10.108.254.39:0, tag: 19
Router_B#
Router_C#show mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Pop tag 10.108.253.200/30 0 Se0/1:0 point2point
17 Pop tag 10.108.254.45/32 0 Se0/1:0 point2point
18 Pop tag 10.18.1.0/24 0 Se0/1:0 point2point
19 17 10.108.254.39/32 0 Se0/1:0 point2point
Router_C#
Router_A#show mpls forwarding-table
Local Outgoing Prefix Bytes tag Outgoing Next Hop
tag tag or VC or Tunnel Id switched interface
16 Pop tag 10.108.253.188/30 0 Se0/0:0 point2point
17 Pop tag 10.108.254.45/32 0 Se0/0:0 point2point
18 Pop tag 10.18.1.0/24 0 Se0/0:0 point2point
19 16 10.108.254.40/32 0 Se0/0:0 point2point
Router_A#
Router_B#show mpls ldp neighbor
Peer TDP Ident: 10.108.254.40:0; Local TDP Ident 10.108.254.45:0
TCP connection: 10.108.254.40.711 - 10.108.254.45.11004
State: Oper; PIEs sent/rcvd: 8/8; Downstream
Up time: 00:03:25
TDP discovery sources:
Serial0/0:0, Src IP addr: 10.108.253.189
Addresses bound to peer TDP Ident:
10.108.254.40 10.108.253.189
Описание полей выводе данной команды приведено в таблице.
Поле |
Описание
|
---|---|
Peer TDP Ident |
идентификатор соседа |
Local TDP Ident |
идентификатор маршрутизатора |
TCP connection |
содержит информацию о соединении
TCP между локальным маршрутизатором и соседом |
State |
состояние соединения,
кратковременно может менять свое значение на отличные от Oper
(Operational) |
Downstream |
тип обмена метками, может быть
Downstream, как сейчас и Downstream on demand |
Uptime |
время существования сессии |
PIEs sent/rcvd |
количество переданных пакетов. В
случае протокола LDP название этого поля будет изменено на Msgs
sent/rcvd |
TDP discovery sources |
информацию через какой интерфейс
доступен сосед и какой у него IP адрес. Addresses bound to peer TDP
Ident: известные адреса для этой TDP/LDP сессии. Информация об этих
адресах берется из LFIB |
Router_B#show mpls ldp parameters
Protocol version: 1
Downstream label generic region: min label: 16; max label: 100000
Session hold time: 180 sec; keep alive interval: 60 sec
Discovery hello: holdtime: 15 sec; interval: 5 sec
Discovery targeted hello: holdtime: 90 sec; interval: 10 sec
Downstream on Demand max hop count: 255
TDP for targeted sessions
LDP initial/maximum backoff: 15/120 sec
LDP loop detection: off
Router_B#
Router_A(config)# ip vrf vpn_1
Назначим Route Distinguisher:Router_A(config-vrf)# rd 1:1
Можно RD конфигурировать одним из двух форматов:Router_A(config-vrf)# route-target export 1:1
Router_A(config-vrf)# route-target import 1:1
Подход к формированию значения RT такой же, как и к RD.Router_A(config)# interface FastEthernet0/1
Router_A(config-interface)# ip vrf forwarding vpn_1
Так как при связывание интерфейса с vrf удаляется адрес интерфейса (о
чем IOS радостно сообщает) назначаем интерфейсу адрес:Router_A(config-interface)# ip address 10.112.12.1 255.255.255.0
Теперь можно посмотреть таблицу маршрутизации vrf vpn_1, используя
команду show ip route vrf vpn_1:Router_A# show ip route vrf vpn_1
Routing Table: vpn_1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 4 masks
C 10.112.12.0/24 is directly connected, FastEthernet0/1
Router_A#
Таким же образом настраиваем остальные интерфейсы.Router_A(config)#router bgp 1
Назначаем идентификатор для BGP. Обычно это, как в примере, адрес
интерфейса Loopback0:Router_A(config-router)# bgp router-id 10.108.254.39
Отключаем одноадресатные аносы префиксов протокола IPv4. Теперь BGP
будет переносить только информацию о VRF:Router_A(config-router)# no bgp default ipv4-unicast
Описываем соседа по протоколу BGP. IP адрес 10.108.254.40 принадлежит
маршрутизатору Router_C на котором будет настроен рефлектор маршрутной
информации. Настройка рефлектора маршрутной информации будет
рассмотрена ниже, а на этом этапе рассмотрим вариант точка-точка:Router_A(config-router)# neighbor 10.108.254.40 remote-as 1
Посылать пакеты будем от имени Loopback0:Router_A(config-router)# neighbor 10.108.254.40 update-source Loopback0
Поднимаемся в режим конфигурирования VPN:Router_A(config-router)# address-family vpnv4
Разрешаем обмен информацией с соседом 10.108.254.40:Router_A(config-router-af)# neighbor 10.108.254.40 activate
Разрешаем рассылку только расширенных атрибутов BGP:Router_A(config-router-af)# neighbor 10.108.254.40 send-community extended
При настройке маршрутизатора Router_C мы получим следующую конфигурацию:Router_C#show running-config
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
!
ip cef
!
interface Loopback0
ip address 10.108.254.40 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding vpn_1
ip address 10.17.1.1 255.255.255.0
!
interface Serial0/0:0
description Router_G
ip address 10.108.253.185 255.255.255.252
tag-switching ip
!
!
interface Serial0/1:0
description Router_B
ip address 10.108.253.189 255.255.255.252
tag-switching ip
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
address-family ipv4 vrf vpn_1
redistribute bgp 1 metric 1000 1000 1 255 1500
network 10.0.0.0
no auto-summary
autonomous-system 3
exit-address-family
!
!
router bgp 1
bgp router-id 10.108.254.40
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.39 remote-as 1
neighbor 10.108.254.39 update-source Loopback0
!
address-family vpnv4
neighbor 10.108.254.39 activate
neighbor 10.108.254.39 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_1
redistribute eigrp 3
no auto-summary
no synchronization
exit-address-family
!
!
end
После ввода команды neighbor 10.108.254.39 send-community extended не
стоит удивляться отсутствию каких либо изменений в таблице
маршрутизации vrf vpn_1. Протокол BGP торопливостью не отличается и на
данном полигоне время, затрачиваемое на обмен маршрутной информацией,
доходило до 15 секунд.router bgp 1
#запускаем процесс маршрутизации BGP для автономной системы 1. bgp router-id 10.108.254.40
#назначаем идентификатор маршрутизатора для протокола BGP no bgp default ipv4-unicast
#Отключаем передачу одноадресатных анонсов протокола IPv4. Сейчас BGP
будет переносить информацию только о VPNах. bgp log-neighbor-changes
neighbor clients peer-group
#Объявляем группу соседей clients neighbor clients remote-as 1
#Объявляем, что члены группы clients принадлежат автономной системе 1. neighbor clients update-source Loopback0
#Весь обмен с членами группы clients будет происходить от адреса
интерфейса Loopback0 neighbor 10.108.253.252 peer-group clients
#10.108.253.252 объявляется членом группы clients neighbor 10.108.254.39 peer-group clients
neighbor 10.108.254.45 peer-group clients
neighbor 10.108.254.254 peer-group clients
!
address-family vpnv4
neighbor clients activate
#Объявляется группа clients neighbor clients route-reflector-client
#Для всех членов группы clients маршрутизатор Rooter_C является
отражателем маршрутной информации neighbor clients send-community extended
#Разрешить посылать расширенные атрибуты членам группы clients neighbor 10.108.253.252 peer-group clients
neighbor 10.108.254.39 peer-group clients
neighbor 10.108.254.45 peer-group clients
neighbor 10.108.254.254 peer-group clients
exit-address-family
!
address-family ipv4 vrf vpn_1
#Настройка BGP для vpn_1
redistribute eigrp 3
#передавать информацию о маршрутах vpn_1 в процесс EIGRP 3 no auto-summary
no synchronization
exit-address-family
!
address-family ipv4 vrf vpn_3
redistribute eigrp 2
no auto-summary
no synchronization
exit-address-family
!
Router_A#show ip bgp vpnv4 all
BGP table version is 346, local router ID is 10.108.254.39
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:1 (default for vrf vpn_1)
*>i10.1.1.2/32 10.108.254.254 0 100 0 ?
*>i10.17.1.0/24 10.108.254.40 0 100 0 ?
*>i10.18.1.0/24 10.108.254.45 0 100 0 ?
r>i10.108.213.64/26 10.108.254.40 2172416 100 0 ?
r>i10.108.214.64/26 10.108.254.45 2172416 100 0 ?
r>i10.108.253.5/32 10.108.254.254 0 100 0 ?
r>i10.108.253.192/30 10.108.254.40 0 100 0 ?
r>i10.108.253.204/30 10.108.254.45 0 100 0 ?
r>i10.108.254.46/32 10.108.254.45 2297856 100 0 ?
*> 10.111.1.0/24 0.0.0.0 0 32768 ?
*> 10.112.12.0/24 0.0.0.0 0 32768 ?
r>i11.5.5.5/32 10.108.253.252 65 100 0 ?
r>i11.110.254.36/30 10.108.253.252 0 100 0 ?
r>i12.108.253.4/30 10.108.254.254 0 100 0 ?
Присутствие в Status Code значение r указывает на наличие маршрута в
таблице BGP при отсутствии его в таблице маршрутизации VRF.
Рассмотрение причин этого явления выходит за рамки этой статьи.Router_A(config)#router eigrp 1
Объявляем семейств адресов vrf vpn_1:Router_A(config-router)#address-family ipv4 vrf vpn_1
Разрешаем перераспределять маршруты из BGP в EIGRP, без указания
метрики EIGRP будем назначать полученным маршрутам метрику infinity, то
есть бесконечность:Router_A(config-router-af)# redistribute bgp 1 metric 1000 1000 1 255 1500
Router_A(config-router-af)# network 10.0.0.0
Router_A(config-router-af)# no auto-summary
Указываем номер автономной системы для процесса маршрутизации для vrf
vpn_1:Router_A(config-router-af)# autonomous-system 3
Router_A(config)#router bgp 1
Объявлем семейство адресов vpn_1 для bgp:Router_A(config-router)#address-family ipv4 vrf vpn_1
Настраиваем обмен маршрутов в MP-BGP:Router_A(config-router-af)#redistribute eigrp 3
Router_A(config-router-af)#no auto-summary
Отключаем синхронизацию:Router_A(config-router-af)#no synchronization
hostname Router_M
!
ip cef
!
interface fastethernet0/2
ip address 10.111.1.3 255.255.255.0
!
router eigrp 3
network 10.111.0.0 0.0.255.255
auto-summary
!
end
!
hostname Router_B
!
ip vrf vpn_3
rd 1003:1003
route-target export 1003:1003
route-target import 1003:1003
!
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
!
ip cef
!
interface Loopback0
ip address 10.108.254.45 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding vpn_1
ip address 10.18.1.1 255.255.255.0
!
interface Serial0/0:0
ip address 10.108.253.190 255.255.255.252
tag-switching ip
!
interface Serial0/1:0
ip address 10.108.253.201 255.255.255.252
tag-switching ip
!
interface Serial0/2
description Router_D
ip vrf forwarding vpn_3
ip address 10.108.253.205 255.255.255.252
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
address-family ipv4 vrf vpn_1
redistribute bgp 1 metric 1000 1000 1 255 1500
network 10.0.0.0
no auto-summary
autonomous-system 3
exit-address-family
!
address-family ipv4 vrf vpn_3
redistribute bgp 1 metric 1000 1000 1 255 1500
network 10.0.0.0
no auto-summary
autonomous-system 2
exit-address-family
!
router bgp 1
bgp router-id 10.108.254.45
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.40 remote-as 1
neighbor 10.108.254.40 update-source Loopback0
!
address-family vpnv4
neighbor 10.108.254.40 activate
neighbor 10.108.254.40 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_1
redistribute eigrp 3
no auto-summary
no synchronization
exit-address-family
!
address-family ipv4 vrf vpn_3
redistribute eigrp 2
no auto-summary
no synchronization
exit-address-family
!
end
Router_C#show running-config
!
ip vrf vpn_3
rd 1003:1003
route-target export 1003:1003
route-target import 1003:1003
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
!
ip cef
!
interface Loopback0
ip address 10.108.254.40 255.255.255.255
!
interface FastEthernet0/0
ip vrf forwarding vpn_1
ip address 10.17.1.1 255.255.255.0
!
interface Serial0/0:0
description Router_G
ip address 10.108.253.185 255.255.255.252
tag-switching ip
!
!
interface Serial0/1:0
description Router_B
ip address 10.108.253.189 255.255.255.252
tag-switching ip
!
interface Serial0/2
description Router_K
ip vrf forwarding vpn_3
ip address 10.108.253.193 255.255.255.252
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
address-family ipv4 vrf vpn_1
redistribute bgp 1 metric 1000 1000 1 255 1500
network 10.0.0.0
no auto-summary
autonomous-system 3
exit-address-family
!
address-family ipv4 vrf vpn_3
redistribute bgp 1 metric 1000 1000 1 255 1500
network 10.0.0.0
no auto-summary
autonomous-system 2
exit-address-family
!
router bgp 1
bgp router-id 10.108.254.40
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.39 remote-as 1
neighbor 10.108.254.39 update-source Loopback0
!
address-family vpnv4
neighbor 10.108.254.39 activate
neighbor 10.108.254.39 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_1
redistribute eigrp 3
no auto-summary
no synchronization
exit-address-family
!
!
address-family ipv4 vrf vpn_3
redistribute eigrp 2
no auto-summary
no synchronization
exit-address-family
!
end
!
hostname Router_B
!
ip vrf vpn_3
rd 1003:1003
route-target export 1003:1003
route-target import 1003:1003
route-target import 1:1
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
route-target import 1003:1003
!
end
!
hostname Router_C
!
ip vrf vpn_3
rd 1003:1003
route-target export 1003:1003
route-target import 1003:1003
route-target import 1:1
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
route-target import 1003:1003
!
end
Router_F#show running-config
!
hostname Router_F
!
ip vrf vpn_2
rd 100:100
route-target export 100:100
route-target import 100:100
!
interface Loopback0
ip address 10.108.254.254 255.255.255.255
!
interface Loopback1
ip vrf forwarding vpn_2
ip address 10.1.1.2 255.255.255.255
!
interface Loopback3
ip vrf forwarding vpn_2
ip address 10.108.253.5 255.255.255.255
!
interface Serial0/0:0
description Router_G
ip address 10.111.3.13 255.255.255.252
tag-switching ip
!
interface Serial0/1:0
description Router_I
ip address 10.108.253.1 255.255.255.252
tag-switching ip
!
interface Serial0/2:0
description Router_A
ip address 10.108.253.170 255.255.255.252
tag-switching ip
!
interface Serial1/0
description Router_J
ip vrf forwarding vpn_2
ip address 12.108.253.5 255.255.255.252
!
router eigrp 1
redistribute static
network 10.0.0.0
no auto-summary
!
router ospf 2 vrf vpn_2
#Настраиваем перераспределение маршрутов. Рекомендуется жестко
устанавливать ID OSPF командой router-id a.b.c.d. redistribute bgp 1 metric 20 subnets
network 10.0.0.0 0.255.255.255 area 4
network 12.108.253.4 0.0.0.3 area 0
!
#Для BGP настройка отличается только в настройке перераспределения
маршрутов.router bgp 1
bgp router-id 10.108.254.254
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.40 remote-as 1
neighbor 10.108.254.40 update-source Loopback0
!
address-family vpnv4
neighbor 10.108.254.40 activate
neighbor 10.108.254.40 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_2
redistribute ospf 2 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
end
Router_I#show running-config
!
hostname Router_I
!
ip vrf vpn_2
rd 100:100
route-target export 100:100
route-target import 100:100
!
interface Loopback0
ip address 10.108.253.252 255.255.255.255
no clns route-cache
!
interface FastEthernet0/0
ip vrf forwarding vpn_2
ip address 11.11.11.1 255.255.255.0
!
interface Serial0/0:0
description Router_C
ip address 10.108.253.186 255.255.255.252
tag-switching ip
!
interface Serial0/1:0
description Router_G
ip address 10.111.3.18 255.255.255.252
tag-switching ip
!
interface Serial0/2:0
description Router_F
ip address 10.108.253.2 255.255.255.252
tag-switching ip
!
interface Serial2/0
description Router_L
ip vrf forwarding vpn_2
ip address 11.110.254.37 255.255.255.252
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
router ospf 2 vrf vpn_2
log-adjacency-changes
redistribute bgp 1 metric 20 subnets
network 11.11.11.0 0.0.0.255 area 5
network 11.110.254.36 0.0.0.3 area 0
!
router bgp 1
bgp router-id 10.108.253.252
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.40 remote-as 1
neighbor 10.108.254.40 update-source Loopback0
neighbor 10.108.254.254 remote-as 1
!
address-family vpnv4
neighbor 10.108.254.40 activate
neighbor 10.108.254.40 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_2
redistribute ospf 2 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
!
end
Router_F#show ip ospf
Routing Process "ospf 2" with ID 10.108.253.5
Domain ID type 0x0005, value 0.0.0.2
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Connected to MPLS VPN Superbackbone
It is an area border and autonomous system boundary router
Redistributing External Routes from,
bgp 1 with metric mapped to 20, includes subnets in redistribution
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 4. Checksum Sum 0x01C550
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 2 normal 0 stub 0 nssa
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 9w6d ago
SPF algorithm executed 3 times
Area ranges are
Number of LSA 9. Checksum Sum 0x05B20B
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 4
Number of interfaces in this area is 2 (2 loopback)
Area has no authentication
SPF algorithm last executed 9w6d ago
SPF algorithm executed 2 times
Area ranges are
Number of LSA 7. Checksum Sum 0x045B47
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Router_F#
Router_F#show ip protocols
Routing Protocol is "eigrp 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Default networks flagged in outgoing updates
Default networks accepted from incoming updates
EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
EIGRP maximum hopcount 100
EIGRP maximum metric variance 1
Redistributing: static, eigrp 1
EIGRP NSF-aware route hold timer is 240s
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
10.0.0.0
Routing Information Sources:
Gateway Distance Last Update
10.108.253.169 90 2w0d
10.111.3.14 90 2w0d
10.108.253.2 90 2w0d
Distance: internal 90 external 170
Routing Protocol is "bgp 1"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
IGP synchronization is disabled
Automatic route summarization is disabled
Maximum path: 1
Routing Information Sources:
Gateway Distance Last Update
Distance: external 20 internal 200 local 200
Router_I#show running-config
!
hostname Router_I
!
ip vrf vpn_2
rd 100:100
route-target export 100:100
route-target import 100:100
route-target import 1:1
Конфигурация Router_A.
Router_A# show running-config
!
hostname Router_A
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
route-target import 100:100
Router_F# show ip route vrf vpn_2
Routing Table: vpn_2
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
B 10.1.1.2/32 [200/0] via 10.108.254.254, 00:02:09
B 10.18.1.0/24 [200/0] via 10.108.254.45, 00:08:00
B 10.17.1.0/24 [200/0] via 10.108.254.40, 00:08:00
B 10.111.1.0/24 [200/0] via 10.108.254.39, 00:08:00
B 10.112.12.0/24 [200/0] via 10.108.254.39, 00:08:00
B 10.108.253.5/32 [200/0] via 10.108.254.254, 00:02:09
O IA 10.110.156.0/24 [110/74] via 11.110.254.38, 00:01:59, Serial2/0
11.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O IA 11.5.5.5/32 [110/65] via 11.110.254.38, 00:02:00, Serial2/0
C 11.110.254.36/30 is directly connected, Serial2/0
12.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
B 12.108.192.128/25 [200/74] via 10.108.254.254, 00:02:11
B 12.108.253.4/30 [200/0] via 10.108.254.254, 00:02:11
B 12.108.254.2/32 [200/65] via 10.108.254.254, 00:02:11
Router_I#
!
ip vrf vpn_2
rd 100:100
route-target export 100:100
route-target import 100:100
route-target import 1:1
!
!
router eigrp 1
redistribute static
network 10.0.0.0
no auto-summary
!
router ospf 2 vrf vpn_2
log-adjacency-changes
redistribute bgp 1 metric 20 subnets
network 12.0.0.0 0.255.255.255 area 1
!
router bgp 1
bgp router-id 10.108.254.254
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.253.252 remote-as 1
neighbor 10.108.254.40 remote-as 1
neighbor 10.108.254.40 update-source Loopback0
!
address-family vpnv4
neighbor 10.108.254.40 activate
neighbor 10.108.254.40 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_2
redistribute ospf 2 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
Конфигурация маршрутизатора Router_I!
ip vrf vpn_2
rd 100:100
route-target export 100:100
route-target import 100:100
route-target import 1:1
!
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
router ospf 2 vrf vpn_2
log-adjacency-changes
redistribute bgp 1 metric 20 subnets
network 11.0.0.0 0.255.255.255 area 1
!
router bgp 1
bgp router-id 10.108.253.252
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.40 remote-as 1
neighbor 10.108.254.40 update-source Loopback0
neighbor 10.108.254.254 remote-as 1
!
address-family vpnv4
neighbor 10.108.254.40 activate
neighbor 10.108.254.40 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_2
redistribute ospf 2 match internal external 1 external 2
no auto-summary
no synchronization
exit-address-family
!
Routing Table: vpn_2
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 5 subnets
B 10.18.1.0 [200/0] via 10.108.254.45, 00:04:54
B 10.17.1.0 [200/0] via 10.108.254.40, 00:04:54
B 10.111.1.0 [200/0] via 10.108.254.39, 00:04:54
B 10.112.12.0 [200/0] via 10.108.254.39, 00:04:54
B 10.110.156.0 [200/74] via 10.108.253.252, 00:04:38
11.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
B 11.5.5.5/32 [200/65] via 10.108.253.252, 00:04:38
B 11.110.254.36/30 [200/0] via 10.108.253.252, 00:04:40
12.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
O 12.108.192.128/25 [110/74] via 12.108.253.6, 00:06:25, Serial1/0
C 12.108.253.4/30 is directly connected, Serial1/0
O 12.108.254.2/32 [110/65] via 12.108.253.6, 00:06:26, Serial1/0
Router_B#sh run
!
hostname Router_B
!
ip vrf vpn_3
rd 1003:1003
route-target export 1003:1003
route-target import 1003:1003
route-target import 1:1
!
ip vrf vpn_1
rd 1:1
route-target export 1:1
route-target import 1:1
route-target import 1003:1003
!
interface Loopback0
ip address 10.108.254.45 255.255.255.255
no clns route-cache
!
interface FastEthernet0/0
ip vrf forwarding vpn_1
ip address 10.18.1.1 255.255.255.0
!
interface Serial0/2
description Router_D
ip vrf forwarding vpn_3
ip address 10.108.253.205 255.255.255.252
clockrate 64000
no clns route-cache
!
router eigrp 1
network 10.0.0.0
no auto-summary
!
router rip
version 2
!
address-family ipv4 vrf vpn_1
version 2
redistribute bgp 1 metric 1
network 10.0.0.0
no auto-summary
exit-address-family
!
address-family ipv4 vrf vpn3
version 2
redistribute bgp 1 metric 1
network 10.0.0.0
no auto-summary
exit-address-family
!
router bgp 1
bgp router-id 10.108.254.45
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.108.254.40 remote-as 1
neighbor 10.108.254.40 update-source Loopback0
!
address-family vpnv4
neighbor 10.108.254.40 activate
neighbor 10.108.254.40 send-community extended
exit-address-family
!
address-family ipv4 vrf vpn_1
redistribute rip metric 1
no auto-summary
no synchronization
exit-address-family
!
address-family ipv4 vrf vpn3
redistribute rip metric 1
no auto-summary
no synchronization
exit-address-family