カテゴリ:

今回はIPv6のRIPでメトリックを指定する方法を確認します。現在R1とR2はF0/0とS1/0(フレームリレー)で直接接続されています。

R1(config-if)#do sh ipv int b
FastEthernet0/0            [up/up]
    FE80::1
Serial1/0                  [up/up]
    FE80::1

Loopback0                  [up/up]
    FE80::1
    2001:1::1

R2(config-if)#do sh ipv int b
FastEthernet0/0            [up/up]
    FE80::2
Serial1/0                  [up/up]
    FE80::2
Loopback0                  [up/up]
    FE80::2
    2001:2::2

R1(config)#do pin fe80::2
Output Interface: fastethernet0/0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::2, timeout is 2 seconds:
Packet sent with a source address of FE80::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/8 ms
R1(config)#do pin fe80::2
Output Interface: serial1/0
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FE80::2, timeout is 2 seconds:
Packet sent with a source address of FE80::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/9/24 ms

R1とR2それぞれでF0/0, S1/0, Lo0でIPv6 RIPを有効にします。

R1(config)#int f0/0
R1(config-if)#ipv6 rip RIP6 enable
R1(config-if)#int s1/0
R1(config-if)#ipv6 rip RIP6 enable
R1(config-if)#int lo0
R1(config-if)#ipv6 rip RIP6 enable
R1(config-if)#do sh ipv rip RIP6
RIP process "RIP6", port 521, multicast-group FF02::9, pid 255
     Administrative distance is 120. Maximum paths is 16
     Updates every 30 seconds, expire after 180
     Holddown lasts 0 seconds, garbage collect after 120
     Split horizon is on; poison reverse is off
     Default routes are not generated
     Periodic updates 103, trigger updates 6
  Interfaces:
    Serial1/0
    FastEthernet0/0
    Loopback0
  Redistribution:
    None

R1からR2へのLo0アドレス(2001:2::2)へのルートを確認します。メトリックが2で、2つのインターフェースを利用していることが分かります。

R1(config-if)#do sh ipv rou 2001:2::2
IPv6 Routing Table - 4 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
       U - Per-user Static route, M - MIPv6
       I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
       O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
       ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
       D - EIGRP, EX - EIGRP external
R   2001:2::/64 [120/2]
     via FE80::2, FastEthernet0/0
     via FE80::2, Serial1/0

R1のインターフェースでメトリック値を指定してみます。ipv6 rip RIP6 metric-offsetコマンドを利用し、3を指定してみました。

R1(config-if)#int f0/0
R1(config-if)#ipv6 rip RIP6 metric-offset 3
R1(config-if)#int s1/0
R1(config-if)#ipv6 rip RIP6 metric-offset 3
R1(config-if)#do deb ipv6 rip
RIP Routing Protocol debugging is on

メトリックが最初の2(1+1)から4(1+3)に変更されたことが分かります。

R1(config-if)#do sh ipv rou 2001:2::2
〜略〜
R   2001:2::/64 [120/4]
     via FE80::2, Serial1/0
     via FE80::2, FastEthernet0/0

次にF0/0のみ、メトリックを5に変更します。これによりF0/0がルーティングから消えることが分かります。

R1(config-if)#int f0/0
R1(config-if)#ipv6 rip RIP6 metric-offset 5

R1(config-if)#do sh ipv rou 2001:2::2
〜略〜
R   2001:2::/64 [120/4]
     via FE80::2, Serial1/0

特定の経路をあえて使わないようにする場合に、metric-offsetはよく使われます。