|
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 |
l 在R1、R2、R3做基本的接口配置,并在R1上开启环回接口Loopback 0、Loopback 1。
l R1、R2、R3运行RIPv2协议,并且将环回接口都宣告进RIP进程中
l 实习全网互相通信。
1) 在R1、R2、R3做接口配置,并在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) 在R1、R2、R3上运行RIPv2协议
(config)#router rip //运行RIP协议//
(config-router)#version 2 //版本号为2//
(config-router)#no auto-summary //关闭自动汇总//
(config-router)#network x.x.x.x //宣告接口网段//
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 。
4) R3去pingR1的环回接口地址
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环回接口通信/
5) R3去pingR1的物理接口地址
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,接收版本为1和2
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/
1)默认下RIP版本,此时发送的包为版本1,能接收版本1和版本2的包。
2)RIP版本为2,此时发送的包为版本2,接收的包版本只能为2
3)RIP的每30秒更新一次路由表,180秒路由失效,240秒路由条目消失。
4)注意:R3中去往R1环回接口的跳数为2,去往R1的F0/0接口跳数为1 。
5)【120/1]】中120为RIP的AD值,1为metric值,但RIP中metric是用跳数来算的,即为1跳。
|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )
GMT+8, 2024-5-8 10:28 , Processed in 0.061057 second(s), 18 queries , Gzip On.