【ネットワーク】 rip基礎③

f:id:slavex:20211030160923p:plain

※R1のLANセグメントに「172.16.1.0/24」「172.16.2.0/24」があります。

自動経路集約

自動経路集約とは、ネットワークの境界(上図のR3)で経路情報を通知する時に

自動的にクラスフルネットワークアドレスに集約する事です。

RIP version2はデフォルトで有効

 

有効

(config-router)#auto-summary

 

無効

(config-router)#no auto-summary

 

R1

router rip
 version 2
 network 172.16.0.0
 network 192.168.1.0
 no auto-summary

 

R3

router rip
 version 2
 network 10.0.0.0
 network 172.16.0.0

R4

router rip
 version 2
 network 10.0.0.0

 

動作確認(自動集約有効)

 

R1

R1#show ip rip database
10.0.0.0/8    auto-summary
10.0.0.0/8
    [1] via 172.16.1.2, 00:00:24, Vlan1
172.16.0.0/16    auto-summary
172.16.1.0/24    directly connected, Vlan1
172.16.2.0/24    directly connected, Vlan10
R1#
R1#show ip route rip

Gateway of last resort is not set

R     10.0.0.0/8 [120/1] via 172.16.1.2, 00:00:25, Vlan1

 

R3

R3#show ip rip database
10.0.0.0/8    auto-summary
10.1.1.0/24    directly connected, GigabitEthernet0/3
172.16.0.0/16    auto-summary
172.16.1.0/24    directly connected, GigabitEthernet0/1
172.16.2.0/24
    [1] via 172.16.1.250, 00:00:05, GigabitEthernet0/1
R3#
R3#show ip route rip

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R        172.16.2.0/24 [120/1] via 172.16.1.250, 00:00:07, GigabitEthernet0/1

 

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 7 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
    GigabitEthernet0/1                  2     2          No        none            
    Interface                           Send  Recv  Triggered RIP  Key-chain
    GigabitEthernet0/3                  2     2          No        none            
  Automatic network summarization is in effect   ←「not」がないので有効

  Maximum path: 4
  Routing for Networks:
    10.0.0.0
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.1.1.1             120      00:18:50
    172.16.1.250         120      00:00:10
    172.16.1.1           120      00:18:40
    10.1.1.250           120      00:14:12
  Distance: (default is 120)

R4

「172.16.1.0/24」「172.16.2.0/24」が/16で1つに集約されています。

R4#
R4#show ip rip database
10.0.0.0/8    auto-summary
10.1.1.0/24    directly connected, Vlan1
172.16.0.0/16    auto-summary
172.16.0.0/16
    [1] via 10.1.1.2, 00:00:14, Vlan1
R4#
R4#show ip route rip

Gateway of last resort is not set

R     172.16.0.0/16 [120/1] via 10.1.1.2, 00:00:14, Vlan1
R4#

 

R3自動集約無効

自動集約無効

R3(config)#router rip
R3(config-router)#no auto-summary
R3(config-router)#end

 

動作確認(自動集約無効)

 

R3

R3#show ip route rip

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R        172.16.2.0/24 [120/1] via 172.16.1.250, 00:00:04, GigabitEthernet0/1

 

R3#show ip protocols
*** IP Routing is NSF aware ***

Routing Protocol is "application"
  Sending updates every 0 seconds
  Invalid after 0 seconds, hold down 0, flushed after 0
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Maximum path: 32
  Routing for Networks:
  Routing Information Sources:
    Gateway         Distance      Last Update
  Distance: (default is 4)

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 12 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
    GigabitEthernet0/1                  2     2          No        none            
    Interface                           Send  Recv  Triggered RIP  Key-chain
    GigabitEthernet0/3                  2     2          No        none            
  Automatic network summarization is not in effect ←「not」があるので有効
  Maximum path: 4
  Routing for Networks:
    10.0.0.0
    172.16.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.1.1.1             120      00:24:51
    172.16.1.250         120      00:00:03
    172.16.1.1           120      00:24:41
    10.1.1.250           120      00:20:13
  Distance: (default is 120)

R4

「172.16.0.0/16」から「172.16.1.0/24」「172.16.2.0/24」2つに分割されてます。

R4#show ip route rip

Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R        172.16.0.0/16 is possibly down,
          routing via 10.1.1.2, Vlan1
R        172.16.1.0/24 [120/1] via 10.1.1.2, 00:00:09, Vlan1
R        172.16.2.0/24 [120/2] via 10.1.1.2, 00:00:09, Vlan1

R4#
R4#show ip rip database
10.0.0.0/8    auto-summary
10.1.1.0/24    directly connected, Vlan1
172.16.0.0/16    auto-summary
172.16.0.0/16
    [1] via 10.1.1.2, 00:02:46, Vlan1
172.16.1.0/24
    [1] via 10.1.1.2, 00:00:03, Vlan1
172.16.2.0/24
    [2] via 10.1.1.2, 00:00:03, Vlan1
R4#

 

パッシブインターフェース

パッシブインターフェースとは、指定したインターフェースから、アップデートパケットの送信を制限する機能です。送信のみ制限するため受信は可能です。

(OSPFやEIGRPなどのネイバー関係を構築するルーティングプロトコルでは、Helloパケットも制限されます)

 

パッシブインターフェースの有効

interface=指定するインターフェース名

default=全てのインターフェースでパッシブインターフェースを有効

(config-router)#passive-interface <interface> | <default>

 

動作確認

R3

パッシブインターフェースを入れる前はGi0/1 Gi0/3両方でアップデートを送信しています。

*Oct 30 07:46:40.344: RIP: sending v2 update to 224.0.0.9 via GigabitEthernet0/3 (10.1.1.2)
*Oct 30 07:46:40.344: RIP: build update entries
*Oct 30 07:46:40.344:   172.16.1.0/24 via 0.0.0.0, metric 1, tag 0
*Oct 30 07:46:40.344:   172.16.2.0/24 via 0.0.0.0, metric 2, tag 0
*Oct 30 07:46:42.101: RIP: received v2 update from 172.16.1.250 on GigabitEthernet0/1
*Oct 30 07:46:42.101:      172.16.2.0/24 via 0.0.0.0 in 1 hops

 

R3(config-router)#passive-interface gigabitEthernet 0/3

 

*Oct 30 07:47:39.215: RIP: received v2 update from 172.16.1.250 on GigabitEthernet0/1
*Oct 30 07:47:39.215:      172.16.2.0/24 via 0.0.0.0 in 1 hops
*Oct 30 07:47:59.406: RIP: sending v2 update to 224.0.0.9 via GigabitEthernet0/1 (172.16.1.2)
*Oct 30 07:47:59.406: RIP: build update entries
*Oct 30 07:47:59.406:   10.1.1.0/24 via 0.0.0.0, metric 1, tag 0
*Oct 30 07:48:05.879: RIP: received v2 update from 172.16.1.250 on GigabitEthernet0/1
*Oct 30 07:48:05.879:      172.16.2.0/24 via 0.0.0.0 in 1 hops

 

R3(config-router)#passive-interface default 

※default入れた後は、送信が完全に止まり、受信のみになりました。

*Oct 30 07:50:50.830: RIP: received v2 update from 172.16.1.250 on GigabitEthernet0/1
*Oct 30 07:50:50.830:      172.16.2.0/24 via 0.0.0.0 in 1 hops
*Oct 30 07:50:58.652: RIP: received v2 update from 10.1.1.250 on GigabitEthernet0/3
*Oct 30 07:50:58.652:      172.16.0.0/16 via 0.0.0.0 in 16 hops  (inaccessible)

 
R4

R3からアップデートパケットが届かないため、経路学習の経過時間が30秒以上になってます。

R4#sh ip route rip

Gateway of last resort is not set

      172.16.0.0/24 is subnetted, 2 subnets
R        172.16.1.0 [120/1] via 10.1.1.2, 00:01:31, Vlan1
R        172.16.2.0 [120/2] via 10.1.1.2, 00:01:31, Vlan1

 

デフォルトルートの広報

RIPでは、デフォルトでデフォルトルートの広報はされません。

下記コマンドの投入が必要です。

(config-router)default-information originate

 

動作確認

R1

R1#sh ip route

Gateway of last resort is 172.16.1.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 172.16.1.2
      10.0.0.0/24 is subnetted, 1 subnets
R        10.1.1.0 [120/1] via 172.16.1.2, 00:00:09, Vlan1
      172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C        172.16.1.0/24 is directly connected, Vlan1
L        172.16.1.250/32 is directly connected, Vlan1
C        172.16.2.0/24 is directly connected, Vlan10
L        172.16.2.250/32 is directly connected, Vlan10
R1#

R3

R3#sh ip route rip

Gateway of last resort is 172.16.1.250 to network 0.0.0.0

R*    0.0.0.0/0 [120/1] via 172.16.1.250, 00:00:11, GigabitEthernet0/1
      172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
R        172.16.2.0/24 [120/1] via 172.16.1.250, 00:00:11, GigabitEthernet0/1

R4

R4#sh ip route rip

Gateway of last resort is 10.1.1.2 to network 0.0.0.0

R*    0.0.0.0/0 [120/2] via 10.1.1.2, 00:00:24, Vlan1
      172.16.0.0/24 is subnetted, 2 subnets
R        172.16.1.0 [120/1] via 10.1.1.2, 00:00:24, Vlan1
R        172.16.2.0 [120/2] via 10.1.1.2, 00:00:24, Vlan1