はじめに
CCNP ENCOR勉強中に、VRFの学習環境をCMLで構築したので備忘録として残しておきます。
今回は5台X型構成で、VRFで分離し、OSPFで動的ルーティングを組んでみました。
検証内容
- X型構成でのVRF設計
- VRF別OSPF設定(プロセスID分離)
- 同一IPアドレスでのOSPF動作確認
- VRF間の完全分離検証
環境
今回の検証環境
- Cisco Modeling Labs (CML-Free)
- IOL (IOS on Linux) ルータ × 5台
学習範囲:
CCNP ENCOR 2.2.a VRFの基本動作確認
構成
設定手順
R1(VRF-A-1)設定
configure terminal
hostname R1-VRFA-1
interface Ethernet0/0
ip address 192.168.10.10 255.255.255.0
description VRF-A to R2
interface Loopback0
ip address 10.1.1.1 255.255.255.0
description VRF-A
interface Loopback1
ip address 10.1.2.1 255.255.255.0
description VRF-A
router ospf 100
network 192.168.10.0 0.0.0.255 area 0
network 10.1.1.0 0.0.0.255 area 0
network 10.1.2.0 0.0.0.255 area 0
R2(VRF境界ルータ)設定
configure terminal
hostname R2-DUAL-ACCESS
ip vrf VRF-A
rd 100:1
description VRF-A-Department
ip vrf VRF-B
rd 200:1
description VRF-B-Department
interface Ethernet0/0
description VRF-A to R1
ip vrf forwarding VRF-A
ip address 192.168.10.2 255.255.255.0
interface Ethernet0/1
description VRF-A to R3
ip vrf forwarding VRF-A
ip address 192.168.11.2 255.255.255.0
interface Ethernet0/2
description VRF-B to R4
ip vrf forwarding VRF-B
ip address 192.168.10.2 255.255.255.0
interface Ethernet0/3
description VRF-B to R5
ip vrf forwarding VRF-B
ip address 192.168.11.2 255.255.255.0
router ospf 100 vrf VRF-A
network 192.168.10.0 0.0.0.255 area 0
network 192.168.11.0 0.0.0.255 area 0
router ospf 200 vrf VRF-B
network 192.168.10.0 0.0.0.255 area 0
network 192.168.11.0 0.0.0.255 area 0
R3(VRF-A-2)設定
configure terminal
hostname R3-VRFA-2
interface Ethernet0/0
ip address 192.168.11.20 255.255.255.0
description VRF-A to R2
interface Loopback0
ip address 10.2.1.1 255.255.255.0
description VRF-A
interface Loopback1
ip address 10.2.2.1 255.255.255.0
description VRF-A
router ospf 100
network 192.168.11.0 0.0.0.255 area 0
network 10.2.1.0 0.0.0.255 area 0
network 10.2.2.0 0.0.0.255 area 0
R4(VRF-B-1)設定
configure terminal
hostname R4-VRFB-1
interface Ethernet0/0
ip address 192.168.10.10 255.255.255.0
description VRF-B to R2
interface Loopback0
ip address 10.1.1.1 255.255.255.0
description VRF-B
interface Loopback1
ip address 10.1.2.1 255.255.255.0
description VRF-B
router ospf 200
network 192.168.10.0 0.0.0.255 area 0
network 10.1.1.0 0.0.0.255 area 0
network 10.1.2.0 0.0.0.255 area 0
R5(VRF-B-2)設定
configure terminal
hostname R5-VRFB-2
interface Ethernet0/0
ip address 192.168.11.20 255.255.255.0
description VRF-B to R2
interface Loopback0
ip address 10.2.1.1 255.255.255.0
description VRF-B
interface Loopback1
ip address 10.2.2.1 255.255.255.0
description VRF-B
router ospf 200
network 192.168.11.0 0.0.0.255 area 0
network 10.2.1.0 0.0.0.255 area 0
network 10.2.2.0 0.0.0.255 area 0
VRF設定確認
OSPFプロセスとVRFの紐づけ、OSPFネイバー確認:
OSPFプロセスごとのネイバー確認
R2からのVRF指定ping
ping vrf VRF-A 192.168.10.10
ping vrf VRF-A 10.1.1.1
ping vrf VRF-A 10.1.2.1
ping vrf VRF-A 192.168.11.20
ping vrf VRF-A 10.2.1.1
ping vrf VRF-A 10.2.2.1
ping vrf VRF-B 192.168.10.10
ping vrf VRF-B 10.1.1.1
ping vrf VRF-B 10.1.2.1
ping vrf VRF-B 192.168.11.20
ping vrf VRF-B 10.2.1.1
ping vrf VRF-B 10.2.2.1
ping確認の結果(一部):
ARPテーブルで、VRF設定確認
まとめ
X型構成でのVRF学習:
・複数拠点:VRF-A・VRF-BそれぞれにVRF-A-1、VRF-A-2とVRF-B-1、VRF-B-2を配置
・VRF境界:R2が両VRFを持つ境界ルータ
・IPアドレス重複:同一IPアドレスでも論理的に分離
・OSPFによる動的ルーティング:VRF別のOSPFプロセスで経路学習
各VRFで設定確認はとれたのですが、VRF間の経路交換方法であるルートリークについても、CMLで試してみようかと。
ただ、ENCORの範囲としては、ルートリークまで見なくてもよさそうっぽく、ENARSIの範囲では(MPLS VPN+BGPのroute-target)が出てくるので、そこに向けて理解を深めたいな、と。