总结一下ospf中路由的重分发基础实验。

网络构建的拓扑图如下:

redistribute ospf 1 redistribute ospf 1 metric 3_网络

要求:PC3充当外网用户,PC1与PC2是内网。使得内外互通。(没做NAT

其中在R3路由上重分发静态路由以及直连路由
在R2上重分发默认路由
R1上重分发rip和ospf(注意重分发ospf时,要选择redistribute ospf 1 metric 3(metric 度量值 ,而 RIP 的度量是跳数, 所以 METRIC 3 就是3 跳 ,另外重分布进RIP的时候,必须要制定跳数)

根据要求完成基础配置。

R1:
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
 
 interface GigabitEthernet0/0
 ip address 172.16.10.1 255.255.255.252
 
interface GigabitEthernet0/1
 ip address 40.1.1.254 255.0.0.0

interface GigabitEthernet0/2
 ip address 10.1.1.1 255.0.0.0

router ospf 1
 redistribute rip subnets ---------------------rip重分发
 network 1.1.1.1 0.0.0.0 area 0
 network 10.1.1.1 0.0.0.0 area 0

router rip
 version 2
 redistribute ospf 1 metric 3 ---------------------ospf重分发
 network 40.0.0.0

R2:

interface Loopback0
 ip address 2.2.2.2 255.255.255.255

interface GigabitEthernet0/0
 ip address 172.16.10.1 255.255.255.252

interface GigabitEthernet0/1
 ip address 20.1.1.1 255.0.0.0

interface GigabitEthernet0/2
 ip address 10.1.1.254 255.0.0.0

router ospf 1
 network 20.1.1.1 0.0.0.0 area 1
 network 10.1.1.254 0.0.0.0 area 0
 network 2.2.2.2 0.0.0.0 area 0
 default-information originate---------------------默认路由重分发

ip route 0.0.0.0 0.0.0.0 172.16.10.2  ---------------------默认路由

R3:
interface Loopback0
 ip address 3.3.3.3 255.255.255.255

interface GigabitEthernet0/0
 ip address 30.1.1.1 255.0.0.0

interface GigabitEthernet0/1
 ip address 20.1.1.254 255.0.0.0

router ospf 1
 redistribute static subnets ---------------------静态路由重分发
 redistribute connected subnets ---------------------直连路由重分发
 network 3.3.3.3 0.0.0.0 area 1
 network 20.1.1.254 0.0.0.0 area 1
 
ip route 192.168.30.0 255.255.255.0 30.1.1.254 

R4:
interface Loopback0
 ip address 4.4.4.4 255.255.255.255

interface GigabitEthernet0/0
 ip address 192.168.10.254 255.255.255.0

interface GigabitEthernet0/1
 ip address 40.1.1.1 255.0.0.0

router rip
 version 2
 network 4.0.0.0
 network 40.0.0.0
 network 192.168.10.0

ISP:

interface GigabitEthernet0/0
 ip address 172.16.10.2 255.255.255.252

interface GigabitEthernet0/1
 ip address 56.57.58.254 255.255.255.0

ip route 0.0.0.0 0.0.0.0 172.16.10.1 

S2:

interface FastEthernet0/1
 no switchport
 ip address 30.1.1.254 255.0.0.0

interface FastEthernet0/2
 no switchport
 ip address 192.168.30.254 255.255.255.0

ip route 0.0.0.0 0.0.0.0 30.1.1.1

PC1:

redistribute ospf 1 redistribute ospf 1 metric 3_路由器_02

PC2:

redistribute ospf 1 redistribute ospf 1 metric 3_路由器_03

PC3:

redistribute ospf 1 redistribute ospf 1 metric 3_网络_04


基础配置完毕,验证一下是否正确。
PC1 ping PC2:

redistribute ospf 1 redistribute ospf 1 metric 3_cisco_05


PC3 ping PC2:

redistribute ospf 1 redistribute ospf 1 metric 3_cisco_06

最后还是跟往常一样发两个发包过程

redistribute ospf 1 redistribute ospf 1 metric 3_R3_07

redistribute ospf 1 redistribute ospf 1 metric 3_R3_08