Включение eBGP Multihop
Этот пример демонстрирует минимальную конфигурацию, необходимую для включения eBGP multihop на маршрутизаторах, использующих BGP. eBGP multihop используется для маршрутизаторов, которые не подключены напрямую дру г к другу. Обычно eBGP-пиры подключены напрямую, но если возникает необходимость в такой конфигурации, можно использовать данный пример.
Примечание: IP-адреса, используемые в конфигурации, должны быть доступны через IGP или статическую маршрутизацию.
Топология
Рисунок 7-118: Соединение eBGP Multihop
SW1
#configure terminal | Перейти в режим конфигурации. |
(config)#interface lo | Перейти в режим интерфейса loopback. |
(config-if)#ip address 100.100.100.1/24 secondary | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса loopback. |
(config)#ip route 200.200.200.0/24 1.1.1.2 | Указать маршрутный IP-адрес. |
(config)#router bgp 1 | Определить процесс маршрутизации. Число 1 указывает номер AS для SW1 . |
(config-router)#neighbor 200.200.200.1 remote-as 2 | Определить BGP-соседей и установить TCP-сессию. 200.200.200.1 — это IP-адрес соседа (SW2), а 2 — номер AS соседа. |
(config-router)#neighbor 200.200.200.1 update-source lo | Определить BGP-соседей для обновления исходных маршрутов. |
(config-router)#neighbor 200.200.200.1 ebgpmultihop | Определить соседа 200.200.200.1 для eBGP multihop. |
(config-router)#end | Выйти из режима маршрутизатора BGP. |
SW2
#configure terminal | Перейти в режим конфигурации. |
(config)#interface lo | Перейти в режим интерфейса loopback. |
(config-if)#ip address 200.200.200.1/24 secondary | Указать IP-адрес для интерфейса. |
(config-if)#exit | Выйти из режима интерфейса loopback. |
(config)#ip route 100.100.100.0/24 1.1.1.1 | Указать маршрутный IP-адрес. |
(config)#router bgp 2 | Определить процесс маршрутизации. Число 2 указывает номер AS для SW1 . |
(config-router)#redistribute static | Распространить статический маршрут. |
(config-router)#neighbor 100.100.100.1 remote-as 1 | Определить BGP-соседей и установить TCP-сессию. 100.100.100.1 — это IP-адрес соседа (SW2), а 1 — номер AS соседа. |
(config-router)#neighbor 100.100.100.1 update-source lo | Определить BGP-соседей для обновления исходных маршрутов. |
(config-router)#neighbor 100.100.100.1 ebgpmultihop | Определить соседа 100.100.100.1 для eBGP multihop. |
(config-router)#end | Выйти из режима маршрутизатора BGP. |
Проверка
SW1
#show ip bgp neighbors
BGP neighbor is 200.200.200.1, remote AS 2, local AS 1, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
BGP state = Established, up for 00:00:22
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 2 messages, 0 notifications, 0 in queue
Sent 3 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
Update source is lo
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
External BGP neighbor may be up to 255 hops away.
Local host: 100.100.100.1, Local port: 179
Foreign host: 200.200.200.1, Foreign port: 59458 Nexthop: 100.100.100.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#clear ip bgp *
2022 Mar 21 12:02:06.201 : PRSP : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour
[200.200.200.1] Session down due to peer clear
#show ip bgp
BGP table version is 4, local router ID is 192.168.52.2
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.0/24 200.200.200.1 0 100 0 2 ?
Total number of prefixes 1
#show ip bgp neighbors
BGP neighbor is 200.200.200.1, remote AS 2, local AS 1, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 192.168.52.3
BGP state = Established, up for 00:00:26
Last read 00:00:26, 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 5 messages, 0 notifications, 0 in queue
Sent 6 messages, 1 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
Update source is lo
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 2; dropped 1
External BGP neighbor may be up to 255 hops away.
Local host: 100.100.100.1, Local port: 57260
Foreign host: 200.200.200.1, Foreign port: 179
Nexthop: 100.100.100.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:00:31, due to BGP Notification sent
Notification Error Message: (Cease/Administratively Reset.)
SW2
PRSP#sh ip bgp neighbors
BGP neighbor is 100.100.100.1, remote AS 1, local AS 2, external link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.2
BGP state = Established, up for 00:00: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 6 messages, 1 notifications, 0 in queue
Sent 7 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Minimum time between advertisement runs is 30 seconds
Update source is lo
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 2; dropped 1
External BGP neighbor may be up to 255 hops away.
Local host: 200.200.200.1, Local port: 179
Foreign host: 100.100.100.1, Foreign port: 57260 Nexthop: 200.200.200.1
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:00:40, due to BGP Notification received
Notification Error Message: (Cease/Administratively Reset.)
#show ip bgp
BGP table version is 4, local router ID is 192.168.52.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.0/24 1.1.1.1 0 100 32768 ?
Total number of prefixes 1