【概要】
特定端末だけデフォルトルートをRoute leakingする事により、VRFを跨いでインターネットへ通信できるようにする。その他の端末においては、VRFのポリシーを踏襲し、セキュリティを確保する。
構成と通信要件(事前)

Route leaking実施前
- PC1は、PC2とのみ通信が可能 (R1 Gi0/1除く)
- PC2は、PC1とのみ通信が可能 (R1 Gi0/1除く)
- PC3は、3.3.3.3(疑似インターネット)とのみ通信が可能 (ルータ 物理IF除く)
構成と通信要件(事前)

Route leaking実施後
- [VRF AAA] ⇔ [VRF INTERNET]を跨いで、PC1は、3.3.3.3(疑似インターネット)にも通信できるようにする(ピンク色矢印)
設定追加内容
R1 Static-route設定
通信要件(事前)
ip route vrf INTERNET 0.0.0.0 0.0.0.0 10.12.1.2
通信要件(事後)
① ip route vrf INTERNET 0.0.0.0 0.0.0.0 10.12.1.2 ② ip route vrf AAA 0.0.0.0 0.0.0.0 10.12.1.2 global ③ ip route vrf INTERNET 192.168.1.0 255.255.255.0 192.168.1.100 global ④ ip route 10.12.1.2 255.255.255.255 GigabitEthernet0/0 ⑤ ip route 192.168.1.100 255.255.255.255 GigabitEthernet0/1
① 事前static-routeを踏襲。[VRF INTERNET] がインターネット向けに利用するルート
② [VRF AAA] の端末 ⇒ インターネット向けに使うデフォルトルート (route leaking)
③ [VRF INTERNET] は インターネット ⇒ 向けに使うデフォルトルート (route leaking)
④ グローバルルーティングテーブルで、next-hopのインターフェイスを定義
- ②に注意が向くが、③が無いと戻りの通信がPC1に届かないので必要
- R1 Gi0/1にACLが必要。ACLが無いとR2でルーティングして、PC1 ⇔ PC3の通信ができてしまう。
Config
R1-config (事前)
hostname R1 ! ip vrf AAA rd 1:1 ! ip vrf INTERNET rd 99:99 ! interface GigabitEthernet0/0 ip vrf forwarding INTERNET ip address 10.12.1.1 255.255.255.0 ! interface GigabitEthernet0/1 ip vrf forwarding AAA ip address 192.168.1.254 255.255.255.0 ! interface GigabitEthernet0/2 ip vrf forwarding INTERNET ip address 172.16.1.254 255.255.255.0 ! ip route vrf INTERNET 0.0.0.0 0.0.0.0 10.12.1.2 ! control-plane ! end
R1-config (事後)
hostname R1 ! ip vrf AAA rd 1:1 ! ip vrf INTERNET rd 99:99 ! interface GigabitEthernet0/0 ip vrf forwarding INTERNET ip address 10.12.1.1 255.255.255.0 ! interface GigabitEthernet0/1 ip vrf forwarding AAA ip address 192.168.1.254 255.255.255.0 ip access-group INTERNET-to-AAA in ! interface GigabitEthernet0/2 ip vrf forwarding INTERNET ip address 172.16.1.254 255.255.255.0 ! ip route 10.12.1.2 255.255.255.255 GigabitEthernet0/0 ip route 192.168.1.100 255.255.255.255 GigabitEthernet0/1 ip route vrf AAA 0.0.0.0 0.0.0.0 10.12.1.2 global ip route vrf INTERNET 0.0.0.0 0.0.0.0 10.12.1.2 ip route vrf INTERNET 192.168.1.0 255.255.255.0 192.168.1.100 global ! ip access-list extended INTERNET-to-AAA deny ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255 permit ip any any ! control-plane ! end
R2-config (事前/事後 共通)
hostname R2 ! interface GigabitEthernet0/0 ip address 10.12.1.2 255.255.255.0 ! interface GigabitEthernet0/1 ip address 10.23.1.2 255.255.255.0 ! ip route 0.0.0.0 0.0.0.0 10.23.1.3 ip route 172.16.1.0 255.255.255.0 10.12.1.1 ip route 192.168.1.100 255.255.255.255 10.12.1.1 ! control-plane ! end
R3-config (事前/事後 共通)
hostname R3 ! interface Loopback0 ip address 3.3.3.3 255.255.255.255 ! interface GigabitEthernet0/1 ip address 10.23.1.3 255.255.255.0 duplex auto speed auto media-type rj45 ! ip route 0.0.0.0 0.0.0.0 10.23.1.2 ! control-plane ! end
R1(事後)のログ
show ip route vrf AAA
R1#show ip route vrf AAA
Routing Table: AAA
Gateway of last resort is 10.12.1.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.12.1.2
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/1
L 192.168.1.254/32 is directly connected, GigabitEthernet0/1
show ip route vrf INTERNET
R1#show ip route vrf INTERNET
Routing Table: INTERNET
Gateway of last resort is 10.12.1.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.12.1.2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.12.1.0/24 is directly connected, GigabitEthernet0/0
L 10.12.1.1/32 is directly connected, GigabitEthernet0/0
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.1.0/24 is directly connected, GigabitEthernet0/2
L 172.16.1.254/32 is directly connected, GigabitEthernet0/2
S 192.168.1.0/24 [1/0] via 192.168.1.100
show ip vrf
R1#show ip vrf
Name Default RD Interfaces
AAA 1:1 Gi0/1
INTERNET 99:99 Gi0/0
Gi0/2
show ip vrf detail
R1#show ip vrf detail
VRF AAA (VRF Id = 1); default RD 1:1; default VPNID
Old CLI format, supports IPv4 only
Flags: 0xC
Interfaces:
Gi0/1
Address family ipv4 unicast (Table ID = 0x1):
Flags: 0x0
No Export VPN route-target communities
No Import VPN route-target communities
No import route-map
No global export route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
VRF INTERNET (VRF Id = 2); default RD 99:99; default VPNID
Old CLI format, supports IPv4 only
Flags: 0xC
Interfaces:
Gi0/0 Gi0/2
Address family ipv4 unicast (Table ID = 0x2):
Flags: 0x0
No Export VPN route-target communities
No Import VPN route-target communities
No import route-map
No global export route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix

