まず最初に
この検証内容は、2011年に MPLS VPN についてラボで確認した時の結果をローカルのwikiサーバーに保存していました。その後、誰かの参考になったのかどうかは分からないのですが、もうwikiサーバーも動いていませんので、誰もこの内容を見ることもないと思います。でも、最近になって自分でも見直すことがありましたので、少しでも参考になればと思い、こちらにアップすることにしました。
Topology
summary
ラベル割り当てのポイント
- R6から見ると、120.0.0.1向けのラベルは、eBGPピア(R3)の10.1.1.10から、VPN用のラベルが割り当てられる。
- R3で"show ip bgp vpnv4 all 120.0.0.1"を見ると、IN/OUTで2005/4006とswapになっている。
どのような場合において、no bgp default route-target filter
が必要になるか
- AS間でMPLS VPNを構成している。
- ASBRはPEではない。<=これは、ASBR上では、VRFが設定されていないという意味
configのポイント
- VPNv4 peerは、ASBR間、ASBR-PE間で設定する
- ASBR間は、LDP(mpls ip)を設定する必要がない
- VRFは、PE上しか設定していない
- 各AS内のIGPはなんでも良い
Consideration
Configuration Notes
- eBGP between both ASs cannot be multihop.
- LDP or TDP is not required between both ASs.
確かに、R2-R3間は、LDPが動作していない。
なのに、どうやってラベルを交換しているのか?
Configuring Peering with Directly Connected Interfaces Between ASBRs
When External Border Gateway Protocol (EBGP) sessions come up, BGP automatically generates the mpls bgp forwarding
command on the connecting interface.
実際にupするときには、下記のメッセージが出力される。
*Mar 8 15:43:02.659: %BGP-5-ADJCHANGE: neighbor 10.1.1.10 Up
*Mar 8 15:43:02.659: %BGP_LMM-6-AUTOGEN1: The mpls bgp forwarding command has been configured on interface: Ethernet3/0
インタフェースのconfigを見ると、mpls bgp forwarding
が自動的に追加される。
interface Ethernet3/0
ip address 10.1.1.9 255.255.255.252
mpls bgp forwarding
LDPのneighborの見え方も少し違う。BGPがYesになっている!
R3#show mpls interfaces
Interface IP Tunnel BGP Static Operational
Ethernet3/0 No No Yes No Yes
Ethernet4/0 Yes (ldp) No No No Yes
- A common IGP is not required between both ASs. Each AS can use its own distinct IGP.
これは、AS1はOSPF
、AS2はISIS
という感じで、それぞれのAS内で異なるIGPが利用できる。
- BGP creates a connected host route for the eBGP peer in the remote AS once the session that needs to be injected into the IGP of each AS comes up.
- Unless the ASBR is a PE for every VRF that you want to exchange, you will need to configure the no bgp default route-target filter command to make sure that the ASBR accepts the BGP VPNv4 prefixes from the other PE routers inside the AS. The default behavior is to deny incoming VPNv4 prefixes that are not imported into any local VRF.
ASBRにVRFが設定されていなくても、ASBRが同じAS内のPEルータからのVPNv4ルートを受信した場合、下記のコマンドを有効にすることにより受信できる。
no bgp default route-target filter
これは、異なるAS間でサブインターフェースか、複数のインタフェースを使用して、Back-to-Back VRF Methodを利用するのが、最もシンプルな構成になる。
Life of a ping
R6
- IN : [IP:120.0.0.1]
- OUT: [3001][2005][IP:120.0.0.1]
VPNラベルは、R2が指定した2005になっている。
R6#show ip cef vrf one 120.0.0.1
120.0.0.0/24
nexthop 10.1.1.21 Ethernet4/0 label 3001 2005
R6#
まず、VPNラベルを確認して見る。
R6#show ip bgp vpnv4 vrf one 120.0.0.1
BGP routing table entry for 1:1:120.0.0.0/24, version 4
Paths: (1 available, best #1, table one)
Not advertised to any peer
1
10.1.1.10 (metric 30) from 10.10.10.3 (10.10.10.3)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Extended Community: RT:1:1
mpls labels in/out nolabel/2005 <<<===!!! 2005が割り当てられている。
R6#
10.1.1.10宛のラベルを見ると、3001になっている。
R6#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
6001 3001 10.1.1.10/32 0 Et4/0 10.1.1.21
6002 Pop Label 10.10.10.3/32 0 Et4/0 10.1.1.21
6003 Pop Label 10.1.1.8/30 0 Et4/0 10.1.1.21
6004 No Label 220.0.0.0/24[V] 1140 aggregate/one
R6#
- VPNラベルを確認するときは、show ip bgp vpnv4 vrf name xxx.xxx.xxx.xxx
- 転送ラベルを確認するときは、そのルートをadvertiseしたアドレス(10.1.1.10)のforwarding-table
R3
- IN : [3001][2005][IP:120.0.0.1]
- OUT: [2005][IP:120.0.0.1]
3001をpop。3001は、10.1.1.10向けになっている。
R3#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
3001 Pop Label 10.1.1.10/32 1180 Et3/0 10.1.1.10
3002 Pop Label 10.10.10.6/32 0 Et4/0 10.1.1.22
3003 6004 1:1:220.0.0.0/24 1180 Et4/0 10.1.1.22
R3#
R2
- IN : [2005][IP:120.0.0.1]
- OUT: [1001][4006][IP:120.0.0.1]
2005を4006にswap
R2#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
2001 Pop Label 10.1.1.9/32 1180 Et3/0 10.1.1.9
2002 Pop Label 10.10.10.1/32 0 Et0/0 10.1.1.1
2003 Pop Label 10.1.1.12/30 0 Et0/0 10.1.1.1
2004 1001 10.10.10.4/32 0 Et0/0 10.1.1.1
2005 4006 1:1:120.0.0.0/24 1220 Et0/0 10.1.1.1
R2#
このswapは、下記のコマンドで確認できる。
R2#show ip bgp vpnv4 all 120.0.0.1
BGP routing table entry for 1:1:120.0.0.0/24, version 2
Paths: (1 available, best #1, no table)
Advertised to update-groups:
1
Local
10.10.10.4 (metric 30) from 10.10.10.4 (10.10.10.4)
Origin incomplete, metric 0, localpref 100, valid, internal, best
Extended Community: RT:1:1
mpls labels in/out 2005/4006 <<<===!!!! 2005を4006にswap
R2#
また、10.10.10.4向けのラベルが1001になっているので、VPNラベルに続いて[1001]がpushされる。
R1
- IN : [1001][4006][IP:120.0.0.1]
- OUT: [4006][IP:120.0.0.1]
1001がpopされる。
R1#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
1001 Pop Label 10.10.10.4/32 5985 Et1/0 10.1.1.14
1002 2001 10.1.1.9/32 1220 Et0/0 10.1.1.2
1003 Pop Label 10.10.10.2/32 4853 Et0/0 10.1.1.2
1004 Pop Label 10.1.1.8/30 0 Et0/0 10.1.1.2
R1#
R4
- IN : [4006][IP:120.0.0.1]
- OUT: [IP:120.0.0.1]
4006がpopされる。
R4#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop
Label Label or Tunnel Id Switched interface
4001 Pop Label 10.10.10.1/32 0 Et1/0 10.1.1.13
4002 Pop Label 10.1.1.0/30 0 Et1/0 10.1.1.13
4003 1002 10.1.1.9/32 0 Et1/0 10.1.1.13
4004 1003 10.10.10.2/32 0 Et1/0 10.1.1.13
4005 1004 10.1.1.8/30 0 Et1/0 10.1.1.13
4006 No Label 120.0.0.0/24[V] 1140 aggregate/one
R4#
config
R2
R2#show running-config
interface Loopback0
ip address 10.10.10.2 255.255.255.255
ip router isis
!
interface Ethernet0/0
ip address 10.1.1.2 255.255.255.252
ip router isis
mpls ip
!
interface Ethernet3/0
ip address 10.1.1.10 255.255.255.252
mpls bgp forwarding
!
router isis
net 47.0000.5555.5555.5555.00
metric-style wide
redistribute connected metric 20
!
router bgp 1
no bgp default ipv4-unicast
no bgp default route-target filter
bgp log-neighbor-changes
neighbor 10.1.1.9 remote-as 2
neighbor 10.10.10.4 remote-as 1
neighbor 10.10.10.4 update-source Loopback0
!
address-family ipv4
no synchronization
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.1.1.9 activate
neighbor 10.1.1.9 send-community both
neighbor 10.10.10.4 activate
neighbor 10.10.10.4 send-community extended
exit-address-family
R3
R3#show running-config
interface Loopback0
ip address 10.10.10.3 255.255.255.255
ip router isis
!
interface Ethernet3/0
ip address 10.1.1.9 255.255.255.252
mpls bgp forwarding
!
interface Ethernet4/0
ip address 10.1.1.21 255.255.255.252
ip router isis
mpls ip
!
router isis
net 47.0000.2222.2222.2222.00
metric-style wide
redistribute connected metric 20
!
router bgp 2
no bgp default ipv4-unicast
no bgp default route-target filter
bgp log-neighbor-changes
neighbor 10.1.1.10 remote-as 1
neighbor 10.10.10.6 remote-as 2
neighbor 10.10.10.6 update-source Loopback0
!
address-family ipv4
no synchronization
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.1.1.10 activate
neighbor 10.1.1.10 send-community both
neighbor 10.10.10.6 activate
neighbor 10.10.10.6 send-community extended
exit-address-family
R1
R1#show run
interface Loopback0
ip address 10.10.10.1 255.255.255.255
ip router isis
!
interface Ethernet0/0
ip address 10.1.1.1 255.255.255.252
ip router isis
mpls ip
!
interface Ethernet1/0
ip address 10.1.1.13 255.255.255.252
ip router isis
mpls ip
!
router isis
net 47.0000.3333.3333.3333.00
metric-style wide
R4
R4#show run
ip vrf one
rd 1:1
route-target export 1:1
route-target import 1:1
!
interface Loopback0
ip address 10.10.10.4 255.255.255.255
ip router isis
!
interface Ethernet1/0
ip address 10.1.1.14 255.255.255.252
ip router isis
mpls ip
!
interface Ethernet2/0
ip vrf forwarding one
ip address 120.0.0.1 255.255.255.0
!
router isis
net 47.0000.7777.7777.7777.00
metric-style wide
!
router bgp 1
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.10.10.2 remote-as 1
neighbor 10.10.10.2 update-source Loopback0
!
address-family ipv4
no synchronization
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.10.10.2 activate
neighbor 10.10.10.2 send-community both
exit-address-family
!
address-family ipv4 vrf one
no synchronization
redistribute connected
exit-address-family
R6
R6#show run
ip vrf one
rd 1:1
route-target export 1:1
route-target import 1:1
!
interface Loopback0
ip address 10.10.10.6 255.255.255.255
ip router isis
!
interface Ethernet4/0
ip address 10.1.1.22 255.255.255.252
ip router isis
mpls ip
!
interface Ethernet5/0
ip vrf forwarding one
ip address 220.0.0.1 255.255.255.0
!
router isis
net 47.0000.5555.5555.5555.00
metric-style wide
!
router bgp 2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.10.10.3 remote-as 2
neighbor 10.10.10.3 update-source Loopback0
!
address-family ipv4
no synchronization
redistribute connected
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.10.10.3 activate
neighbor 10.10.10.3 send-community both
exit-address-family
!
address-family ipv4 vrf one
no synchronization
redistribute connected
exit-address-family
その他
IPv4 unicastのpeerが無い場合にBGP peerの状態を確認する
- Ipv4 unicastのneighborを設定していない場合は、
show ip bgp summary
でneighborが表示されない。
no bgp default ipv4-unicast
を設定すると、ipv4 unicastのneighborが張れない
R3#show ip bgp summary
R3#
VPNv4のpeer
R3#show ip bgp vpnv4 all summary
BGP router identifier 10.10.10.3, local AS number 2
BGP table version is 5, main routing table version 5
2 network entries using 304 bytes of memory
2 path entries using 104 bytes of memory
2/2 BGP path/bestpath attribute entries using 264 bytes of memory
1 BGP AS-PATH entries using 24 bytes of memory
1 BGP extended community entries using 24 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 720 total bytes of memory
BGP activity 2/0 prefixes, 3/1 paths, scan interval 60 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
10.1.1.10 4 1 384 382 5 0 0 05:44:37 1
10.10.10.6 4 2 1772 1777 5 0 0 1d02h 1
R3#
R2とR3がRoute Reflectorの場合
下記の様に、R2,R3がRRとして設定されている場合、RRはデフォルトでroute-targets
をフィルタしないため、no bgp default route-target filter
を設定しなくても動作する。
R2
router bgp 1
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.1.1.9 remote-as 2
neighbor 10.10.10.4 remote-as 1
neighbor 10.10.10.4 update-source Loopback0
!
address-family ipv4
no synchronization
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.1.1.9 activate
neighbor 10.1.1.9 send-community both
neighbor 10.10.10.4 activate
neighbor 10.10.10.4 send-community extended
neighbor 10.10.10.4 route-reflector-client <<<<<=====!!!!!
exit-address-family
R3
router bgp 2
no bgp default ipv4-unicast
bgp log-neighbor-changes
neighbor 10.1.1.10 remote-as 1
neighbor 10.10.10.6 remote-as 2
neighbor 10.10.10.6 update-source Loopback0
!
address-family ipv4
no synchronization
no auto-summary
exit-address-family
!
address-family vpnv4
neighbor 10.1.1.10 activate
neighbor 10.1.1.10 send-community both
neighbor 10.10.10.6 activate
neighbor 10.10.10.6 send-community extended
neighbor 10.10.10.6 route-reflector-client <<<<<=====!!!!!
exit-address-family
traceroute
R6#traceroute vrf one 120.0.0.1
Type escape sequence to abort.
Tracing the route to 120.0.0.1
1 10.1.1.21 [MPLS: Labels 3001/2005 Exp 0] 4 msec 4 msec 4 msec
2 10.1.1.10 [MPLS: Label 2005 Exp 0] 0 msec 4 msec 4 msec
3 10.1.1.1 [MPLS: Labels 1001/4006 Exp 0] 0 msec 4 msec 0 msec
4 120.0.0.1 4 msec 0 msec *
R6#