RIPv2 的相关配置
Ru1 上的基本配置
Router>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
ru1(config-if)#no shut
%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-if)#exit
ru1(config)#
ru2上的基本配置
--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: n
Press RETURN to get started!
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
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
ru2(config-if)#no shut
%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-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
ru2(config-if)#exit
ru2(config)#
ru3上的基本配置Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
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
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
ru3(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to upexit
ru3(config)#int f0/0
ru3(config-if)#ip add 172.16.3.1 255.255.255.0
ru3(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
ru3(config-if)#exit
ru3(config)#
ru1上的rip具体配置ru1>en
ru1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
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
ru1(config)#
这是ru2上的
ru2>
ru2>en
ru2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
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
ru2(config)#
以下是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(config)#
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
ru3#
注意这里的连通情况
一个通一个不通
注意代灰色背景的路由信息和后面的区别
PC1上的配置
上面是pc2的
Pc3的
Ping一下pc1 看看连通性
下面我们关闭自动汇总 看看与之前有什么区别
简单的说关闭自动汇总是为了解决不连续子网相互访问的问题
Ru3>
Ru3>en
Ru3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Ru 3(config)#router rip
ru3(config-router)#version 2
ru3(config-router)#no au
ru3(config-router)#no auto-summary
ru3(config-router)#exit
ru3(config)#
其他两台路由做同样的设置
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, 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
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:00, 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 100 percent (5/5), round-trip min/avg/max = 7/7/8 ms
ru3#
被动接口:
由于内网的接口即f0/0接口连接主机,所以我们并不需要向这些接口发送路由更新信息,所以我们可以把这些接口设置为被动接口
被动接口的意思就是只接受rip更新而不向外发送路由更新信息
设置为被动接口,可以达到节省资源的目的
路由配置模式下
ru3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
ru3(config)#route rip
ru3(config-router)#version 2
ru3(config-router)#pass
ru3(config-router)#passive-interface f0/0
ru3(config-router)#exit
ru3(config)#
其他两台路由器上做同样的配置
我们用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#conf t
Enter configuration commands, one per line. End with CNTL/Z.
ru1(config)#
#设置后
ru1#sh ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 15 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
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
172.16.0.0
192.168.1.0
Passive Interface(s):
FastEthernet0/0
Routing Information Sources:
Gateway Distance Last Update
192.168.1.2 120 00:00:14
Distance: (default is 120)
ru1#