VRF (Virtual Routing and Forwarding) Lite

本来のルーティングテーブルGRT(Global Routing Table)に加えて、仮想ルーティングテーブルを持つことが出来る。
例)Catalyst3550のVRF-Liteにて、ルーティングテーブルを分離して(GRT, VRF-1)、OSPFによるルーティングを行う。このとき、VRF-1用のVLANとして、Vlan101を使用する。これにより、GRTではインターネットが不可に、VRF-1のみインターネットが可能になる。
※注意Catalyst 3550では以下のコマンドによるsdmの切り替え及び再起動が必要:「L3TCAM-3-SIZE_CONFLICT: [chars] requires enabling extended routing.」
Switch(config)# sdm prefer extended-match
Switch(config)# exit
Switch# reload
再起動後、VRF-1を作成する。Route Distinguisher番号は適当に100:1にしてみた。
Switch(config)# ip vrf VRF-1
Switch(config-vrf)# rd 100:1
Switch(config-vrf)# exit
各種インターフェースの設定、VRF-1用のVLANとしてvlan101、対向ルーター用の物理インターフェース、PC接続用物理インターフェースを設定し、VRF-1のルーティングテーブルに所属させる。
※すでにIPが設定されているインターフェースに「ip vrf forwarding」設定をするとIPが一旦削除されるので、注意!
Switch(config)# vlan 101
Switch(config-vlan)# name VRF1-VLAN01
Switch(config-vlan)# exit
Switch(config)# interface Vlan101
Switch(config-if)# ip vrf forwarding VRF-1
Switch(config-if)# ip address 192.168.101.254 255.255.255.0
Switch(config-if)# exit
Switch(config)# interface range FastEthernet0/1 - 16
Switch(config-if-range)# switchport access vlan 101
Switch(config)# exit
Switch(config)# interface Port-channel2
Switch(config-if)# no switchport
Switch(config-if)# no cdp enable
Switch(config-if)# no vtp
Switch(config-if)# ip vrf forwarding VRF-1
Switch(config-if)# ip address 172.16.254.253 255.255.255.0
Switch(config-if)# exit
OSPFでルーティングの設定を行う。
※ここで、Type3, 5のLSAを受け取るために「capability vrf-lite」を入れることに注意みたい(Type5 AS EX1が問題なく受信できてるけれどなぜ?)
Switch(config)# router ospf 1 vrf VRF-1
Switch(config-router)# [[network]] 192.168.101.254 0.0.0.0 area 1
Switch(config-router)# network 172.16.254.254 0.0.0.0 area 1
Switch(config-router)# capability vrf-lite
Switch(config-router)# exit

VRF環境にて各種コマンド実行時のVRF(source-interface)を指定する。

例)copyコマンドのtftp指定時のVRF(source-interface vlan1001)を指定して接続する。
(ping等はvrfの指定がオプションで出来るが、copy等はコマンド自体にvrf指定のオプションがない。)
  • Switch#ping vrf MGT-LAN 192.168.0.1
  • Switch(config)#ip tftp source-interface vlan1001
また、sshのsource-interfaceも同様に指定できるが、以下のようにVRF環境のsource-interfaceまで指定できなかった・・・なぜ?
  • Switch(config)#ip ssh source-interface vlan1001
Switch#ssh -l user01 172.16.0.254
Destination unreachable; gateway or host down

Route Target等は以下のリンク参照!

最終更新:2013年12月08日 00:48