Атрибут расширенного сообщества BGP
Атрибут расширенного сообщества предоставляет механизм для маркировки информации, передаваемой в BGP.
Расширенное сообщество с 2-байтовым ASN
В следующем примере CE1, PE1, PE2 и CE2 поддерживают 2-байтовые ASN и не поддерживают 4-байтовые ASN.
Топология
Рисунок 7-126: Расширенные сообщества — 2-байтовый ASN
CE1
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip address 172.4.5.115/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 100 | Назначить значение ASN (100 ) маршрутизатору. Диапазон ASN — <1-65535>. |
(config-router)#neighbor 172.4.5.116 remoteas 200 | Указать IP-адрес соседа (172.4.5.116 ) и значение ASN соседа (200 ). |
CE2
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip address 172.3.4.114/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 300 | Назначить значение ASN (300 ) маршрутизатору. Диапазон ASN — <1-65535>. |
(config-router)#neighbor 172.3.4.117 remoteas 200 | Указать IP-адрес соседа (172.3.4.117 ) и значение ASN соседа (200 ). |
PE1
#configure terminal | Перейти в режим конфигурации. |
(config)#ip vrf VRF1 | Указать имя VRF (VRF1 ) для создания. |
(config-vrf)#rd 100:10 | Назначить идентификатор маршрута (RD) для VRF, который является уникальным значением на маршрутизаторе. Значение RD может быть в формате ASN:NN или A.B.C.D:NN. |
(config-vrf)#route-target both 100:10 | Указать 2-октетный AS-специфичный или IPv4-специфичный транзитивный атрибут расширенного сообщества Route-Target. |
(config-vrf)#exit | Выйти из режима VRF и вернуться в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip vrf forwarding VRF1 | Привязать интерфейс (eth1) к VRF (VRF1 ). |
(config-if)#ip address 172.4.5.116/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#ip route vrf VRF1 75.1.1.0/24 eth1 | Создать статический маршрут VRF. |
(config)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 172.6.7.116/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200 | Назначить значение ASN (200 ) маршрутизатору. |
(config-router)#neighbor 172.6.7.117 remoteas 200 | Указать IP-адрес соседа (PE2) (172.6.7.117 ) и значение ASN соседа (200 ). В данном случае это iBGP-соединение, поэтому PE1 и PE2 находятся в одном AS. |
(config-router)#address-family vpnv4 unicast | Включить обмен информацией о маршрутах VPNv4 между PE-маршрутизаторами ISP и перейти в режим Address-Family-VPNv4. |
(config-router-af)#neighbor 172.6.7.117 activate | Включить обмен информацией о маршрутах с маршрутизатором-соседом. |
(config-router-af)#exit | Выйти из режима Address-Family-VPNv4. |
(config-router)#address-family ipv4 vrf VRF1 | Включить обмен информацией о маршрутах VRF между PE-маршрутизаторами ISP и перейти в режим Address-Family-VRF. |
(config-router-af)#neighbor 172.4.5.115 remote-as 100 | Указать IP-адрес соседа (CE1) и значение ASN. |
(config-router-af)#neighbor 172.4.5.115 sendcommunity both | Включить атрибут расширенного сообщества для соседа. |
(config-router-af)#redistribute static | Настроить редистрибьюцию статических маршрутов. |
(config-router-af)#end | Выйти из режима Address-Family. |
PE2
#configure terminal | Перейти в режим конфигурации. |
(config)#ip vrf VRF1 | Указать имя VRF (VRF1 ) для создания. |
(config-vrf)#rd 100:10 | Назначить идентификатор маршрута (RD) для VRF. |
(config-vrf)#route-target both 100:10 | Указать 2-октетный AS-специфичный или IPv4-специфичный транзитивный атрибут расширенного сообщества Route-Target. |
(config-vrf)#exit | Выйти из режима VRF и вернуться в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip vrf forwarding VRF1 | Привязать интерфейс (eth1) к VRF (VRF1 ). |
(config-if)#ip address 172.3.4.117/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#ip route vrf VRF1 100.1.1.0/24 eth1 | Создать статический маршрут VRF. |
(config)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 172.6.7.117/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200 | Назначить значение ASN (200 ) маршрутизатору. |
(config-router)#neighbor 172.6.7.116 remoteas 200 | Указать IP-адрес соседа (PE1) (172.6.7.116 ) и значение ASN соседа (200 ). В данном случае это iBGP-соединение, поэтому PE1 и PE2 находятся в одном AS. |
(config-router)#address-family vpnv4 unicast | Включить обмен информацией о маршрутах VPNv4 между PE-маршрутизаторами ISP и перейти в режим Address-Family-VPNv4. |
(config-router-af)#neighbor 172.6.7.116 activate | Включить обмен информацией о маршрутах с маршрутизатором-соседом. |
(config-router-af)#exit | Выйти из режима Address-Family-VPNv4. |
(config-router)#address-family ipv4 vrf VRF1 | Включить обмен информацией о маршрутах VRF между PE-маршрутизаторами ISP и перейти в режим Address-Family-VRF. |
(config-router-af)#neighbor 172.3.4.114 remote-as 300 | Указать IP-адрес соседа (CE2) и значение ASN. |
(config-router-af)#neighbor 172.3.4.114 sendcommunity both | Включить атрибут расширенного сообщества для соседа. |
(config-router-af)#redistribute static | Настроить редистрибьюцию статических маршрутов. |
(config-router-af)#end | Выйти из режима Address-Family. |
Проверка
CE1
#show running-config
...
!
!
Last configuration change at 10:01:19 EDT Mon Mar 18 2022 by prsp
!
no service password-encryption
!
logging monitor 7
!
ip vrf management
!
ip domain-lookup
feature telnet
feature ssh
snmp-server enable
snmp snmp-server view all .1 included
feature ntp
ntp enable
username prsp role network-admin password encrypted $1$AUeGhbf0$HCHhxemCQ39LPYOjC.Kb7/
feature rsyslog
!
interface lo ip address 127.0.0.1/8
ipv6 address ::1/128
mtu 65536
!
interface eth0
ip address 192.168.52.2/24
!
interface eth1
ip address 172.4.5.115/24
!
interface eth2
shutdown
!
interface eth3
shutdown
!
interface eth4
shutdown
!
interface eth5
shutdown
!
router bgp 100
neighbor 172.4.5.116 remote-as 200
!
line con 0
login line vty 0 39
login
!
end
#
#show ip bgp
BGP table version is 8, 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
*> 75.1.1.0/24 172.4.5.116 0 100 0 200 ?
*> 100.1.1.0/24 172.4.5.116 0 100 0 200 ?
Total number of prefixes 2
#
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200, local AS 100, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:04: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 131 messages, 1 notifications, 0 in queue
Sent 129 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 8, neighbor version 8
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 2; dropped 1
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 37982 Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:04:54, due to BGP Notification received
Notification Error Message: (Cease/Peer Unconfigured.)
#show ip bgp vrf all
BGP table version is 8, 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
*> 75.1.1.0/24 172.4.5.116 0 100 0 200 ?
*> 100.1.1.0/24 172.4.5.116 0 100 0 200 ?
Total number of prefixes 2
#
Vty connection is timed out.
Connection to 192.168.52.2 closed. [root@localhost ~]# ssh prsp@192.168.52.2 prsp@192.168.52.2's password:
By using this product you are accepting the PRSP End User License Agreement. Please refer the file /etc/End_User_License_Agreement.txt for more details.
Last login: Mon Mar 18 10:45:54 2022 from 192.168.52.1
>en
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100
BGP table version is 8
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.4.5.116 4 200 168 165 8 0 0 00:22:04 2
Total number of neighbors 1
Total number of Established sessions 1
Vty connection is timed out.
Connection to 192.168.52.2 closed.
PE1
#show running-config
!
!
Last configuration change at 11:10:03 EDT Mon Mar 18 2022 by prsp
!
no service password-encryption
!
logging monitor 7
!
ip vrf management
!
ip vrf VRF1 rd 100:10 route-target both 100:10
!
ip domain-lookup
feature telnet
feature ssh
snmp-server enable
snmp snmp-server view all .1 included
feature ntp
ntp enable
username prsp role network-admin password encrypted $1$2UnTwo.1$uP.0psPDz7JYEz/KvQ/1C0
feature rsyslog
!
interface lo
ip address 127.0.0.1/8
ipv6 address ::1/128 mtu 65536
!
interface eth0
ip address 192.168.52.3/24
!
interface eth1
ip vrf forwarding VRF1
ip address 172.4.5.116/24
!
interface eth2
shutdown
!
interface eth3
ip address 172.6.7.116/24
!
interface eth4
shutdown
!
interface eth5
shutdown
!
router bgp 200
neighbor 172.6.7.117 remote-as 200
!
address-family vpnv4 unicast
neighbor 172.6.7.117 activate
exit-address-family
!
address-family ipv4 vrf VRF1
redistribute static
neighbor 172.4.5.115 remote-as 100
neighbor 172.4.5.115 activate
neighbor 172.4.5.115 send-community extended
exit-address-family
!
ip route vrf VRF1 75.1.1.0/24 eth1
!
line con 0
login line vty 0 39 login
!
end
>en
#
#show ip bgp vpnv4 all
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
Route Distinguisher: 100:10 (Default for VRF VRF1)
*> 75.1.1.0/24 0.0.0.0 0 100 32768 ?
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Announced routes count = 1 Accepted routes count = 1
Route Distinguisher: 100:10
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Announced routes count = 0
Accepted routes count = 1
#show ip bgp vrf all
BGP table version is 2, local router ID is 172.4.5.116
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
BGP Route Table for VRF VRF1
*> 75.1.1.0/24 0.0.0.0 0 100 32768 ?
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 172.4.5.116, local AS number 200
BGP VRF VRF1 Route Distinguisher: 100:10
BGP table version is 2
1 BGP AS-PATH entries
0BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.4.5.115 4 100 55 60 2 0 0 00:26:54
0
Total number of neighbors 1
Total number of Established sessions 1
BGP router identifier 192.168.52.3, local AS number 200
BGP table version is 1
1BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.6.7.117 4 200 80 101 1 0 0 00:37:47 0
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 172.6.7.117, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.168.52.3, remote router ID 192.168.52.5
BGP state = Established, up for 00:38:33
Last read 00:00:03, 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
Address family VPNv4 Unicast: advertised and received
Received 82 messages, 0 notifications, 0 in queue
Sent 103 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
0announced prefixes
For address family: VPNv4 Unicast
BGP table version 4, neighbor version 4
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 172.6.7.116, Local port: 179
Foreign host: 172.6.7.117, Foreign port: 57743 Nexthop: 172.6.7.116 Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 172.4.5.115, vrf VRF1, remote AS 100, local AS 200, external link
BGP version 4, local router ID 172.4.5.116, remote router ID 192.168.52.2
BGP state = Established, up for 00:27:40
Last read 00:00:10, 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 57 messages, 0 notifications, 0 in queue
Sent 62 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)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.116, Local port: 37982
Foreign host: 172.4.5.115, Foreign port: 179 Nexthop: 172.4.5.116
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
PRSP#show ip bgp vrf all
BGP table version is 2, local router ID is 172.4.5.116
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
BGP Route Table for VRF VRF1
*> 75.1.1.0/24 0.0.0.0 0 100 32768 ?
*>i 100.1.1.0/24 172.6.7.117 0 100 0 ?
Total number of prefixes 2
PE2
#show running-config
!
!
Last configuration change at 11:13:09 EDT Mon Mar 18 2022 by prsp
!
no service password-encryption
!
logging monitor 7
!
ip vrf management
!
ip vrf VRF1 rd 100:10 route-target both 100:10
!
ip domain-lookup
feature telnet
feature ssh
snmp-server enable
snmp snmp-server view all .1 included
feature ntp
ntp enable
username prsp role network-admin password encrypted $1$2UnTwo.1$uP.0psPDz7JYEz/KvQ/1C0
feature rsyslog
!
interface lo ip address 127.0.0.1/8
ipv6 address ::1/128
mtu 65536
!
interface eth0
ip address 192.168.52.5/24
!
interface eth1
ip address 172.6.7.117/24
!
interface eth2
shutdown
!
interface eth3
ip vrf forwarding VRF1
ip address 172.3.4.117/24
!
interface eth4
shutdown
!
router bgp 200 neighbor 172.6.7.116 remote-as 200
!
address-family vpnv4 unicast
neighbor 172.6.7.116 activate
exit-address-family
!
address-family ipv4 vrf VRF1
redistribute static neighbor 172.3.4.114 remote-as 300
neighbor 172.3.4.114 activate
neighbor 172.3.4.114 send-community extended
exit-address-family
!
ip route vrf VRF1 100.1.1.0/24 eth3
!
line con 0
login line vty 0 39
login
!
end
#show ip bgp vrf all
BGP table version is 1, local router ID is 172.3.4.117
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
BGP Route Table for VRF VRF1
*>i 75.1.1.0/24 172.6.7.116 0 100 0 ?
*> 100.1.1.0/24 0.0.0.0 0 100 32768 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 172.3.4.117, local AS number 200
BGP VRF VRF1 Route Distinguisher: 100:10
BGP table version is 1
1 BGP AS-PATH entries
0BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.3.4.114 4 300 82 85 1 0 0 00:40:05 0
Total number of neighbors 1
Total number of Established sessions 1
BGP router identifier 192.168.52.5, local AS number 200
BGP table version is 1
1BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.6.7.116 4 200 113 113 1 0 0 00:54:07 0
Total number of neighbors 1
Total number of Established sessions 1#
#show ip bgp neighbors
BGP neighbor is 172.6.7.116, remote AS 200, local AS 200, internal link
BGP version 4, local router ID 192.168.52.5, remote router ID 192.168.52.3
BGP state = Established, up for 00:56:09
Last read 00:00:09, 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
Address family VPNv4 Unicast: advertised and received
Received 117 messages, 0 notifications, 0 in queue
Sent 117 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
0announced prefixes
For address family: VPNv4 Unicast
BGP table version 5, neighbor version 5
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
1accepted prefixes
1 announced prefixes
Connections established 1; dropped 0
Local host: 172.6.7.117, Local port: 57743
Foreign host: 172.6.7.116, Foreign port: 179 Nexthop: 172.6.7.117
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
BGP neighbor is 172.3.4.114, vrf VRF1, remote AS 300, local AS 200, external link
BGP version 4, local router ID 172.3.4.117, remote router ID 192.168.52.4
BGP state = Established, up for 00:42:07
Last read 00:00:07, 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 86 messages, 0 notifications, 0 in queue
Sent 89 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 0, Offset 0, Mask 0x1
Community attribute sent to this neighbor (both)
0 accepted prefixes
2 announced prefixes
Connections established 1; dropped 0
Local host: 172.3.4.117, Local port: 54753
Foreign host: 172.3.4.114, Foreign port: 179 Nexthop: 172.3.4.117
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
**CE2**
PRSP#show running-config
!
!
Last configuration change at 10:02:33 EDT Mon Mar 18 2022 by prsp
!
no service password-encryption
!
logging monitor 7
!
ip vrf management
!
ip domain-lookup
feature telnet
feature ssh
snmp-server enable
snmp snmp-server view all .1 included
feature ntp
ntp enable
username prsp role network-admin password encrypted $1$neZnRsu.$/3j8UkuRCSPVYY.wm.sol1
feature rsyslog
!
interface lo
ip address 127.0.0.1/8
ipv6 address ::1/128 mtu 65536
!
interface eth0
ip address 192.168.52.4/24
!
interface eth1
shutdown
!
interface eth2
ip address 172.3.4.114/24
!
router bgp 300
neighbor 172.3.4.117 remote-as 200
!
line con 0
login line vty 0 39
login
!
end
>en
#
#show ip bgp
BGP table version is 3, local router ID is 192.168.52.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
*> 75.1.1.0/24 172.3.4.117 0 100 0 200 ?
*> 100.1.1.0/24 172.3.4.117 0 100 0 200 ?
Total number of prefixes 2
#show ip bgp vrf all
BGP table version is 3, local router ID is 192.168.52.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
*> 75.1.1.0/24 172.3.4.117 0 100 0 200 ?
*> 100.1.1.0/24 172.3.4.117 0 100 0 200 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.4, local AS number 300
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/ Down State/PfxRcd
172.3.4.117 4 200 382 414 3 0 0 00:42:54 2
Total number of neighbors 1
Total number of Established sessions 1
PRSP#show ip bgp neighbors
BGP neighbor is 172.3.4.117, remote AS 200, local AS 300, external link
BGP version 4, local router ID 192.168.52.4, remote router ID 172.3.4.117
BGP state = Established, up for 00:43: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 236 messages, 147 notifications, 0 in queue
Sent 415 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.3.4.114, Local port: 179
Foreign host: 172.3.4.117, Foreign port: 54753 Nexthop: 172.3.4.114 Nexthop global: :: Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:43:32, due to BGP Notification received
Notification Error Message: (OPEN Message Error/Bad Peer AS.)
В следующем примере CE1, PE1, PE2 и CE2 поддерживают 4-байтовые ASN.
Расширенное сообщество с 4-байтовым ASN
Примечание: PE1 и PE2 должны либо оба поддерживать 4-байтовые ASN, либо оба поддерживать 2-байтовые ASN. Поддержка комбинации одного PE с 4-байтовым ASN и одного PE с 2-байтовым ASN в настоящее время недоступна.
Топология
Рисунок 7-127: Расширенные сообщества — 4-байтовый ASN
CE1
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip address 172.3.4.115/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#bgp extended-asn-cap | Включить поддержку 4-октетного ASN. |
(config)#router bgp 100000 | Назначить значение ASN (100000 ) маршрутизатору. Диапазон ASN — <1-4294967295>. |
(config-router)#neighbor 172.4.5.116 remoteas 200000 | Указать IP-адрес соседа (172.4.5.116 ) и значение ASN соседа (200000 ). |
PE1
#configure terminal | Перейти в режим конфигурации. |
(config)#bgp extended-asn-cap | Включить поддерж ку 4-октетного ASN. Динамическое изменение с 2-байтовой на 4-байтовую поддержку или наоборот невозможно, если VRF не удален. |
(config)#ip vrf VRF1 | Указать имя VRF (VRF1 ) для создания. |
(config-vrf)#rd 1.1.1.1:200 | Назначить 4-байтовый идентификатор маршрута (RD) для VRF. |
(config-vrf)#route-target both 1.1.1.1:200 | Указать 4-октетный AS-специфичный или IPv4-специфичный транзитивный атрибут расширенного сообщества Route-Target. |
(config-vrf)#exit | Выйти из режима VRF и вернуться в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip vrf forwarding VRF1 | Привязать интерфейс (eth1) к VRF (VRF1 ). |
(config-if)#ip address 172.4.5.116/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#ip route vrf VRF1 50.1.1.0/24 eth1 | Создать статический маршрут VRF. |
(config)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 172.6.7.116/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200000 | Назначить значение ASN (200000 ) маршрутизатору. |
(config-router)#neighbor 172.6.7.117 remoteas 200000 | Указать IP-адрес соседа (PE2) (172.6.7.117 ) и значение ASN соседа (200000 ). В данном случае это iBGP-соединение, поэтому PE1 и PE2 находятся в одном AS. |
(config-router)#address-family vpnv4 unicast | Включить обмен информацией о маршрутах VPNv4 между PE-маршрутизаторами ISP и перейти в режим Address-Family-VPNv4. |
(config-router-af)#neighbor 172.6.7.117 activate | Включить обмен информацией о маршрутах с маршрутизатором-соседом. |
(config-router-af)#exit | Выйти из режима Address-Family-VPNv4. |
(config-router)#address-family ipv4 vrf VRF1 | Включить обмен информацией о маршрутах VRF между PE-маршрутизаторами ISP и перейти в режим Address-Family-VRF. |
(config-router-af)#neighbor 172.4.5.115 remote-as 100000 | Указать IP-адрес соседа (CE1) и значение ASN. |
(config-router-af)#neighbor 172.4.5.115 sendcommunity both | Включить атрибут расширенного сообщества для соседа. |
(config-router-af)#redistribute static | Настроить редистрибьюцию статических маршрутов. |
(config-router-af)#end | Выйти из режима Address-Family. |
PE2
#configure terminal | Перейти в режим конфигурации. |
(config)#bgp extended-asn-cap | Включить поддержку 4-октетного ASN. Динамическое изменение с 2-байтовой на 4-байтовую поддержку или наоборот невозможно, если VRF не удален. |
(config)#ip vrf VRF1 | Указать имя VRF (VRF1 ) для создания. |
(config-vrf)#rd 1.1.1.1:200 | Назначить 4-байтовый идентификатор маршрута (RD) для VRF. |
(config-vrf)#route-target both 1.1.1.1:200 | Указать 4-октетный AS-специфичный или IPv4-специфичный транзитивный атрибут расширенного сообщества Route-Target. |
(config-vrf)#exit | Выйти из режима VRF и вернуться в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip vrf forwarding VRF1 | Привязать интерфейс (eth1) к VRF (VRF1 ). |
(config-if)#ip address 172.3.4.117/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#ip route vrf VRF1 200.1.1.0/24 eth1 | Создать статический маршрут VRF. |
(config)#interface eth2 | Перейти в режим интерфейса. |
(config-if)#ip address 172.6.7.117/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#router bgp 200000 | Назначить значение ASN (200000 ) маршрутизатору. |
(config-router)#neighbor 172.6.7.116 remoteas 200000 | Указать IP-адрес соседа (PE1) (172.6.7.116 ) и значение ASN соседа (200000 ). В данном случае это iBGP-соединение, поэтому PE1 и PE2 находятся в одном AS. |
(config-router)#address-family vpnv4 unicast | Включить обмен информацией о маршрутах VPNv4 между PE-маршрутизаторами ISP и перейти в режим Address-Family-VPNv4. |
(config-router-af)#neighbor 172.6.7.116 activate | Включить обмен информацией о маршрутах с маршрутизатором-соседом. |
(config-router-af)#exit | Выйти из режима Address-Family-VPNv4. |
(config-router)#address-family ipv4 vrf VRF1 | Включить обмен информацией о маршрутах VRF между PE-маршрутизаторами ISP и перейти в режим Address-Family-VRF. |
(config-router-af)#neighbor 172.3.4.114 remote-as 300000 | Указать IP-адрес соседа (CE2) и значение ASN. |
(config-router-af)#neighbor 172.3.4.114 sendcommunity both | Включить атрибут расширенного сообщества для соседа. |
(config-router-af)#redistribute static | Настроить редистрибьюцию статических маршрутов. |
(config-router-af)#end | Выйти из режима Address-Family. |
CE2
#configure terminal | Перейти в режим конфигурации. |
(config)#interface eth1 | Перейти в режим интерфейса. |
(config-if)#ip address 172.3.4.114/24 | Настроить IP-адрес на этом интерфейсе. |
(config-if)#exit | Выйти из режима интерфейса. |
(config)#bgp extended-asn-cap | Включить поддержку 4-октетного ASN. |
(config)#router bgp 300000 | Назначить значение ASN (300000 ) маршрутизатору. |
(config-router)#neighbor 172.3.4.117 remoteas 200000 | Указать IP-адрес соседа (172.3.4.117 ) и значение ASN соседа (200000 ). |
Проверка
CE1
PRSP#show ip bgp
BGP table version is 3, 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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200000, local AS 100000, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:20: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) 4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 45 messages, 0 notifications, 0 in queue
Sent 47 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 58251 Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
BGP table version is 3, 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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100000
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.4.5.116 4 200000 46 48 3 0 0 00:21:12 2
Total number of neighbors 1
Total number of Established sessions 1
#clear bgp *
2022 Mar 22 06:16:56.414 : PRSP : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour
[172.4.5.116] Session down due to peer clear
P1
PRSP#show ip interface brief | include up
eth1 unassigned up up
eth0 192.168.52.2 up up
lo 127.0.0.1 up up
#configure terminal
(config)#interface eth1
(config-if)#ip address 172.4.5.115/24
(config-if)#exit
(config)#bgp extended-asn-cap
(config)#router bgp 100000
(config-router)#neighbor 172.4.5.116 remote-as 200000
(config-router)#
>en
#show ip bgp
BGP table version is 3, 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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200000, local AS 100000, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:20: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) 4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 45 messages, 0 notifications, 0 in queue
Sent 47 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 58251 Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
BGP table version is 3, 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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp sumar
#show ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100000
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.4.5.116 4 200000 46 48 3 0 0 00:21:12 2
Total number of neighbors 1
Total number of Established sessions 1
#clear bgp *
2022 Mar 22 06:16:56.414 : PRSP : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour
[172.4.5.116] Session down due to peer clear
**PE2**
PRSP#show ip interface brief | include up
eth1 unassigned up up
eth0 192.168.52.2 up up
lo 127.0.0.1 up up
PRSP#
PRSP#
PRSP#
#configure terminal
(config)#interface eth1
(config-if)#ip address 172.4.5.115/24
(config-if)#exit
(config)#bgp extended-asn-cap
(config)#router bgp 100000
(config-router)#neighbor 172.4.5.116 remote-as 200000
(config-router)#
>en
#show ip bgp
BGP table version is 3, 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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp neighbors
BGP neighbor is 172.4.5.116, remote AS 200000, local AS 100000, external link
BGP version 4, local router ID 192.168.52.2, remote router ID 172.4.5.116
BGP state = Established, up for 00:20: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)
4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 45 messages, 0 notifications, 0 in queue
Sent 47 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 3, neighbor version 3
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 1; dropped 0
Local host: 172.4.5.115, Local port: 179
Foreign host: 172.4.5.116, Foreign port: 58251 Nexthop: 172.4.5.115
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
#show ip bgp vrf all
BGP table version is 3, 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
*> 50.1.1.0/24 172.4.5.116 0 100 0 200000 ?
*> 200.1.1.0 172.4.5.116 0 100 0 200000 ?
Total number of prefixes 2
#sh ip bgp summary vrf all
BGP router identifier 192.168.52.2, local AS number 100000
BGP table version is 3
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.4.5.116 4 200000 46 48 3 0 0 00:21:12 2
Total number of neighbors 1
Total number of Established sessions 1
#clear bgp *
2022 Mar 22 06:16:56.414 : PRSP : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour
[172.4.5.116] Session down due to peer clear
**CE2**
#show ip interface brief | include up
eth2 unassigned up up
eth0 192.168.52.4 up up
lo 127.0.0.1 up up
#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
(config)#interface eth2
(config-if)#ip address 172.3.4.114/24
(config-if)#exit
(config)#bgp extended-asn-cap
(config)#router bgp 300000
(config-router)#neighbor 172.3.4.117 remote-as 200000
(config-router)#end
#clear bgp *
2022 Mar 22 06:17:03.318 : PRSP : BGP : CRITI : [BGP_OPR_NEIGH_STATE_DOWN_2]: Neighbour
[172.3.4.117] Session down due to peer clear
#show ip bgp vpnv4 all
#show ip bgp
BGP table version is 4, local router ID is 192.168.52.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
*> 50.1.1.0/24 172.3.4.117 0 100 0 200000 ?
*> 200.1.1.0 172.3.4.117 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp vrf all
BGP table version is 4, local router ID is 192.168.52.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
*> 50.1.1.0/24 172.3.4.117 0 100 0 200000 ?
*> 200.1.1.0 172.3.4.117 0 100 0 200000 ?
Total number of prefixes 2
#show ip bgp summary vrf all
BGP router identifier 192.168.52.4, local AS number 300000
BGP table version is 4
1 BGP AS-PATH entries
0 BGP community entries
Neighbor V AS MsgRcv MsgSen TblVer InQ OutQ Up/Down State/ PfxRcd
172.3.4.117 4 200000 33 30 4 0 0 00:04:34 2
Total number of neighbors 1
Total number of Established sessions 1
#show ip bgp neighbors
BGP neighbor is 172.3.4.117, remote AS 200000, local AS 300000, external link
BGP version 4, local router ID 192.168.52.4, remote router ID 172.3.4.117
BGP state = Established, up for 00:04:40
Last read 00:00:10, hold time is 90, keepalive interval is 30 seconds
Neighbor capabilities:
Route refresh: advertised and received (old and new)
4-Octet ASN Capability: advertised and received
Address family IPv4 Unicast: advertised and received
Received 33 messages, 0 notifications, 0 in queue
Sent 29 messages, 1 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 4, neighbor version 4
Index 1, Offset 0, Mask 0x2
Community attribute sent to this neighbor (both)
2 accepted prefixes
0 announced prefixes
Connections established 2; dropped 1
Local host: 172.3.4.114, Local port: 179
Foreign host: 172.3.4.117, Foreign port: 49361 Nexthop: 172.3.4.114
Nexthop global: ::
Nexthop local: ::
BGP connection: non shared network
Last Reset: 00:04:40, due to BGP Notification sent
Notification Error Message: (Cease/Administratively Reset.)