OSPF重发布、直连、静态、默认路由、配置

拓扑图:

OSPF重发布、直连、静态、默认路由、配置_第1张图片

 理解:

1、路由重分发概述:
   每个路由协议和该路由协议所服务的网络属于同一个自治系统,
   路由重分发特性以交换由不同协议创建的路由信息进行通信。


2、路由重分发的路径的路径类型:
    类型1:内部开销+外部开销   
    类型2:外部开销  默认类型2

3、目的:
    1、Client1通过http访问Server1;
    2、PC2能够ping通Client1、Server1
------------------------------------------------------------
配置:
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.11.1 255.255.255.0
[r1-GigabitEthernet0/0/0]un shutdown 

[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.12.1 255.255.255.0
[r1-GigabitEthernet0/0/1]un shutdown 
 
[r1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 192.168.13.1 255.255.255.0
[r1-GigabitEthernet0/0/2]un shutdown     

[r1]ospf 1 router-id 1.1.1.1 
[r1-ospf-1]default-route-advertise always //重分发默认路由
[r1-ospf-1]area 0    
[r1-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
    
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]ne    
[r1-ospf-1-area-0.0.0.1]network 192.168.13.0 0.0.0.255

[r1]ip route-static 0.0.0.0 0.0.0.0 192.168.11.2
-----------------------------------------------------------------
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.2.254 255.255.255.0
[r2-GigabitEthernet0/0/0]un shutdown 

[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.12.2 255.255.255.0
[r2-GigabitEthernet0/0/1]un shutdown 
    
[r2]ospf 1 router-id 2.2.2.2    
[r2-ospf-1]import-route direct     //重分发直连路由
[r2-ospf-1]area 0    
[r2-ospf-1-area-0.0.0.0]network 192.168.12.0 0.0.0.255
-----------------------------------------------------------------
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.34.3 255.255.255.0
[r3-GigabitEthernet0/0/0]un shutdown 
 
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]ip add 192.168.13.3 255.255.255.0    
[r3-GigabitEthernet0/0/2]un shutdown 
 
    
[r3]ospf 1 router-id  3.3.3.3    
[r3-ospf-1]import-route static //重分发静态路由    
[r3-ospf-1]area 1    
[r3-ospf-1-area-0.0.0.1]network 192.168.13.0 0.0.0.255

[r3]ip route-static 192.168.4.0 255.255.255.0 192.168.34.4
-----------------------------------------------------------------
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.34.4 255.255.255.0
[r4-GigabitEthernet0/0/0]un shutdown 

[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.4.254 255.255.255.0
[r4-GigabitEthernet0/0/1]un shutdown 

[r4]ip route-static 0.0.0.0 0.0.0.0 192.168.34.3
------------------------------------------------------------------
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 192.168.11.2 255.255.255.0    
[ISP-GigabitEthernet0/0/0]un shutdown 

[ISP]int g0/0/1
[ISP-GigabitEthernet0/0/1]ip add 192.168.1.254 255.255.255.0    
[ISP-GigabitEthernet0/0/1]un shutdown 

[ISP]ip route-static 192.168.2.0 255.255.255.0 192.168.11.1
[ISP]ip route-static 192.168.4.0 255.255.255.0 192.168.11.1
---------------------------------------------------------------------
验证命令:
display ospf routing
display ip routing-table
---------------------------------------------------------------------

 

你可能感兴趣的:(华为网络设备配置技术)