目的

異なるネットワークに所属している2台のPCをお互いに通信させます。
ルーティングプロトコルはRIPv1を使用します。

 

RIPの設定方法を学びます。

接続構成

rip10-05.png

コマンド

router rip
network ネットワークアドレス

 

RIPルーティングプロトコルを有効にします。
RIPを有効化するネットワークを指定します。

設定

R1の設定

R1(config)#int f0/0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut

 

R1(config-if)#int s0/0
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#no shut

 

R1(config)#router rip
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.2.0

 

 

R2の設定

R2(config)#int f0/0
R2(config-if)#ip add 192.168.3.1 255.255.255.0
R2(config-if)#no shut

 

R2(config-if)#int s0/0
R2(config-if)#ip add 192.168.2.2 255.255.255.0
R2(config-if)#no shut

 

R2(config)#router rip
R2(config-router)#net 192.168.2.0
R2(config-router)#net 192.168.3.0

 

 

PC-1の設定

PC-1> ip 192.168.1.100/24 192.168.1.1
Checking for duplicate address...
PC1 : 192.168.1.100 255.255.255.0 gateway 192.168.1.1

 

PC-1> save
Saving startup configuration to startup.vpc
. done

 

 

PC-2の設定

PC-2> ip 192.168.3.100/24 192.168.3.1
Checking for duplicate address...
PC1 : 192.168.3.100 255.255.255.0 gateway 192.168.3.1

 

PC-2> save
Saving startup configuration to startup.vpc
. done

設定確認

ルーティングプロトコルの確認

R1#sh ip protocols
Routing Protocol is "rip" ①
Sending updates every 30 seconds, next due in 18 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
FastEthernet0/0 1 1 2
Serial0/0 1 1 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
192.168.1.0 ②
192.168.2.0
Routing Information Sources:
Gateway Distance Last Update
192.168.2.2 120 00:00:07
Distance: (default is 120)

 

①有効化されているルーティングプロトコルは 「RIP」
②RIPを有効にしたインターフェースは 「192.168.1.0」と「192.168.2.0」

 

ルーティングテーブルの確認

R1#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
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

 

C 192.168.1.0/24 is directly connected, FastEthernet0/0
C 192.168.2.0/24 is directly connected, Serial0/0
R 192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:30, Serial0/0

 

ここで、注目すべきは、黄色のマーカー部分です。
それぞれの項目の意味を説明します。

 

R
ルートの情報源、RIPのこと。

 

192.168.3.0/24
リモートネットワーク。

 

[120/1]
120は、アドミニストレーティブディスタンス
1は、メトリック(ホップ)。

 

via 192.168.2.2
ネクストホップ

 

00:00:30
更新後の時間。
RIPはデフォルトで30秒間隔でルーティングアップデートを送信するので、この例ではアップデート後、30秒経過したことを表す。

 

Serial0/0
到達可能インターフェース(自分自身のインターフェースを指す)

 

まとめると、黄色のマーカーの1行目は、下記のように読み解きます。
ルーティングプロトコルは、RIPを使っていて、
192.168.3.0/24のネットワークは、Serial0のインターフェースからルータを1つ越えた先にある。

 

動作確認

Pingの疎通テスト

PC-1からPC-2

PC-1> ping 192.168.3.100
192.168.3.100 icmp_seq=1 timeout
84 bytes from 192.168.3.100 icmp_seq=2 ttl=62 time=84.637 ms
84 bytes from 192.168.3.100 icmp_seq=3 ttl=62 time=53.461 ms
84 bytes from 192.168.3.100 icmp_seq=4 ttl=62 time=84.723 ms
84 bytes from 192.168.3.100 icmp_seq=5 ttl=62 time=84.441 ms

 

PC-2からPC-1

PC2> ping 192.168.1.100
84 bytes from 192.168.1.100 icmp_seq=1 ttl=62 time=84.466 ms
84 bytes from 192.168.1.100 icmp_seq=2 ttl=62 time=53.322 ms
84 bytes from 192.168.1.100 icmp_seq=3 ttl=62 time=46.694 ms
84 bytes from 192.168.1.100 icmp_seq=4 ttl=62 time=84.796 ms
84 bytes from 192.168.1.100 icmp_seq=5 ttl=62 time=52.834 ms

 

異なるセグメントのPCがお互いに通信できました。

トップへ戻る