設置路由彙總

R1和R2的互聯地址爲192.168.0.0/30.R1和R3的互聯地址爲192.168.0.4/30,R3和R4的互聯地址爲192.168.0.8/30,使用Loopback地址添加多個網段,R2:10..0.1/24~10.1.3.1/24,R4:10.0.0.1/24~10.0.7.1/24,R2的Loopback地址在OSPF中發佈,R4的Loopback地址在RIP中發佈。

wKiom1faRr-xplRGAACLyqMymtE848.png-wh_50

R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface fastEthernet 1/0
R1(config-if)#ip address 192.168.0.5 255.255.255.252
R1(config-if)#no shutdown
R1(config-if)#exit

R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 192.168.0.2 255.255.255.252
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface loopback 0
R2(config-if)#ip address 10.1.0.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 1
R2(config-if)#ip address 10.1.1.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 2
R2(config-if)#ip address 10.1.2.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 3
R2(config-if)#ip address 10.1.3.1 255.255.255.0
R2(config-if)#exit

R3(config)#interface fastEthernet 0/0
R3(config-if)#ip address 192.168.0.6 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface fastEthernet 1/0
R3(config-if)#ip address 192.168.0.9 255.255.255.252
R3(config-if)#no shutdown
R3(config-if)#exit

R4(config)#interface fastEthernet 0/0
R4(config-if)#ip address 192.168.0.10 255.255.255.252
R4(config-if)#no shutdown
R4(config-if)#exit
R4(config)#interface loopback 0
R4(config-if)#ip address 10.0.0.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 1
R4(config-if)#ip address 10.0.1.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 2
R4(config-if)#ip address 10.0.2.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 3
R4(config-if)#ip address 10.0.3.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 4
R4(config-if)#ip address 10.0.4.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 5
R4(config-if)#ip address 10.0.5.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 6
R4(config-if)#ip address 10.0.6.1 255.255.255.0
R4(config-if)#exit
R4(config)#interface loopback 7
R4(config-if)#ip address 10.0.7.1 255.255.255.0
R4(config-if)#exit

R2(config)#router ospf 10
R2(config-router)#network 10.1.0.0 0.0.0.255 area 1
R2(config-router)#network 192.168.0.0 0.0.0.3 area 1
R2(config-router)#network 10.1.1.0 0.0.0.255 area 1
R2(config-router)#network 10.1.2.0 0.0.0.255 area 1
R2(config-router)#network 10.1.3.0 0.0.0.255 area 1
R2(config-router)#exit

R1(config)#router ospf 10
R1(config-router)#network 192.168.0.0 0.0.0.3 area 1
R1(config-router)#network 192.168.0.4 0.0.0.3 area 0
R1(config-router)#exit

R3(config)#router ospf 10
R3(config-router)#network 192.168.0.4 0.0.0.3 area 0
R3(config-router)#exit
R3(config)#router rip
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.0.0
R3(config-router)#exit

R4(config)#router rip
R4(config-router)#no auto-summary
R4(config-router)#network 192.168.0.0
R4(config-router)#network 10.0.0.0
R4(config-router)#network 10.0.1.0
R4(config-router)#network 10.0.2.0
R4(config-router)#network 10.0.3.0
R4(config-router)#network 10.0.4.0
R4(config-router)#network 10.0.5.0
R4(config-router)#network 10.0.6.0
R4(config-router)#network 10.0.7.0
R4(config-router)#exit

R3(config)#router rip
R3(config-router)#redistribute ospf 10 metric 10  
R3(config-router)#exit
R3(config)#router ospf 10
R3(config-router)#redistribute rip
R3(config-router)#redistribute rip subnets
R3(config-router)#exit

R1(config)#router ospf 10
R1(config-router)#area 1 range 10.1.0.0 255.255.252.0
R1(config-router)#exit
R3(config)#router ospf 10
R3(config-router)#summary-address 10.0.0.0 255.255.248.0
R3(config-router)#exit

R1(config)#do show ip route
     10.0.0.0/8 is variably subnetted, 6 subnets, 3 masks
O       10.1.2.1/32 [110/2] via 192.168.0.2, 00:12:23, FastEthernet0/0
O       10.1.3.1/32 [110/2] via 192.168.0.2, 00:12:23, FastEthernet0/0
O       10.1.0.1/32 [110/2] via 192.168.0.2, 00:12:23, FastEthernet0/0
O E2    10.0.0.0/21 [110/20] via 192.168.0.6, 00:08:18, FastEthernet1/0
O       10.1.1.1/32 [110/2] via 192.168.0.2, 00:12:23, FastEthernet0/0
O       10.1.0.0/22 is a summary, 00:12:23, Null0
     192.168.0.0/30 is subnetted, 3 subnets
O E2    192.168.0.8 [110/20] via 192.168.0.6, 00:12:25, FastEthernet1/0
C       192.168.0.0 is directly connected, FastEthernet0/0
C       192.168.0.4 is directly connected, FastEthernet1/0

R3(config)# do show ip route
     10.0.0.0/8 is variably subnetted, 3 subnets, 3 masks
O       10.0.0.0/21 is a summary, 00:08:06, Null0
R       10.0.0.0/8 [120/1] via 192.168.0.10, 00:00:25, FastEthernet1/0
O IA    10.1.0.0/22 [110/3] via 192.168.0.5, 00:12:11, FastEthernet0/0
     192.168.0.0/30 is subnetted, 3 subnets
C       192.168.0.8 is directly connected, FastEthernet1/0
O IA    192.168.0.0 [110/2] via 192.168.0.5, 00:15:47, FastEthernet0/0
C       192.168.0.4 is directly connected, FastEthernet0/0

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章