🪩

VRF の練習

2023/02/04に公開

VRF設定

PEルータ設定

customer1 を設定します。

r1(config)#ip vrf customer1
r1(config-vrf)#rd 1:100

r1(config-vrf)#int s1/0
r1(config-if)#ip vrf forwarding customer1
r1(config-if)#ip address 10.2.1.254 255.255.255.0
r1(config-if)#no shut

CEルータ設定

customer1 のCEルータを設定します。

r2(config)#int s1/0
r2(config-if)#ip address 10.2.1.253 255.255.255.0
r2(config-if)#no shut
r2#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.1.253      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

r2#show cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
r1.localdomain.local
                 Ser 1/0            128         R S I     3725      Ser 1/0

PEルータへの疎通を確認します。

r2#ping 10.2.1.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/16/20 ms

PEルータからCEルータに対して疎通確認します。

r1#ping vrf customer1 10.2.1.253

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.1.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/16/20 ms
r1#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            10.2.0.254      YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.1.254      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down
Loopback0                  1.1.1.1         YES manual up                    up

r1#show cdp neigh
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
r2               Ser 1/0            159         R S I     3725      Ser 1/0

customer2 の追加

PEルータで、customer2を追加します。

r1(config)#ip vrf customer2
r1(config-vrf)#rd 1:200

r1(config-vrf)#int s1/2
r1(config-if)#ip vrf forwarding customer2
r1(config-if)#ip address 10.2.1.254 255.255.255.0
r1(config-if)#no shut

customer2 のCEルータで、設定します。

r4(config)#int s1/0
r4(config-if)#ip address 10.2.1.253 255.255.255.0
r4(config-if)#no shut

疎通確認します。

r4#ping 10.2.1.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/21/40 ms
r4#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.1.253      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

r4#show cdp neigh
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
r1.localdomain.local
                 Ser 1/0            168         R S I     3725      Ser 1/2

PEルータ側から疎通確認します。

r1#ping vrf customer2 10.2.1.253

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.1.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/18/20 ms
r1#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            10.2.0.254      YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.1.254      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  10.2.1.254      YES manual up                    up
Serial1/3                  unassigned      YES unset  administratively down down
Loopback0                  1.1.1.1         YES manual up                    up
r1#
r1#show cdp neigh
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
r2               Ser 1/0            178         R S I     3725      Ser 1/0
r4               Ser 1/2            142         R S I     3725      Ser 1/0

customer1 に新しいCEを追加

PEルータで設定を追加します。

r1(config)#int s1/1
r1(config-if)#ip vrf forwarding customer1
r1(config-if)#ip address 10.2.2.254 255.255.255.0

customer1 の新しいCEルータの設定をします。

r3(config)#int s1/0
r3(config-if)#ip addr 10.2.2.253 255.255.255.0
r3(config-if)#no shut

疎通確認をします。

r3#ping 10.2.2.254

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/15/24 ms
r3#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.2.253      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

r3#show cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
r1.localdomain.local
                 Ser 1/0            150         R S I     3725      Ser 1/1

PEルータから疎通確認をします。

r1#ping vrf customer1 10.2.2.253

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.253, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/16/20 ms

PEルータで Serial1/0 と Serial1/2 で同じIPアドレス 10.2.1.254 が設定されています。

r1#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            10.2.0.254      YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.1.254      YES manual up                    up
Serial1/1                  10.2.2.254      YES manual up                    up
Serial1/2                  10.2.1.254      YES manual up                    up
Serial1/3                  unassigned      YES unset  administratively down down
Loopback0                  1.1.1.1         YES manual up                    up

r1#show cdp nei
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
                  S - Switch, H - Host, I - IGMP, r - Repeater

Device ID        Local Intrfce     Holdtme    Capability  Platform  Port ID
r2               Ser 1/0            166         R S I     3725      Ser 1/0
r3               Ser 1/1            167         R S I     3725      Ser 1/0
r4               Ser 1/2            130         R S I     3725      Ser 1/0

ルーティングの設定・テストの準備

以下で、customer1 でルーティングのテストを実施していきます。
仮想クライアント端末を接続するインタフェースを設定します。

r2(config)#int f0/0
r2(config-if)#ip address 192.168.1.254 255.255.255.0
r2(config-if)#no shut

r2#show ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.1.254   YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.1.253      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down
r3(config)#int f0/0
r3(config-if)#ip address 192.168.2.254 255.255.255.0
r3(config-if)#no shut

r3#sho ip int bri
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.2.254   YES manual up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
Serial1/0                  10.2.2.253      YES manual up                    up
Serial1/1                  unassigned      YES unset  administratively down down
Serial1/2                  unassigned      YES unset  administratively down down
Serial1/3                  unassigned      YES unset  administratively down down

仮想端末を設定し、それぞれ接続したルータまで疎通確認します。

VPCS[1]> ip 192.168.1.1 255.255.255.0 192.168.1.254
Checking for duplicate address...
PC1 : 192.168.1.1 255.255.255.0 gateway 192.168.1.254

VPCS[1]> ping 192.168.1.254
192.168.1.254 icmp_seq=1 ttl=255 time=19.182 ms
192.168.1.254 icmp_seq=2 ttl=255 time=2.661 ms
192.168.1.254 icmp_seq=3 ttl=255 time=10.211 ms
192.168.1.254 icmp_seq=4 ttl=255 time=1.203 ms
192.168.1.254 icmp_seq=5 ttl=255 time=1.627 ms

VPCS[2]> ip 192.168.2.1 255.255.255.0 192.168.2.254
Checking for duplicate address...
PC2 : 192.168.2.1 255.255.255.0 gateway 192.168.2.254

VPCS[2]> ping 192.168.2.254
192.168.2.254 icmp_seq=1 timeout
192.168.2.254 icmp_seq=2 ttl=255 time=5.418 ms
192.168.2.254 icmp_seq=3 ttl=255 time=8.780 ms
192.168.2.254 icmp_seq=4 ttl=255 time=10.371 ms
192.168.2.254 icmp_seq=5 ttl=255 time=6.929 ms

VRFで設定した情報は、通常のルーティングテーブルには載りません。

r1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     1.0.0.0/32 is subnetted, 1 subnets
C       1.1.1.1 is directly connected, Loopback0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.2.0.0 is directly connected, FastEthernet0/0

VRFごとのルーティングテーブルに情報が載ります。

r1#show ip route vrf customer1

Routing Table: customer1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
C       10.2.2.0 is directly connected, Serial1/1
r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.2.1.0 is directly connected, Serial1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.2.2.0 is directly connected, Serial1/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0

スタティックルート

PEルータで、vrf customer1 のスタティックルートの設定をします。

r1(config)#ip route vrf customer1 192.168.1.0 255.255.255.0 10.2.1.253
r1(config)#ip route vrf customer1 192.168.2.0 255.255.255.0 10.2.2.253

vrf customer1 のルーティングテーブルを確認します。

r1#show ip route vrf customer1

Routing Table: customer1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
C       10.2.2.0 is directly connected, Serial1/1
S    192.168.1.0/24 [1/0] via 10.2.1.253
S    192.168.2.0/24 [1/0] via 10.2.2.253

r2 でスタティックルートを設定します。

r2(config)#ip route 192.168.2.0 255.255.255.0 10.2.1.254
r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.2.1.0 is directly connected, Serial1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
S    192.168.2.0/24 [1/0] via 10.2.1.254

r3 でスタティックルートを設定します。

r3(config)#ip route 192.168.1.0 255.255.255.0 10.2.2.254
r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 1 subnets
C       10.2.2.0 is directly connected, Serial1/0
S    192.168.1.0/24 [1/0] via 10.2.2.254
C    192.168.2.0/24 is directly connected, FastEthernet0/0

疎通確認します。

VPCS[2]> ping 192.168.1.254
192.168.1.254 icmp_seq=1 ttl=253 time=50.401 ms
192.168.1.254 icmp_seq=2 ttl=253 time=49.320 ms
192.168.1.254 icmp_seq=3 ttl=253 time=48.016 ms
192.168.1.254 icmp_seq=4 ttl=253 time=42.212 ms
192.168.1.254 icmp_seq=5 ttl=253 time=43.713 ms

VPCS[2]>
VPCS[2]> ping 192.168.1.1
192.168.1.1 icmp_seq=1 ttl=61 time=53.680 ms
192.168.1.1 icmp_seq=2 ttl=61 time=55.962 ms
192.168.1.1 icmp_seq=3 ttl=61 time=51.771 ms
192.168.1.1 icmp_seq=4 ttl=61 time=54.192 ms
192.168.1.1 icmp_seq=5 ttl=61 time=59.886 ms

VPCS[2]>

RIPv2

PEルータで、スタティックルートの設定を削除し、RIPv2 の設定を追加します。

r1(config)#no ip route vrf customer1 192.168.1.0 255.255.255.0 10.2.1.253
r1(config)#no ip route vrf customer1 192.168.2.0 255.255.255.0 10.2.2.253
r1(config)#router rip
r1(config-router)#address-family ipv4 vrf customer1
r1(config-router-af)#version 2
r1(config-router-af)#network 10.2.1.0
r1(config-router-af)#network 10.2.2.0
r1(config-router-af)#passive-interface fa0/0
r1(config-router)#no auto-summary
r1#show ip protocols vrf customer1
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 20 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/0             2     2
    Serial1/1             2     2
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 120)

r2で、スタティックルートの設定を削除し、RIPv2 の設定を追加します。

r2(config)#no ip route 192.168.2.0 255.255.255.0 10.2.1.254
r2(config)#router rip
r2(config-router)#version 2
r2(config-router)#network 10.2.1.0
r2(config-router)#network 192.168.1.0
r2(config-router)#passive-interface fa0/0
r2#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 18 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/0             2     2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
    192.168.1.0
  Passive Interface(s):
    FastEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.2.1.254           120      00:00:17
  Distance: (default is 120)

r3で、スタティックルートの設定を削除し、RIPv2 の設定を追加します。

r3(config)#no ip route 192.168.1.0 255.255.255.0 10.2.2.254
r3(config)#router rip
r3(config-router)#version 2
r3(config-router)#network 10.2.2.0
r3(config-router)#network 192.168.2.0
r3(config-router)#passive-interface fa0/0
r3#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 0 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/0             2     2
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
    192.168.2.0
  Passive Interface(s):
    FastEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.2.2.254           120      00:00:11
  Distance: (default is 120)

各ルータで、RIPの学習状況を確認します。

r3#show ip rip database
10.0.0.0/8    auto-summary
10.2.1.0/24
    [1] via 10.2.2.254, 00:00:06, Serial1/0
10.2.2.0/24    directly connected, Serial1/0
192.168.1.0/24    auto-summary
192.168.1.0/24
    [2] via 10.2.2.254, 00:00:06, Serial1/0
192.168.2.0/24    auto-summary
192.168.2.0/24    directly connected, FastEthernet0/0

r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
R       10.2.1.0 [120/1] via 10.2.2.254, 00:00:13, Serial1/0
C       10.2.2.0 is directly connected, Serial1/0
R    192.168.1.0/24 [120/2] via 10.2.2.254, 00:00:13, Serial1/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
r2#show ip rip database
10.0.0.0/8    auto-summary
10.2.1.0/24    directly connected, Serial1/0
10.2.2.0/24
    [1] via 10.2.1.254, 00:00:23, Serial1/0
192.168.1.0/24    auto-summary
192.168.1.0/24    directly connected, FastEthernet0/0
192.168.2.0/24    auto-summary
192.168.2.0/24
    [2] via 10.2.1.254, 00:00:23, Serial1/0

r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
R       10.2.2.0 [120/1] via 10.2.1.254, 00:00:01, Serial1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/2] via 10.2.1.254, 00:00:01, Serial1/0
r1#show ip rip database vrf customer1
10.0.0.0/8    auto-summary
10.2.1.0/24    directly connected, Serial1/0
10.2.2.0/24    directly connected, Serial1/1
192.168.1.0/24    auto-summary
192.168.1.0/24
    [1] via 10.2.1.253, 00:00:18, Serial1/0
192.168.2.0/24    auto-summary
192.168.2.0/24
    [1] via 10.2.2.253, 00:00:13, Serial1/1

r1#show ip route vrf customer1

Routing Table: customer1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
C       10.2.2.0 is directly connected, Serial1/1
R    192.168.1.0/24 [120/1] via 10.2.1.253, 00:00:26, Serial1/0
R    192.168.2.0/24 [120/1] via 10.2.2.253, 00:00:21, Serial1/1

疎通確認します。

VPCS[2]> ping 192.168.1.254
192.168.1.254 icmp_seq=1 ttl=253 time=49.831 ms
192.168.1.254 icmp_seq=2 ttl=253 time=44.202 ms
192.168.1.254 icmp_seq=3 ttl=253 time=42.083 ms
192.168.1.254 icmp_seq=4 ttl=253 time=47.645 ms
192.168.1.254 icmp_seq=5 ttl=253 time=44.329 ms

VPCS[2]>
VPCS[2]> ping 192.168.1.1
192.168.1.1 icmp_seq=1 ttl=61 time=56.543 ms
192.168.1.1 icmp_seq=2 ttl=61 time=57.764 ms
192.168.1.1 icmp_seq=3 ttl=61 time=59.042 ms
192.168.1.1 icmp_seq=4 ttl=61 time=58.000 ms
192.168.1.1 icmp_seq=5 ttl=61 time=51.372 ms

VPCS[2]>

PEルータで、RIPv2 の設定を削除し、EIGRP の設定を追加します。

r1(config)#no router rip
r1(config)#router eigrp 1
r1(config-router)#address-family ipv4 vrf customer1
r1(config-router-af)#autonomous-system 10
r1(config-router-af)#network 10.2.1.0 0.0.0.255
r1(config-router-af)#network 10.2.2.0 0.0.0.255
r1(config-router-af)#no auto-summary
r1#show ip protocols vrf customer1
Routing Protocol is "eigrp 10"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 10
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    10.2.1.0/24
    10.2.2.0/24
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: internal 90 external 170

r2で、RIPv2 の設定を削除し、EIGRP の設定を追加します。

r2(config)#no router rip
r2(config)#router eigrp 10
r2(config-router)#network 10.2.1.0 0.0.0.255
r2(config-router)#network 192.168.1.0 0.0.0.255
r2(config-router)#passive-interface fa0/0
r2(config-router)#no auto-summary
r2#show ip protocols
Routing Protocol is "eigrp 10"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 10
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    10.2.1.0/24
    192.168.1.0
  Passive Interface(s):
    FastEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    (this router)         90      00:00:45
    10.2.1.254            90      00:00:37
  Distance: internal 90 external 170

r3で、RIPv2 の設定を削除し、EIGRP の設定を追加します。

r3(config)#no router rip
r3(config)#router eigrp 10
r3(config-router)#network 10.2.2.0 0.0.0.255
r3(config-router)#network 192.168.2.0 0.0.0.255
r3(config-router)#passive-interface fa0/0
r3(config-router)#no auto-summary
r3#show ip protocols
Routing Protocol is "eigrp 10"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 10
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    10.2.2.0/24
    192.168.2.0
  Passive Interface(s):
    FastEthernet0/0
  Routing Information Sources:
    Gateway         Distance      Last Update
    (this router)         90      00:00:18
    10.2.2.254            90      00:00:11
  Distance: internal 90 external 170

各ルータで EIGRP の学習状況を確認します。

r3#show ip eigrp nei
IP-EIGRP neighbors for process 10
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   10.2.2.254              Se1/0             14 00:00:51   38   228  0  13

r3#show ip eigrp topology
IP-EIGRP Topology Table for AS(10)/ID(192.168.2.254)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.2.1.0/24, 1 successors, FD is 2681856
        via 10.2.2.254 (2681856/2169856), Serial1/0
P 10.2.2.0/24, 1 successors, FD is 2169856
        via Connected, Serial1/0
P 192.168.1.0/24, 1 successors, FD is 2707456
        via 10.2.2.254 (2707456/2195456), Serial1/0
P 192.168.2.0/24, 1 successors, FD is 281600
        via Connected, FastEthernet0/0

r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
D       10.2.1.0 [90/2681856] via 10.2.2.254, 00:01:05, Serial1/0
C       10.2.2.0 is directly connected, Serial1/0
D    192.168.1.0/24 [90/2707456] via 10.2.2.254, 00:01:05, Serial1/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
r3#
r2#show ip eigrp nei
IP-EIGRP neighbors for process 10
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   10.2.1.254              Se1/0             10 00:02:49   30   200  0  11

r2#show ip eigrp topo
IP-EIGRP Topology Table for AS(10)/ID(192.168.1.254)

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.2.1.0/24, 1 successors, FD is 2169856
        via Connected, Serial1/0
P 10.2.2.0/24, 1 successors, FD is 2681856
        via 10.2.1.254 (2681856/2169856), Serial1/0
P 192.168.1.0/24, 1 successors, FD is 281600
        via Connected, FastEthernet0/0
P 192.168.2.0/24, 1 successors, FD is 2707456
        via 10.2.1.254 (2707456/2195456), Serial1/0

r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
D       10.2.2.0 [90/2681856] via 10.2.1.254, 00:03:01, Serial1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
D    192.168.2.0/24 [90/2707456] via 10.2.1.254, 00:01:35, Serial1/0
r1#show ip eigrp vrf customer1 nei
IP-EIGRP neighbors for process 10
H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
1   10.2.2.253              Se1/1             12 00:02:37   29   200  0  7
0   10.2.1.253              Se1/0             13 00:03:58   43   258  0  7

r1#show ip eigrp vrf customer1 topo
IP-EIGRP Topology Table for AS(10)/ID(10.2.2.254) Routing Table: customer1

Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 10.2.1.0/24, 1 successors, FD is 2169856
        via Connected, Serial1/0
P 10.2.2.0/24, 1 successors, FD is 2169856
        via Connected, Serial1/1
P 192.168.1.0/24, 1 successors, FD is 2195456
        via 10.2.1.253 (2195456/281600), Serial1/0
P 192.168.2.0/24, 1 successors, FD is 2195456
        via 10.2.2.253 (2195456/281600), Serial1/1

r1#show ip route vrf customer1

Routing Table: customer1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
C       10.2.2.0 is directly connected, Serial1/1
D    192.168.1.0/24 [90/2195456] via 10.2.1.253, 00:04:12, Serial1/0
D    192.168.2.0/24 [90/2195456] via 10.2.2.253, 00:02:51, Serial1/1

疎通確認します。

VPCS[2]> ping 192.168.1.254
192.168.1.254 icmp_seq=1 ttl=253 time=50.726 ms
192.168.1.254 icmp_seq=2 ttl=253 time=42.443 ms
192.168.1.254 icmp_seq=3 ttl=253 time=49.707 ms
192.168.1.254 icmp_seq=4 ttl=253 time=48.877 ms
192.168.1.254 icmp_seq=5 ttl=253 time=42.871 ms

VPCS[2]>
VPCS[2]> ping 192.168.1.1
192.168.1.1 icmp_seq=1 ttl=61 time=53.969 ms
192.168.1.1 icmp_seq=2 ttl=61 time=63.661 ms
192.168.1.1 icmp_seq=3 ttl=61 time=59.821 ms
192.168.1.1 icmp_seq=4 ttl=61 time=55.552 ms
192.168.1.1 icmp_seq=5 ttl=61 time=61.718 ms

VPCS[2]>

OSPF

PEルータで、EIGRP の設定を削除し、OSPF の設定を追加します。

r1(config)#no router eigrp 1
r1(config)#router ospf 1 vrf customer1
r1(config-router)#network 10.2.1.0 0.0.0.255 area 0
r1(config-router)#network 10.2.2.0 0.0.0.255 area 0
r1#show ip protocols vrf customer1
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 10.2.2.254
  It is an area border router
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.2.1.0 0.0.0.255 area 0
    10.2.2.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 110)

r2で、EIGRP の設定を削除し、OSPF の設定を追加します。

r2(config)#no router eigrp 10
r2(config)#router ospf 1
r2(config-router)#network 10.2.1.0 0.0.0.255 area 0
r2(config-router)#network 192.168.1.0 0.0.0.255 area 0
r2#show ip proto
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.1.254
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.2.1.0 0.0.0.255 area 0
    192.168.1.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.2.2.254           110      00:00:29
  Distance: (default is 110)

r3で、EIGRP の設定を削除し、OSPF の設定を追加します。

r3(config)#no router eigrp 10
r3(config)#router ospf 1
r3(config-router)#network 10.2.2.0 0.0.0.255 area 0
r3(config-router)#network 192.168.2.0 0.0.0.255 area 0
r3#show ip protocols
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 192.168.2.254
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    10.2.2.0 0.0.0.255 area 0
    192.168.2.0 0.0.0.255 area 0
 Reference bandwidth unit is 100 mbps
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.1.254        110      00:00:37
    10.2.2.254           110      00:00:37
  Distance: (default is 110)

各ルータでOSPFの学習状況を確認します。

r3#show ip ospf neigh

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.2.2.254        0   FULL/  -        00:00:35    10.2.2.254      Serial1/0

r3#show ip ospf data

            OSPF Router with ID (192.168.2.254) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.2.2.254      10.2.2.254      57          0x80000004 0x00BC23 4
192.168.1.254   192.168.1.254   118         0x80000002 0x00DD49 3
192.168.2.254   192.168.2.254   48          0x80000002 0x000F13 3

r3#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
O       10.2.1.0 [110/128] via 10.2.2.254, 00:00:55, Serial1/0
C       10.2.2.0 is directly connected, Serial1/0
O    192.168.1.0/24 [110/138] via 10.2.2.254, 00:00:55, Serial1/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
r2#show ip ospf neigh

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.2.2.254        0   FULL/  -        00:00:31    10.2.1.254      Serial1/0

r2#show ip ospf database

            OSPF Router with ID (192.168.1.254) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.2.2.254      10.2.2.254      103         0x80000004 0x00BC23 4
192.168.1.254   192.168.1.254   161         0x80000002 0x00DD49 3
192.168.2.254   192.168.2.254   96          0x80000002 0x000F13 3

r2#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
O       10.2.2.0 [110/128] via 10.2.1.254, 00:02:45, Serial1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/138] via 10.2.1.254, 00:01:30, Serial1/0
r1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.2.254     0   FULL/  -        00:00:35    10.2.2.253      Serial1/1
192.168.1.254     0   FULL/  -        00:00:37    10.2.1.253      Serial1/0

r1#show ip ospf data

            OSPF Router with ID (10.2.2.254) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.2.2.254      10.2.2.254      162         0x80000004 0x00BC23 4
192.168.1.254   192.168.1.254   223         0x80000002 0x00DD49 3
192.168.2.254   192.168.2.254   155         0x80000002 0x000F13 3

r1#show ip route vrf customer1

Routing Table: customer1
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

     10.0.0.0/24 is subnetted, 2 subnets
C       10.2.1.0 is directly connected, Serial1/0
C       10.2.2.0 is directly connected, Serial1/1
O    192.168.1.0/24 [110/74] via 10.2.1.253, 00:03:52, Serial1/0
O    192.168.2.0/24 [110/74] via 10.2.2.253, 00:02:47, Serial1/1
r1#

疎通確認します。

VPCS[2]> ping 192.168.1.254
192.168.1.254 icmp_seq=1 ttl=253 time=50.124 ms
192.168.1.254 icmp_seq=2 ttl=253 time=47.845 ms
192.168.1.254 icmp_seq=3 ttl=253 time=42.570 ms
192.168.1.254 icmp_seq=4 ttl=253 time=46.909 ms
192.168.1.254 icmp_seq=5 ttl=253 time=47.733 ms

VPCS[2]>
VPCS[2]> ping 192.168.1.1
192.168.1.1 icmp_seq=1 ttl=61 time=58.014 ms
192.168.1.1 icmp_seq=2 ttl=61 time=60.475 ms
192.168.1.1 icmp_seq=3 ttl=61 time=60.082 ms
192.168.1.1 icmp_seq=4 ttl=61 time=57.018 ms
192.168.1.1 icmp_seq=5 ttl=61 time=60.332 ms

GitHubで編集を提案

Discussion