Несколько Route Reflectors
Основное правило BGP заключается в том, что BGP-роутер не может анонсировать маршрут iBGP-соседу, если этот маршрут был получен от другого iBGP-соседа. Настройка Route Reflector позволяет обойти это правило. Весь процесс работы Route Reflector прозрачен для клиентов, и на них не требуется дополнительной настройки.
Когда роутер с поддержкой iBGP получает обновление маршрута, он пересылает маршрут соседу без изменения IP-адреса nexthop, что делает маршрут недоступным, если он не проверен iGP (например, neighbor x.x.x.x route-reflector-client
).
- Если роутер настроен как Route Reflector, он пересылает полученные маршруты, изменяя nexthop на свой собственный адрес, что делает nexthop доступным.
- Если маршрут получен от клиента, он пересылается клиентам.
- Если маршрут получен от неклиента, он пересылается как клиентам, так и неклиентам.
Топология
Рисунок 7-106: Топология eBGP и iBGP с Route Reflector
SW1
#configure terminal | Перейти в режим конфигурации. |
PRSP(config)#interface eth1 | Перейти в режим интерфейса. |
PRSP(config-if)#ip addr 1.1.1.1/24 | Ука зать IP-адрес для интерфейса. |
PRSP(config-if)#exit | Выйти из режима интерфейса. |
(config)#interface lo | Перейти в режим интерфейса loopback. |
(config-if)#ip address 100.100.100.100/32 secondary | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса loopback. |
(config)#router bgp 100 | Определить процесс маршрутизации с номером AS 100 . |
(config-router)#neighbor 1.1.1.2 remote-as 200 | Определить eBGP-соседа (SW2). |
(config-router)#network 100.100.100.100/32 | Анонсировать маршрут через eBGP-соединение с SW2. |
(config-router)#exit | Выйти из режима маршрутизатора. |
SW2
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip address 1.1.1.2/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 3.3.3.2/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейс а. |
(config)#interface eth3 | Перейти в режим интерфейса. |
(config-if)#ip address 4.4.4.2/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200 | Определить процесс маршрутизации с номером AS 200 . |
(config-router)#neighbor 1.1.1.1 remote-as 100 | Определить eBGP-соседа (SW1). |
(config-router)#neighbor 4.4.4.1 remote-as 200 | Определить iBGP-соседа (SW4). |
(config-router)#neighbor 3.3.3.1 remote-as 200 | Определить iBGP-соседа (SW3). |
(config-router)#bgp cluster-id 4 | Определить идентификатор кластера (4 ) при наличии нескольких Route Reflectors. |
(config-router)#neighbor 3.3.3.1 routereflector-client | Настроить SW2 как Route Reflector и соседа SW3 как его клиента. |
(config-router)#neighbor 4.4.4.1 routereflector-client | Настроить SW2 как Route Reflector и соседа SW4 как его клиента. |
(config-router)#exit | Выйти из режима маршрутизатора. |
SW3
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth2 | Перейти в режим интерфейса. |
PRSP(config-if)#ip address 3.3.3.1/24 | Назначить IP-адрес. |
PRSP(config-if)#exit | Выйти из режима интерфейса. |
PRSP(config)#interface eth1 | Перейти в режим интерфейса. |
PRSP(config-if)#ip addr 5.5.5.1/24 | Назначить IP-адрес. |
PRSP(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200 | Определить процесс маршрутизации с номером AS 200 . |
(config-router)#neighbor 3.3.3.2 remote-as 200 | Определить iBGP-соседа (SW2). |
(config-router)#neighbor 5.5.5.2 remote-as 200 | Определить iBGP-соседа (SW5). |
(config-router)#neighbor 5.5.5.2 routereflector-client | Настроить SW3 как Route Reflector и соседа SW5 как его клиента. |
(config-router)#exit | Выйти из режима маршрутизатора. |
SW4
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 6.6.6.1/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#interface eth4 | Перейти в режим интерфейса. |
(config-if)#ip address 4.4.4.1/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200 | Определить процесс маршрутизации с номером AS 200 . |
(config-router)#neighbor 4.4.4.2 remote-as 200 | Определить iBGP-соседа (SW2). |
(config-router)#neighbor 6.6.6.2 remote-as 200 | Определить iBGP-соседа (SW5). |
(config-router)#exit | Выйти из режима маршрутизатора. |
SW5
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip address 5.5.5.2/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса. |
(config-if)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 6.6.6.2/24 | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200 | Определить процесс маршрутизации с номером AS 200 . |
(config-router)#neighbor 5.5.5.1 remote-as 200 | Определить iBGP-соседа (SW3). |
(config-router)#neighbor 6.6.6.1 remote-as 200 | Определить iBGP-соседа (SW4). |
(config-router)#exit | Выйти из режима маршрутизатора. |
Проверка
SW2
#show ip bgp neighbors
BGP neighbor is 1.1.1.1, remote AS 100, local AS 200, external link
BGP version 4, local router ID 192.160.50.3, remote router ID 192.160.50.2
BGP state = Established, up for 00:14:41
Last read 00:00:11, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 32 messages, 0 notifications, 0 in queue
Sent 31 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 2, neighbor version 2
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 1.1.1.2, Local port: 50649
Foreign host: 1.1.1.1, Foreign port: 179
Nexthop: 1.1.1.2 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 3.3.3.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.3, remote router ID 192.160.50.4
BGP state = Established, up for 00:04:17
Last read 00:00:17, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 10 messages, 0 notifications, 0 in queue
Sent 13 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 2, neighbor version 2
Index 3, Offset 0, Mask 0x8
Route-Reflector Client
Community attribute sent to this neighbor (both)
0accepted prefixes
1announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.2, Local port: 179
Foreign host: 3.3.3.1, Foreign port: 32973
Nexthop: 3.3.3.2 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 4.4.4.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.3, remote router ID 192.160.50.6
BGP state = Established, up for 00:00:16
Last read 00:00:16, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 2 messages, 0 notifications, 0 in queue
Sent 4 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 2, neighbor version 2
Index 2, Offset 0, Mask 0x4
Route-Reflector Client
Community attribute sent to this neighbor (both)
0accepted prefixes
1announced prefixes
Connections established 1; dropped 0
Local host: 4.4.4.2, Local port: 179
Foreign host: 4.4.4.1, Foreign port: 60398
Nexthop: 4.4.4.2 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
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, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN,
v - vrf leaked
* - candidate default
IP Route Table for VRF "default"
C 1.1.1.0/24 is directly connected, eth1, 00:16:10
C 3.3.3.0/24 is directly connected, eth2, 00:15:59
C 4.4.4.0/24 is directly connected, eth3, 00:15:49
B100.100.100.100/32 [20/0] via 1.1.1.1, eth1, 00:14:53
C127.0.0.0/8 is directly connected, lo, 00:32:26
C 192.160.50.0/24 is directly connected, eth0, 00:32:22
Gateway of last resort is not set
#show ip bgp summary
BGP router identifier 192.160.50.3, local AS number 200
BGP table version is 2
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
1.1.1.1 4 100 33 32 2 0 0 00:15:07 1
3.3.3.1 4 200 11 14 2 0 0 00:04:43 0
4.4.4.1 4 200 3 5 2 0 0 00:00:42 0
Total number of neighbors 3
Total number of Established sessions 3 #
#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
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, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN,
v - vrf leaked
* - candidate default
IP Route Table for VRF "default"
C 1.1.1.0/24 is directly connected, eth1, 00:16:10
C 3.3.3.0/24 is directly connected, eth2, 00:15:59
C 4.4.4.0/24 is directly connected, eth3, 00:15:49
B 100.100.100.100/32 [20/0] via 1.1.1.1, eth1, 00:14:53
C 127.0.0.0/8 is directly connected, lo, 00:32:26
C192.160.50.0/24 is directly connected, eth0, 00:32:22
Gateway of last resort is not set
#show ip bgp
BGP table version is 2, local router ID is 192.160.50.3
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.100/32
1.1.1.1 0 100 0 100 i
Total number of prefixes 1 #
**SW1**
#show bgp neighbors
BGP neighbor is 1.1.1.2, remote AS 200, local AS 100, external link
BGP version 4, local router ID 192.160.50.2, remote router ID 192.160.50.3
BGP state = Established, up for 00:16:11
Last read 00:00:11, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 34 messages, 0 notifications, 0 in queue
Sent 36 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
0accepted prefixes
1announced prefixes
Connections established 1; dropped 0
Local host: 1.1.1.1, Local port: 179
Foreign host: 1.1.1.2, Foreign port: 50649
Nexthop: 1.1.1.1 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
#show ip bgp summary
BGP router identifier 192.160.50.2, local AS number 100
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
1.1.1.2 4 200 34 36 1 0 0 00:16:18 0
Total number of neighbors 1
Total number of Established sessions 1 #
SW3
#show ip bgp
BGP table version is 1, local router ID is 192.160.50.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i 100.100.100.100/32 1.1.1.1 0 100 0 100 i
Total number of prefixes 1 #
#show ip bgp neighbors
BGP neighbor is 3.3.3.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.4, remote router ID 192.160.50.3
BGP state = Established, up for 00:06:15
Last read 00:00:15, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 15 messages, 0 notifications, 0 in queue
Sent 14 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.1, Local port: 32973
Foreign host: 3.3.3.2, Foreign port: 179
Nexthop: 3.3.3.1 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 5.5.5.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.4, remote router ID 192.160.50.5
BGP state = Established, up for 00:03:35
Last read 00:00:05, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 9 messages, 0 notifications, 0 in queue
Sent 10 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
Route-Reflector Client
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 5.5.5.1, Local port: 179
Foreign host: 5.5.5.2, Foreign port: 39271
Nexthop: 5.5.5.1 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
#
#show ip bgp summary
BGP router identifier 192.160.50.4, local AS number 200
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
3.3.3.2 4 200 15 14 1 0 0 00:06:26 1
5.5.5.2 4 200 9 10 1 0 0 00:03:46 0
Total number of neighbors 2
SW4
#show ip bgp
BGP table version is 1, local router ID is 192.160.50.6
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
l - labeled, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* i 100.100.100.100/32
1.1.1.1 0 100 0 100 i
Total number of prefixes 1 #
PRSP#sh ip bgp neighbors
BGP neighbor is 4.4.4.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.6, remote router ID 192.160.50.3
BGP state = Established, up for 00:03:58
Last read 00:00:28, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 10 messages, 0 notifications, 0 in queue
Sent 9 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 4.4.4.1, Local port: 60398
Foreign host: 4.4.4.2, Foreign port: 179
Nexthop: 4.4.4.1 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 6.6.6.2, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.6, remote router ID 192.160.50.5
BGP state = Established, up for 00:03:52
Last read 00:00:22, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 9 messages, 0 notifications, 0 in queue
Sent 9 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 6.6.6.1, Local port: 48257
Foreign host: 6.6.6.2, Foreign port: 179
Nexthop: 6.6.6.1 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
#
#show ip bgp summary
BGP router identifier 192.160.50.6, local AS number 200
BGP table version is 1
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
4.4.4.2 4 200 11 10 1 0 0 00:04:09 1
6.6.6.2 4 200 10 10 1 0 0 00:04:03 0
Total number of neighbors 2
Total number of Established sessions 2
SW5
#show ip bgp neighbors
BGP neighbor is 5.5.5.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.5, remote router ID 192.160.50.4
BGP state = Established, up for 00:09:04
Last read 00:00:04, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 20 messages, 0 notifications, 0 in queue
Sent 20 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 5.5.5.2, Local port: 39271
Foreign host: 5.5.5.1, Foreign port: 179
Nexthop: 5.5.5.2 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 6.6.6.1, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.160.50.5, remote router ID 192.160.50.6
BGP state = Established, up for 00:07:36
Last read 00:00:06, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
Address family IPv4 Unicast: advertised and received
Received 17 messages, 0 notifications, 0 in queue
Sent 18 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 5 seconds
For address family: IPv4 Unicast
BGP table version 1, neighbor version 1
Index 2, Offset 0, Mask 0x4
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 6.6.6.2, Local port: 179
Foreign host: 6.6.6.1, Foreign port: 48257
Nexthop: 6.6.6.2 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network #
#sh ip bgp summary
BGP router identifier 192.160.50.5, local AS number 200
BGP table version is 1
0 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
5.5.5.1 4 200 20 20 1 0 0 00:09:20 0
6.6.6.1 4 200 17 18 1 0 0 00:07:52 0
Total number of neighbors 2
Total number of Established sessions 2 #