立即注册 登录
雏鹰部落 返回首页

子杰的个人空间 https://bbs.spoto.net/?131778 [收藏] [复制] [分享] [RSS]

日志

RIP的基本配置配置案例

已有 134 次阅读2013-2-6 15:32

1.   案例配置拓扑                 

       

2.   IP地址规划

 

FastEthernet0/0

FastEthernet1/0

R1

192.168.12.1/24

N/A

R2

192.168.12.2/24

192.168.23.2/24

R3

192.168.23.3/24

N/A

 

Loopback0

Loopback0

R1

10.1.1.1/24

10.1.2.1/24

3.   案例配置需求

l  R1R2R3做基本的接口配置,并在R1上开启环回接口Loopback 0Loopback 1

l  R1R2R3运行RIPv2协议,并且将环回接口都宣告进RIP进程中

l  实习全网互相通信。

4.   案例配置思路

   1) 在R1R2R3做接口配置,并在R1上开启环回接口

(config)#interface fastEthernet 0/0

(config-if)#ip address x.x.x.x x.x.x.x           //接口模式下配置IP地址//

(config)#int loopback x

(config-if)#ip address x.x.x.x x.x.x.x          //环回口模式下配置IP地址//

   2) 在R1R2R3上运行RIPv2协议

(config)#router rip                        //运行RIP协议//

(config-router)#version 2                 //版本号为2//

(config-router)#no auto-summary        //关闭自动汇总//

(config-router)#network x.x.x.x           //宣告接口网段//

5.   案例检验结果

   1) 查看R1的路由表:

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

 

C    192.168.12.0/24 is directly connected, FastEthernet0/0

     10.0.0.0/24 is subnetted, 2 subnets

C       10.1.2.0 is directly connected, Loopback1

C       10.1.1.0 is directly connected, Loopback0

R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:26, FastEthernet0/0

/上面显示的R表示的是RIP,即为RIP路由。去往R3的接口网段路由条目/

   2) 查看R2的路由表:

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

 

C    192.168.12.0/24 is directly connected, FastEthernet0/0

     10.0.0.0/24 is subnetted, 2 subnets

R       10.1.2.0 [120/1] via 192.168.12.1, 00:00:12, FastEthernet0/0

R       10.1.1.0 [120/1] via 192.168.12.1, 00:00:12, FastEthernet0/0

C    192.168.23.0/24 is directly connected, FastEthernet1/0

 

上面显示的是R2学习到R1的环回地址网段,AD值为120且跳数为1

   3) 查看R3的路由表:

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

 

R    192.168.12.0/24 [120/1] via 192.168.23.2, 00:00:18, FastEthernet0/0

     10.0.0.0/24 is subnetted, 2 subnets

R       10.1.2.0 [120/2] via 192.168.23.2, 00:00:18, FastEthernet0/0

R       10.1.1.0 [120/2] via 192.168.23.2, 00:00:18, FastEthernet0/0

C    192.168.23.0/24 is directly connected, FastEthernet0/0

          上面显示的是R3学习到R1的网段(R2相连的网段跳数为1,学习到环回口网段跳数为2

   4R3pingR1的环回接口地址

R3#ping 10.1.2.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 36/58/96 ms

R3#ping 10.1.1.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/66/

/上面显示的是R3能与R1环回接口通信/

   5R3pingR1的物理接口地址

R3#ping 192.168.12.1

 

Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 40/65/

/上面显示的R3能与R1通信/

 

 

  补充:

   1)测试当RIP协议在 默认情况下为版本几:

 

R1#show ip protocols

Routing Protocol is "rip"

  Outgoing ** filter list for all interfaces is not set

  Incoming ** filter list for all interfaces is not set

  Sending **s every 30 seconds, next due in 10 seconds

  Invalid after 180 seconds, hold down 180, flushed after 240

  Redistributing: rip

  Default version control: send version 1, receive any version

    Interface             Send  Recv  Triggered RIP  Key-chain

    FastEthernet0/0       1     1 2

    Loopback0            1     1 2

    Loopback1            1     1 2

  Automatic network summarization is not in effect

  Maximum path: 4

  Routing for Networks:

    10.0.0.0

    192.168.12.0

  Routing Information Sources:

    Gateway         Distance      Last **

    192.168.12.2         120      00:00:08

  Distance: (default is 120)

上面的显示信息:

1.路由协议为RIP

2.30秒更新一次路由表,180路由器失效,240路由条目消失。

3.默认下发送版本号为1,接收版本为12

4.默认AD的值为120

   2)当把RIP版本改为2时,查看下信息

R1#show ip protocols

Routing Protocol is "rip"

  Outgoing ** filter list for all interfaces is not set

  Incoming ** filter list for all interfaces is not set

  Sending **s every 30 seconds, next due in 26 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

    FastEthernet0/0       2     2

    Loopback0            2     2

    Loopback1            2     2

  Automatic network summarization is not in effect

  Maximum path: 4

  Routing for Networks:

    10.0.0.0

    192.168.12.0

  Routing Information Sources:

    Gateway         Distance      Last **

    192.168.12.2         120      00:00:52

  Distance: (default is 120)

/上面显示的是此时发送的包为版本2的,接收也只能为版本2/

6.   案例配置文件

R1:

enable
conf t
hostname R1
interface Loopback0
 ip address 10.1.1.1 255.255.255.0
 no shutdown
 exit
interface Loopback1
 ip address 10.1.2.1 255.255.255.0
 no shutdown
 exit
interface FastEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 no shutdown
 exit
!
router rip
 version 2
 network 10.0.0.0
 network 192.168.12.0
 no auto-summary
!
end

R2:

enable
conf t
hostname R2
!
interface FastEthernet0/0
 ip address 192.168.12.2 255.255.255.0
 no shutdown
 exit
!
interface FastEthernet1/0
 ip address 192.168.23.2 255.255.255.0
 no shutdown
 exit
!
router rip
 version 2
 network 192.168.12.0
 network 192.168.23.0
 no auto-summary
!
end

R3:

enable
conf t
hostname R3
!
interface FastEthernet0/0
 ip address 192.168.23.3 255.255.255.0
 no shutdown
 exit
!
router rip
 version 2
 network 192.168.23.0
 no auto-summary
!
end

7.   案例总结及其它

1)默认下RIP版本,此时发送的包为版本1,能接收版本1和版本2的包。

2)RIP版本为2,此时发送的包为版本2,接收的包版本只能为2

3)RIP的每30秒更新一次路由表,180秒路由失效,240秒路由条目消失。

4)注意:R3中去往R1环回接口的跳数为2,去往R1F0/0接口跳数为1

5)120/1]】中120RIPAD1metric值,但RIPmetric是用跳数来算的,即为1跳。

 

 

 

 

 

-----------------------------------------------------------------------------------------

SPOTO 我们共创未来

 

您的朋友 周俊杰(Jay)
 

Email:zhoujj@spoto.net

新浪微博:http://weibo.com/zhoujj0130

新浪博客:http://blog.sina.com.cn/zhoujj0130

持续付出不亚于任何人的努力

-----------------------------------------------------------------------------------------


路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-5-8 07:28 , Processed in 0.058504 second(s), 18 queries , Gzip On.

返回顶部