次の例は、vrf_trans と vrf_user の 2 つの VRF を、同じルータ上で相互間のセッションで設定する方法を示します。VRF 単位での BGP ルータ ID は、個別の IPv4 アドレス ファミリの下で手動で設定されます。show ip bgp vpnv4 コマンドを使用すると、ルータ ID が VRF 単位に設定されていることを確認できます。このコンフィギュレーションは、グローバル コンフィギュレーション モードで開始されます。
ip vrf vrf_trans
rd 45000:1
route-target export 50000:50
route-target import 40000:1
!
ip vrf vrf_user
rd 65500:1
route-target export 65500:1
route-target import 65500:1
!
interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
router bgp 45000
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 192.168.3.1 remote-as 45000
neighbor 192.168.3.1 update-source Loopback0
!
address-family vpnv4
neighbor 192.168.3.1 activate
neighbor 192.168.3.1 send-community extended
exit-address-family
!
address-family ipv4 vrf vrf_user
redistribute connected
neighbor 172.22.1.1 remote-as 40000
neighbor 172.22.1.1 local-as 50000 no-prepend
neighbor 172.22.1.1 ebgp-multihop 2
neighbor 172.22.1.1 activate
neighbor 172.22.1.1 allowas-in 1
no auto-summary
no synchronization
bgp router-id 10.99.1.1
exit-address-family
!
address-family ipv4 vrf vrf_trans
redistribute connected
neighbor 172.23.1.1 remote-as 50000
neighbor 172.23.1.1 local-as 40000 no-prepend
neighbor 172.23.1.1 ebgp-multihop 2
neighbor 172.23.1.1 activate
neighbor 172.23.1.1 allowas-in 1
no auto-summary
no synchronization
bgp router-id 10.99.1.2
exit-address-family
コンフィギュレーションの後、show ip bgp vpnv4 all コマンドの出力には、VRF 名の次に表示されるルータ ID が表示されます。
Router# show ip bgp vpnv4 all
BGP table version is 43, local router ID is 10.1.1.1
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: 45000:1 (default for vrf vrf_trans) VRF Router ID 10.99.1.2
*> 172.22.0.0 0.0.0.0 0 32768 ?
r> 172.23.0.0 172.23.1.1 0 0 3 1 ?
*>i10.21.1.1/32 192.168.3.1 0 100 0 2 i
*> 10.52.1.0/24 172.23.1.1 0 3 1 ?
*> 10.52.2.1/32 172.23.1.1 0 3 1 3 i
*> 10.52.3.1/32 172.23.1.1 0 3 1 3 i
*> 10.99.1.1/32 172.23.1.1 0 0 3 1 ?
*> 10.99.2.2/32 0.0.0.0 0 32768 ?
Route Distinguisher: 50000:1
*>i10.21.1.1/32 192.168.3.1 0 100 0 2 i
Route Distinguisher: 65500:1 (default for vrf vrf_user) VRF Router ID 10.99.1.1
r> 172.22.0.0 172.22.1.1 0 0 2 1 ?
*> 172.23.0.0 0.0.0.0 0 32768 ?
*> 10.21.1.1/32 172.22.1.1 0 2 1 2 i
*>i10.52.1.0/24 192.168.3.1 0 100 0 ?
*>i10.52.2.1/32 192.168.3.1 0 100 0 3 i
*>i10.52.3.1/32 192.168.3.1 0 100 0 3 i
*> 10.99.1.1/32 0.0.0.0 0 32768 ?
*> 10.99.2.2/32 172.22.1.1 0 0 2 1 ?
指定された VRF の show ip bgp vpnv4 vrf コマンドの出力には、出力ヘッダーにルータ ID が表示されます。
Router# show ip bgp vpnv4 vrf vrf_user
BGP table version is 43, local router ID is 10.99.1.1
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: 65500:1 (default for vrf vrf_user) VRF Router ID 10.99.1.1
r> 172.22.0.0 172.22.1.1 0 0 2 1 ?
*> 172.23.0.0 0.0.0.0 0 32768 ?
*> 10.21.1.1/32 172.22.1.1 0 2 1 2 i
*>i10.52.1.0/24 192.168.3.1 0 100 0 ?
*>i10.52.2.1/32 192.168.3.1 0 100 0 3 i
*>i10.52.3.1/32 192.168.3.1 0 100 0 3 i
*> 10.99.1.1/32 0.0.0.0 0 32768 ?
*> 10.99.2.2/32 172.22.1.1 0 0 2 1 ?
指定された VRF の show ip bgp vpnv4 vrf summary コマンドの出力には、出力の最初の行にルータ ID が表示されます。
Router# show ip bgp vpnv4 vrf vrf_user summary
BGP router identifier 10.99.1.1, local AS number 45000
BGP table version is 43, main routing table version 43
8 network entries using 1128 bytes of memory
8 path entries using 544 bytes of memory
16/10 BGP path/bestpath attribute entries using 1856 bytes of memory
6 BGP AS-PATH entries using 144 bytes of memory
3 BGP extended community entries using 72 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 3744 total bytes of memory
BGP activity 17/0 prefixes, 17/0 paths, scan interval 15 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
172.22.1.1 4 2 20 21 43 0 0 00:12:33 3
パスが VRF で送信されると、指定された VRF とネットワーク アドレスの show ip bgp vpnv4 vrf コマンドの出力に、正しいルータ ID が表示されます。
Router# show ip bgp vpnv4 vrf vrf_user 172.23.0.0
BGP routing table entry for 65500:1:172.23.0.0/8, version 22
Paths: (1 available, best #1, table vrf_user)
Advertised to update-groups:
2 3
Local
0.0.0.0 from 0.0.0.0 (10.99.1.1)
Origin incomplete, metric 0, localpref 100, weight 32768, valid, sourced, best
Extended Community: RT:65500:1