天天看點

RIPv2 的相關配置

RIPv2 的相關配置

<a href="http://yuzeying.blog.51cto.com/attachment/200907/18/644976_12479346549brr.png"></a>

Ru1 上的基本配置

Router&amp;gt;en

Router#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Router(config)#host ru1

ru1(config)#int s0/0

ru1(config-if)#ip add 192.168.1.1 255.255.255.0

ru1(config-if)#clock rate 64000

ru1(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0, changed state to down

ru1(config-if)#exit

ru1(config)#int f0/0

ru1(config-if)#ip add 172.16.1.1 255.255.255.0

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

ru1(config)#

ru2上的基本配置

--- System Configuration Dialog ---

Continue with configuration dialog? [yes/no]: n

Press RETURN to get started!

Router(config)#host ru2

ru2(config)#int s0/0

ru2(config-if)#ip add 192.168.1.2 255.255.255.0

ru2(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0, changed state to up

ru2(config-if)#

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upexit

ru2(config)#int s0/1

ru2(config-if)#ip add 192.168.2.1 255.255.255.0

ru2(config-if)#clock rate 64000

%LINK-5-CHANGED: Interface Serial0/1, changed state to down

ru2(config-if)#exit

ru2(config)#int f0/0

ru2(config-if)#ip add 172.16.2.1 255.255.255.0

ru2(config)#

ru3上的基本配置Router&amp;gt;en

Router(config)#host ru3

ru3(config)#int s0/0

ru3(config-if)#ip add 192.168.2.2 255.255.255.0

ru3(config-if)#no shut

ru3(config-if)#

ru3(config)#int f0/0

ru3(config-if)#ip add 172.16.3.1 255.255.255.0

ru3(config-if)#exit

ru3(config)#

ru1上的rip具體配置ru1&amp;gt;en

ru1#conf t

ru1(config)#route rip

ru1(config-router)#version 2

ru1(config-router)#net 192.168.1.0

ru1(config-router)#net 172.16.1.0

ru1(config-router)#exit

這是ru2上的

ru2&amp;gt;

ru2&amp;gt;en

ru2#conf t

ru2(config)#route rip

ru2(config-router)#version 2

ru2(config-router)#net 192.168.1.0

ru2(config-router)#net 192.168.2.0

ru2(config-router)#net 172.16.2.0

ru2(config-router)#exit

以下是ru3上的配置

ru3(config)#route rip

ru3(config-router)#version 2

ru3(config-router)#net 192.168.2.0

ru3(config-router)#net 172.16.3.0

ru3(config-router)#exit

ru3上的檢視資訊

ru3#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, 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

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks

R 172.16.0.0/16 [120/1] via 192.168.2.1, 00:00:07, Serial0/0

C 172.16.3.0/24 is directly connected, FastEthernet0/0

R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:07, Serial0/0

C 192.168.2.0/24 is directly connected, Serial0/0

ru3#

ru3#ping 172.16.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:

!.!.!

Success rate is 60 percent (3/5), round-trip min/avg/max = 6/6/8 ms

注意這裡的連通情況

一個通一個不通

注意代灰色背景的路由資訊和後面的差別

<a href="http://yuzeying.blog.51cto.com/attachment/200907/18/644976_12479345664zlM.jpg"></a>

PC1上的配置

<a href="http://yuzeying.blog.51cto.com/attachment/200907/18/644976_1247934568CuNW.jpg"></a>

上面是pc2的

<a href="http://yuzeying.blog.51cto.com/attachment/200907/18/644976_1247934570WQ9Q.jpg"></a>

Pc3的

<a href="http://yuzeying.blog.51cto.com/attachment/200907/18/644976_1247934572pHQD.jpg"></a>

Ping一下pc1 看看連通性

下面我們關閉自動彙總 看看與之前有什麼差別

簡單的說關閉自動彙總是為了解決不連續子網互相通路的問題

Ru3&amp;gt;

Ru3&amp;gt;en

Ru3#conf t

Ru 3(config)#router rip

ru3(config-router)#no au

ru3(config-router)#no auto-summary

其他兩台路由做同樣的設定

172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks

R 172.16.0.0/16 [120/2] via 192.168.2.1, 00:00:00, Serial0/0

R 172.16.1.0/24 [120/2] via 192.168.2.1, 00:00:00, Serial0/0

R 172.16.2.0/24 [120/1] via 192.168.2.1, 00:00:00, Serial0/0

R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:00, Serial0/0

在看一下連同情況

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 7/7/8 ms

被動接口:

由于内網的接口即f0/0接口連接配接主機,是以我們并不需要向這些接口發送路由更新資訊,是以我們可以把這些接口設定為被動接口

被動接口的意思就是隻接受rip更新而不向外發送路由更新資訊

設定為被動接口,可以達到節省資源的目的

路由配置模式下

ru3#conf t

ru3(config-router)#pass

ru3(config-router)#passive-interface f0/0

其他兩台路由器上做同樣的配置

我們用sh ip pro 檢視一下變化情況

ru1#sh ip pro

#設定前

Routing Protocol is "rip"

Sending updates every 30 seconds, next due in 14 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 2, receive 2

Interface Send Recv Triggered RIP Key-chain

Serial0/0 2 2

FastEthernet0/0 2 2

#這裡記錄了哪些接口發送和接收資訊

Automatic network summarization is not in effect

Maximum path: 4

Routing for Networks:

172.16.0.0

192.168.1.0

Passive Interface(s):

Routing Information Sources:

Gateway Distance Last Update

192.168.1.2 120 00:00:11

Distance: (default is 120)

#設定後

ru1#sh ip protocols

Sending updates every 30 seconds, next due in 15 seconds

FastEthernet0/0

192.168.1.2 120 00:00:14

ru1#

本文轉自 yuzeying1 51CTO部落格,原文連結:http://blog.51cto.com/yuzeying/180265