CCIE lab対策(2.4.b Inter-AS L3VPN)その4 Inter-AS option D(AB)

Inter-AS option D(AB) が理解できたので自分のメモ用にアウトプットします。

1. Inter-AS Option D(AB) とは

Inter-AS Option D(AB) とは、Inter-AS Link で VRFとMP-BGP を使って end-to-end の通信を行う方式です。
名称から想像できるように Inter-AS option A と Inter-AS option B を両方 hybrid で活用するのが特徴です。もう少し具体的にいうとControlplane を Inter-AS option B が担い、Dataplane を Inter-AS option A が担います。つまりデータの流れる箇所が分離されているという点が特徴的です。

今回は先人たちの教え(個人ブログ)から多くを学び、具体的な configuration を CCO で見つけたので比較的短時間でできました。

ポイントとしては、以下の4点です。Inter-AS option D の肝は④です。

① Inter-AS option A を定義する
→ ASBR-ASBR 間も VRF の定義をする
② ASBR-PE間で next-hop-self を定義する
③ Inter-AS option B を定義する
→ ASBR-ASBR 間で MP-BGP の定義をする
④ ASBR-ASBR 間の BGP・VRF で inter-as-hybrid の定義をする

2. Topology

CE-PE-ASBR-ASBR-PE-CE を含めた構成としました。

一般的にはサブインターフェースを使って Dataplane と Controlplane を分けるようですが、パケットを見たかったので敢えて物理インターフェースで Inter-AS Link を分離しました。

ということで今回はIPv6なしです。
community.cisco.com
ということで今回はIOS-XRを構築対象としません。

IOS-XE version

e_CE1#show version 
Cisco IOS XE Software, Version 17.03.04a

3. Config

i_N1【IOS-XE】config

hostname i_N1
!
vrf definition A
 rd 1:1
 !
 address-family ipv4
  route-target export 100:1
  route-target import 200:1
 exit-address-family
!
no ip domain lookup
!
mpls label range 100100 100199
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
 ip router isis AS1
!
interface GigabitEthernet1
 vrf forwarding A
 ip address 10.10.20.1 255.255.255.0
!
interface GigabitEthernet2
 ip address 10.1.2.1 255.255.255.0
 ip router isis AS1
 isis network point-to-point 
!
router isis AS1
 net 49.0001.0000.0000.0001.00
 is-type level-2-only
 metric-style wide
 mpls ldp autoconfig
!
router bgp 1
 bgp router-id 1.1.1.1
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 2.2.2.2 remote-as 1
 neighbor 2.2.2.2 update-source Loopback0
 !
 address-family ipv4
 exit-address-family
 !
 address-family vpnv4
  neighbor 2.2.2.2 activate
  neighbor 2.2.2.2 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf A
  neighbor 10.10.20.2 remote-as 100
  neighbor 10.10.20.2 activate
 exit-address-family
!
end

i_N2【IOS-XE】config

hostname i_N2
!
vrf definition A
 rd 1:2
 !
 address-family ipv4
  route-target export 200:1
  route-target import 100:1
  inter-as-hybrid next-hop 10.10.30.3
 exit-address-family
!
no ip domain lookup
!
mpls label range 100200 100299
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
 ip router isis AS1
!
interface GigabitEthernet1
 ip address 10.1.2.2 255.255.255.0
 ip router isis AS1
 isis network point-to-point 
!
interface GigabitEthernet2
 vrf forwarding A
 ip address 10.10.30.2 255.255.255.0
!
interface GigabitEthernet3
 ip address 10.10.40.2 255.255.255.0
 mpls bgp forwarding
!         
router isis AS1
 net 49.0001.0000.0000.0002.00
 is-type level-2-only
 metric-style wide
 mpls ldp autoconfig
!
router bgp 1
 bgp router-id 2.2.2.2
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 1.1.1.1 remote-as 1
 neighbor 1.1.1.1 update-source Loopback0
 neighbor 10.10.40.3 remote-as 2
 !
 address-family ipv4
 exit-address-family
 !
 address-family vpnv4
  neighbor 1.1.1.1 activate
  neighbor 1.1.1.1 send-community extended
  neighbor 1.1.1.1 next-hop-self
  neighbor 10.10.40.3 activate
  neighbor 10.10.40.3 send-community extended
  neighbor 10.10.40.3 inter-as-hybrid
 exit-address-family
!
end

i_N3【IOS-XE】config

hostname i_N3
!
vrf definition B
 rd 2:3
 !
 address-family ipv4
  route-target export 100:1
  route-target import 200:1
  inter-as-hybrid next-hop 10.10.30.2
 exit-address-family
!
no ip domain lookup
!
mpls label range 200300 200399
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
 ip router isis AS2
!
interface GigabitEthernet1
 ip address 10.3.4.3 255.255.255.0
 ip router isis AS2
 isis network point-to-point 
!
interface GigabitEthernet2
 vrf forwarding B
 ip address 10.10.30.3 255.255.255.0
!
interface GigabitEthernet3
 ip address 10.10.40.3 255.255.255.0
 mpls bgp forwarding
!
router isis AS2
 net 49.0002.0000.0000.0003.00
 is-type level-2-only
 metric-style wide
 mpls ldp autoconfig
!
router bgp 2
 bgp router-id 3.3.3.3
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 4.4.4.4 remote-as 2
 neighbor 4.4.4.4 update-source Loopback0
 neighbor 10.10.40.2 remote-as 1
 !
 address-family ipv4
 exit-address-family
 !        
 address-family vpnv4
  neighbor 4.4.4.4 activate
  neighbor 4.4.4.4 send-community extended
  neighbor 4.4.4.4 next-hop-self
  neighbor 10.10.40.2 activate
  neighbor 10.10.40.2 send-community extended
  neighbor 10.10.40.2 inter-as-hybrid
 exit-address-family
!
end

i_N4【IOS-XE】config

hostname i_N4
!
vrf definition B
 rd 2:4
 !
 address-family ipv4
  route-target export 200:1
  route-target import 100:1
 exit-address-family
!
no ip domain lookup
!
mpls label range 200400 200499
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
 ip router isis AS2
!
interface GigabitEthernet1
 vrf forwarding B
 ip address 10.10.80.1 255.255.255.0
!
interface GigabitEthernet2
 ip address 10.3.4.4 255.255.255.0
 ip router isis AS2
 isis network point-to-point 
!
router isis AS2
 net 49.0002.0000.0000.0004.00
 is-type level-2-only
 metric-style wide
 mpls ldp autoconfig
!
router bgp 2
 bgp router-id 4.4.4.4
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 3.3.3.3 remote-as 2
 neighbor 3.3.3.3 update-source Loopback0
 !
 address-family ipv4
 exit-address-family
 !
 address-family vpnv4
  neighbor 3.3.3.3 activate
  neighbor 3.3.3.3 send-community extended
 exit-address-family
 !
 address-family ipv4 vrf B
  neighbor 10.10.80.2 remote-as 200
  neighbor 10.10.80.2 activate
 exit-address-family
!
end

i_CE1【IOS-XE】config

hostname i_CE1
!
no ip domain lookup
!
interface Loopback0
 ip address 100.100.100.100 255.255.255.255
!
interface GigabitEthernet1
 ip address 10.10.20.2 255.255.255.0
!
router bgp 100
 bgp router-id 100.100.100.100
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 10.10.20.1 remote-as 1
 !
 address-family ipv4
  network 100.100.100.100 mask 255.255.255.255
  neighbor 10.10.20.1 activate
 exit-address-family
!
end

i_CE2【IOS-XE】config

hostname i_CE2
!
no ip domain lookup
!
interface Loopback0
 ip address 200.200.200.200 255.255.255.255
!
interface GigabitEthernet1
 ip address 10.10.80.2 255.255.255.0
!
router bgp 200
 bgp router-id 200.200.200.200
 bgp log-neighbor-changes
 no bgp default ipv4-unicast
 neighbor 10.10.80.1 remote-as 2
 !
 address-family ipv4
  network 200.200.200.200 mask 255.255.255.255
  neighbor 10.10.80.1 activate
 exit-address-family
!
end

4. 構築の要点

4.1 Inter-AS option A

ASBR-ASBR 間も VRF の定義をすること
Route Distinguisher:RD は識別子なので何でも良いし、route-target:RT の注意点としては、対向のCEに対して使っているVRFとASBR間のVRF で import と export の整合性があれば良いです。
詳しくは以下を参照ください。
chimay-wh.hatenablog.com

4.2 next-hop-self

ASBR-PE間で next-hop-self を定義すること 詳しくは以下を参照ください。
chimay-wh.hatenablog.com
5.1 next-hop-self で説明しています。

4.3 Inter-AS option B

ASBR-ASBR 間で MP-BGP の定義をすること
こちらは Controlplane 相当になる点に注意してください。

4.4 inter-as-hybrid(VRF)

ASBR-ASBR 間で inter-as-hybrid の定義をします。
オンラインヘルプ(一部出力を省略しています)に身を任せます。

i_N2(config)#vrf definition A            
i_N2(config-vrf)#address-family ipv4 unicast 
i_N2(config-vrf-af)#?
VPN Routing/Forwarding address-family configuration commands:
  inter-as-hybrid      Inter AS hybrid mode

i_N2(config-vrf-af)#inter-as-hybrid ?
  next-hop  Set next-hop address
  <cr>      <cr>

i_N2(config-vrf-af)#inter-as-hybrid next-hop ?
  A.B.C.D  IP Address

i_N2(config-vrf-af)#inter-as-hybrid next-hop 10.10.30.3 ?
  <cr>  <cr>

i_N2(config-vrf-af)#inter-as-hybrid next-hop 10.10.30.3 

ここで指定する NEXT_HOP は Dataplane であることが注意点です。
つまり ASBR 間の VRF の IP アドレスを指定します。

4.5 inter-as-hybrid(BGP)

ASBR-ASBR 間で inter-as-hybrid の定義をします。
オンラインヘルプ(一部出力を省略しています)に身を任せます。

i_N2(config)#router bgp 1                 
i_N2(config-router)#address-family vpnv4 unicast 
i_N2(config-router-af)#neighbor 10.10.40.3 ?
  inter-as-hybrid              Inter AS Hybrid mode
          
i_N2(config-router-af)#neighbor 10.10.40.3 inter-as-hybrid ?
  <cr>  <cr>

i_N2(config-router-af)#neighbor 10.10.40.3 inter-as-hybrid 

ここで指定する neighbor は Controlplane であることが注意点です。
つまり ASBR 間の MP-BGP で使う IP アドレスを指定します。

5. vpnv4 確認

ルーティング情報と疎通確認はこのようになりました。

i_CE1#show ip route bgp | b Gate
Gateway of last resort is not set

      200.200.200.0/32 is subnetted, 1 subnets
B        200.200.200.200 [20/0] via 10.10.20.1, 4d17h
i_CE1#
i_CE1#ping 200.200.200.200 source 100.100.100.100
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.200, timeout is 2 seconds:
Packet sent with a source address of 100.100.100.100 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/29/142 ms
i_CE1#
i_CE1#traceroute 200.200.200.200 source 100.100.100.100
Type escape sequence to abort.
Tracing the route to 200.200.200.200
VRF info: (vrf in name/id, vrf out name/id)
  1 10.10.20.1 2 msec 1 msec 1 msec
  2 10.10.30.2 [MPLS: Label 100203 Exp 0] 16 msec 4 msec 2 msec
  3 10.10.30.3 2 msec 1 msec 1 msec
  4 10.10.80.1 [MPLS: Label 200401 Exp 0] 4 msec 2 msec 2 msec
  5 10.10.80.2 5 msec *  32 msec
i_CE1#

Inter-AS option D(AB) は Controlplane と Dataplane に分かれています。Controlplane は BGP の show コマンドで確認することができ、Dataplane は CEF の show コマンドで確認することができます。
i_N1(PEルータ)からCE2’s Loopback0(200.200.200.200/32)に到達するには、
RD 1:1 で route-target 200:1 を使う(ソースのRD 1:2)
NEXT_HOP は 2.2.2.2(Label 100203)

BGP-UPDATEパケットも見てみましょう。show コマンドと一致していることが分かります。

i_N2(ASBRルータ)ではこのようになりました。

パケットも見てみましょう。show コマンドと一致していることが分かります。

i_N3(ASBRルータ)ではこのようになりました。

パケットも見てみましょう。show コマンドと一致していることが分かります。

i_N4(PEルータ)ではこのようになりました。

6. 参考URL

① MPLS VPN--Inter-AS Option AB
content.cisco.com

② [Multi-AS Segment Routing 検証連載 #2] SR-MPLS L3VPN in Multi-AS
engineers.ntt.com

③ Inter-AS Option D(AB)
gemunopedy.hatenadiary.com

④ CCDE – Inter AS L3 VPNs
lostintransit.se

⑤ MPLS L3VPN Inter-AS Option D
learningnetwork.cisco.com

⑥ ASR 9000 with MPLS L3VPN inter-AS option AB
community.cisco.com

Inter-AS option A、B、C、D と4回に分けて記事を書いてきました。これで一旦、Inter-AS Option シリーズはお終いです。

最後までお読みいただきありがとうございました!