Router 3 Router3>enable Router3#configure terminal Router(config)#interface loopback0 Router(config-if)#ip address 172.168.11.1 255.255.255.0 ‍Router(config)#interface f0/0 Router(config-if)#ip address 172.168.12.1 255.255.255.0 ‍Router(config-if)#no shutdown Router(config-if)#exit Router(config)#router rip ‍Router(config-router)#version 2 Router(config-router)#no auto-summary Router(config-router)#network 172.168.0.0 Router(config-router)#exit Router(config)#exit Router0#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]
Router 4 Router4>enable Router4#configure terminal Router(config)#interface f0/0 Router(config-if)#ip address 172.168.12.2 255.255.255.0 Router(config-if)#no shutdown ‍Router(config)#interface f0/1 Router(config-if)#ip address 172.168.13.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#router rip ‍Router(config-router)#version 2 Router(config-router)#no auto-summary Router(config-router)#network 172.168.0.0 Router(config-router)#exit Router(config)#exit Router4#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] Router 5 Router5>enable Router3#configure terminal Router(config)#interface loopback0 Router(config-if)#ip address 172.168.14.1 255.255.255.0 ‍Router(config)#interface f0/1 Router(config-if)#ip address 172.168.13.2 255.255.255.0 ‍Router(config-if)#no shutdown Router(config-if)#exit Router(config)#router rip ‍Router(config-router)#version 2 Router(config-router)#no auto-summary Router(config-router)#network 172.168.0.0 Router(config-router)#exit Router(config)#exit Router0#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]
完成了,现在可以相互ping一下看看通不通了。
如:(在r3上ping172.168.14.1和172.168.13.1和172.168.13.2 在r4上ping172.168.11.1和172.168.14.1 在r5上ping172.168.11.1和172.168.12.1和172.168.12.2) 如果配置成功的话上面这些地址都可以ping的通。 在配置的过程中你可以用show ip route 这条命令来查看配置信息 如:在router3上显示 Router#show 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.168.0.0/24 is subnetted, 4 subnets
C
172.168.11.0 is directly connected, Loopback0 C
172.168.12.0 is directly connected, FastEthernet0/0 R
172.168.13.0 [120/1] via 172.168.12.2, 00:00:10, FastEthernet0/0 R
172.168.14.0 [120/2] via 172.168.12.2, 00:00:10, FastEthernet0/0 在router4上显示 Router#show 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.168.0.0/24 is subnetted, 4 subnets
R
172.168.11.0 [120/1] via 172.168.12.1, 00:00:13, FastEthernet0/0 C
172.168.12.0 is directly connected, FastEthernet0/0 C
172.168.13.0 is directly connected, FastEthernet0/1 R
172.168.14.0 [120/1] via 172.168.13.2, 00:00:15, FastEthernet0/1 在router5上显示 Router#show 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.168.0.0/24 is subnetted, 4 subnets
R
172.168.11.0 [120/2] via 172.168.13.1, 00:00:21, FastEthernet0/1 R
172.168.12.0 [120/1] via 172.168.13.1, 00:00:21, FastEthernet0/1 C
172.168.13.0 is directly connected, FastEthernet0/1 C
172.168.14.0 is directly connected, Loopback0 以上显示的信息表明它们之间已经相互学习到了路由信息,看看你配置的是否显示的一样。 仔细检查一下~ 完成了 |