| 
 | 
	
 
在实际工作中,我们会遇到使用多个IP协议的网络。为了使整个正常地工作,必须在多个路由协议之间进行成功的再分配。 
 以下列举了OSPF与RIP之间重新分配的设置范例: 
 Router1的Serial 0端口和Router2的Serial 0端口运行OSPF,在Router1的Ethernet 0端口运行RIP 2,Router3运行RIP2,Router2有指向Router4的192.168.2.0/24网的静态路由,Router4使用默认静态路由。需要在Router1和Router3之间重新分配OSPF和RIP路由,在Router2上重新分配静态路由和直连的。 
 范例所涉及的命令 
 任务 命令 
 重新分配直连的 redistribute connected 
 重新分配静态 redistribute static 
 重新分配ospf redistribute ospf process-id metric metric-value 
 重新分配rip redistribute rip metric metric-value 
 Router1: 
 interface ethernet 0 
 ip address 192.168.1.1 255.255.255.0 
 ! 
 interface serial 0 
 ip address 192.200.10.5 255.255.255.252 
 ! 
 router ospf 100 
 redistribute rip metric 10 
 network 192.200.10.4 0.0.0.3 area 0 
 ! 
 router rip 
 version 2 
 redistribute ospf 100 metric 1 
 network 192.168.1.0 
 ! 
 Router2: 
 interface loopback 1 
 ip address 192.168.3.2 255.255.255.0 
 ! 
 interface ethernet 0 
 ip address 192.168.0.2 255.255.255.0 
 ! 
 interface serial 0 
 ip address 192.200.10.6 255.255.255.252 
 ! 
 router ospf 200 
 redistribute connected subnet 
 redistribute static subnet 
 network 192.200.10.4 0.0.0.3 area 0 
 ! 
 ip route 192.168.2.0 255.255.255.0 192.168.0.1 
 ! 
 Router3: 
 interface ethernet 0 
 ip address 192.168.1.2 255.255.255.0 
 ! 
 router rip 
 version 2 
 network 192.168.1.0 
 ! 
 Router4: 
 interface et 
1 |   
 
 
 
 |