Включение Peer Groups
BGP-роутер может иметь одинаковые политики обновления для набора своих соседей. Это очень полезно, если необходимо изменить политики обновления для всех соседей: изменение конфигурации отдельных маршрутизаторов для разных политик может быть очень трудоемким, поэтому peer groups играют важную роль в создании и назначении политик для группы маршрутизаторов.
В следующем сценарии SW1, SW2 и SW3 принадлежат одной группе peer group. SW4 и SW1 являются eBGP-соседями. SW1 является маршрутизатором-рефлектором (конфигурация не показана), а SW2 и SW3 находятся в AS 200. SW4 находится в AS 100.
Топология
Рисунок 7-119: BGP Peer Groups
SW1
#configure terminal | Перейти в режим конфигурации. |
(config)#router bgp 200 | Определить процесс маршрутизации. Число 200 указывает номер AS для SW1. |
(config-router)#neighbor ABC peer-group | Создать peer group с именем ABC . |
(config-router)#neighbor ABC remote-as 200 | Назначить параметры peer group с именем ABC . |
(config-router)#neighbor 2.2.2.2 peer-group ABC | Определить соседа 2.2.2.2 (SW2 ) как члена peer group. |
(config-router)#neighbor 3.3.3.3 peer-group ABC | Определить соседа 3.3.3.3 (SW3 ) как члена peer group. |
(config-router)#neighbor 4.4.4.4 remote-as 100 | Определить соседа 4.4.4.4 (SW4 ), где 4.4.4.4 — это IP-адрес SW4, а 100 — номер AS. |
SW2
#configure terminal | Перейти в режим конфигурации. |
(config)#router bgp 200 | Определить процесс маршрутизации. Число 200 указывает номер AS для SW2. |
(config-router)#neighbor 2.2.2.1 remote-as 200 | Создать TCP-соединение с соседом 2.2.2.1 из AS 200 . |
SW3
#configure terminal | Перейти в режим конфигурации. |
(config)#router bgp 200 | Определить процесс маршрутизации. Число 200 указывает номер AS для SW3. |
(config-router)#neighbor 3.3.3.1 remote-as 200 | Создать TCP-соединение с соседом 3.3.3.1 из AS 200 . |
SW4
#configure terminal | Перейти в режим конфигурации. |
(config)#router bgp 100 | Определить процесс маршрутизации. Число 100 указывает номер AS для SW4. |
(config-router)#neighbor 4.4.4.1 remote-as 200 | Создать TCP-соединение с соседом 4.4.4.1 из AS 200 . |
Проверка
SW1
SW1#show ip bgp neighbors
BGP neighbor is 2.2.2.2, remote AS 200, local AS 200, internal link
Member of peer-group ABC for session parameters
BGP version 4, local router ID 192.168.52.2, remote router ID 10.12.7.155
BGP state = Established, up for 00:04:55
Last read 00:04:55, 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 11 messages, 0 notifications, 0 in queue
Sent 11 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
ABC peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 2.2.2.1, Local port: 33865
Foreign host: 2.2.2.2, Foreign port: 179
Nexthop: 2.2.2.1
Nexthop global: 1111::1
Nexthop local: fe80::a00:27ff:fecc:47a6
BGP connection: non shared network
BGP neighbor is 3.3.3.3, remote AS 200, local AS 200, internal link
Member of peer-group ABC for session parameters
BGP version 4, local router ID 192.168.52.2, remote router ID 10.12.7.153
BGP state = Established, up for 00:04:55
Last read 00:04:55, 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 11 messages, 0 notifications, 0 in queue
Sent 11 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
ABC peer-group member
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 3.3.3.1, Local port: 44280
Foreign host: 3.3.3.3, Foreign port: 179 Nexthop: 3.3.3.1
Nexthop global: fe80::a00:27ff:fe85:25d4
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 4.4.4.4, remote AS 100, local AS 200, external link
BGP version 4, remote router ID 10.12.7.120
BGP state = Established, up for 00:04:55
Last read 00:04:55, 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 11 messages, 0 notifications, 0 in queue
Sent 11 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 IPv4
BGP table version 1, neighbor version 1
Index 3, Offset 0, Mask 0x8
Community attribute sent to this neighbor (both)
0 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 4.4.4.1, Local port: 55493
Foreign host: 4.4.4.4, Foreign port: 179 Nexthop: 4.4.4.1
Nexthop global: fe80::a00:27ff:fe7e:674a
Nexthop local: ::
BGP connection: non shared network
SW1#show ip bgp summary
BGP router identifier 192.168.52.2, 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
2.2.2.2 4 200 12 12 1 0 0 00:05:02 0
3.3.3.3 4 200 12 12 1 0 0 00:05:02 0
4.4.4.4 4 100 12 12 1 0 0 00:05:02 0
Total number of neighbors 3
Total number of Established sessions 3