Router>en 15
Router#conf ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int s1/0
Router(config-if)#ip add 192.168.4.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#hostname R4
R4(config)#int f0/0
R4(config-if)#ip add 192.168.5.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#loop
R4(config)#router ospf 10
R4(config)#router ospf 10 [ospf路由协议的配置方法]
R4(config-router)#network 192.168.4.0 0.0.0.255 area 2
R4(config-router)#network 192.168.5.0 0.0.0.255 area 2
R4(config-router)#exit
R4(config-router)#area 2 stub【设置末节区域】
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55555555555555555555555555555
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Router>en 15
Router#conf ter
Router(config)#hostname R5
R5(config)#int s1/2
R5(config-if)#ip add 192.168.6.2 255.255.255.0
R5(config-if)#no shut
R5(config-if)#int s1/0
R5(config-if)#ip add 192.168.7.1 255.255.255.0
R5(config-if)#no shut
R5(config-router)#router rip
R5(config-router)#network 192.168.6.0
R5(config-router)#network 192.168.7.0
R5(config-router)#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
666666666666666666666666666666
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Router>en 15
Router#conf ter
Router(config)#int s1/0
Router(config-if)#ip add 192.168.7.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
Router(config-if)#int f0/0
Router(config-if)#ip add 192.168.8.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#loop
Router(config-if)#
Router(config-if)#exit
Router(config)#router rip【RIP的路由协议配置】
Router(config-router)#network 192.168.7.0【跟上直连的网段】
Router(config-router)#network 192.168.8.0
Router(config-router)#【R6配置完毕】
试验完成
观察R2上的路由表
Gateway of last resort is 0.0.0.0 to network 0.0.0.0
R 192.168.8.0/24 [120/2] via 192.168.6.2, 00:00:22, Serial1/2
O IA 192.168.4.0/24 [110/128] via 192.168.3.2, 00:31:30, Serial1/1
O IA 192.168.5.0/24 [110/129] via 192.168.3.2, 00:02:02, Serial1/1
C 192.168.6.0/24 is directly connected, Serial1/2
R 192.168.7.0/24 [120/1] via 192.168.6.2, 00:00:22, Serial1/2
O 192.168.1.0/24 [110/65] via 192.168.2.1, 00:31:30, Serial1/0
C 192.168.2.0/24 is directly connected, Serial1/0
C 192.168.3.0/24 is directly connected, Serial1/1
S* 0.0.0.0/0 is directly connected, Null0
R2#
观察R4上的路由表
R4为完全末节区域,学习到的路由表只有自己本区域和一条直连路由。
Gateway of last resort is 192.168.4.1 to network 0.0.0.0
C 192.168.4.0/24 is directly connected, Serial1/0
C 192.168.5.0/24 is directly connected, FastEthernet0/0
O*IA 0.0.0.0/0 [110/65] via 192.168.4.1, 00:02:18, Serial1/0
R4#
观察R5上的路由表
R5为RIP区域,在小型网络中应用,外界的路由太多会影响本区域内网络设备的通信速度,因此学习除了本区域,外部区域的路由均为静态默认路由
Gateway of last resort is 192.168.6.1 to network 0.0.0.0
R 192.168.8.0/24 [120/1] via 192.168.7.2, 00:00:19, Serial1/0
C 192.168.6.0/24 is directly connected, Serial1/2
C 192.168.7.0/24 is directly connected, Serial1/0
R* 0.0.0.0/0 [120/1] via 192.168.6.1, 00:00:08, Serial1/2
R5#