利用OSPF等多种协议实现全网互通

利用OSPF等多种协议实现全网互通

需求分析:

公司网络中运行了多种路由协议,通过重分发实现内网互通,
并通过R3总公司网络重分发默认路由实现全网互通。
(注:拓扑中未详细说明的IP段落均以192.168开头,
如10.1段落意为192.168.10.1/24)

具体配置流程如下:

R1配置

1、配置端口IP

int f0/0
ip add 192.168.30.1 255.255.255.0
int f0/1
ip add 192.168.20.2 255.255.255.0

2、R1和R2之间为静态路由:

ip route 192.168.10.0 255.255.255.0 192.168.20.1

3、配置OSPF,宣告直连网段,重分发未知网段

router ospf 1 ##设置ospf进程号为1;
router-id 1.1.1.1 ##设置router-id;
network 192.168.30.0 0.0.0.255 area 1 ##宣告在area1中的网段(采取反掩码)
redistribute connected subnets ##重分发直连的20网段
redistribute static subnets ##重分发静态路由部分

R2配置

R1和R2之间组成内部网络,因此不需要设置ospf等协议;

1、配置端口IP

int f0/0
ip add 192.168.20.1 255.255.255.0
int f0/1
ip add 192.168.10.2 255.255.255.0

2、R2和R1之间为静态路由:

ip route 0.0.0.0 0.0.0.0 192.168.20.2

R3配置

R3为域间路由,扮演着ABR的角色,同时又和直连PC与ISP运营商相连;

1、配置端口IP

int f0/0
ip add 192.168.30.2 255.255.255.0
int f0/1
ip add 192.168.40.1 255.255.255.0
int range f1/0 -1 ##综合配置端口
no switchport ##打开端口的路由功能
int f1/0
ip add 12.0.0.1 255.255.255.0
int f1/1
ip add 192.168.70.2 255.255.255.0

2、R3和ISP为默认路由

ip route 0.0.0.0 0.0.0.0 12.0.0.2

3、配置ospf,宣告直连网段

router ospf 1
router-id 3.3.3.3 ##设置router-id
network 192.168.30.0 0.0.0.255 area 1
network 192.168.40.0 0.0.0.255 area 0
##此处端口所在网段在哪个area,宣告时需要注意;
network 192.168.70.0 0.0.0.255 area 0

4、重分发R3直连区域未知网络
R3和ISP为直连默认路由

default-information originate ##重分发默认路由

R4配置

R4隶属于area0,扮演ASBR的角色

1、配置端口IP

int f0/0
ip add 192.168.40.2 255.255.255.0
int f0/1
ip add 192.168.50.1 255.255.255.0

2、配置ospf协议,宣告直连网段

router ospf 1
router-id 4.4.4.4
network 192.168.40.0 0.0.0.255 area 0

3、配置rip协议
R4路由50.0网段端口连接rip协议,故需要配置rip

router rip
version 2
no auto-summary
network 192.168.50.0 ##宣告50.0网段

4、重分发rip协议网段;

ospf区域中注入rip协议;

router ospf 1
redistribute rip subnets

rip中注入ospf协议;

router rip
redistribute ospf 1 metric 3

R6配置

R6整个路由器运行rip协议

1、配置端口IP

int f0/0
ip add 192.168.50.2 255.255.255.0
int f0/1
ip add 192.168.60.1 255.255.255.0

2、配置rip协议,宣告rip网段

router rip
version 2
no auto-summary
network 192.168.50.0
network 192.168.60.0 ##宣告rip直连网段

ISP配置

ISP与R3直连,故配置默认路由

1、配置端口IP

int f0/0
ip add 12.0.0.2 255.255.255.0
int f0/1
ip add 13.0.0.1 255.255.255.0

2、配置默认路由

ip route 0.0.0.0 0.0.0.0 12.0.0.1

各个路由及协议配置完成,利用VPCS配置及检验是否互通;
利用OSPF等多种协议实现全网互通
由上,实现了全网互通!

猜你喜欢

转载自blog.51cto.com/13659253/2125233