OSPF多进程之间的路由重发布1、实验拓扑如下图:
R1
R4
R3 R2
Area 0
0spf 10
Area 0
Ospf 100
2、实验目的:
1、实现R2与R3之间互相访问时的数据分流。
R2访问R3的3.3.3.3/32时走R1,R2访问R3的30.30.30.30/32时走R4。
R3访问R2的2.2.2.2/32时走R1,R3访问R2的20.20.20.20/32时走R1。
2、实现线路的冗余备份。
当R1链路故障时数据可以走R4,当R4链路故障时数据可以走R1。实现链路的冗余备份。
3、理解并掌握route-map在控制路由方面的应用。
3、实验配置文档
R1配置:
config ter
int f0/0
ip add 10.0.0.1 255.255.255.252
no shut
int f1/0
ip add 10.0.0.5 255.255.255.252
no shut
int lo 0
ip add 1.1.1.1 255.255.255.255
end
write
config ter
router ospf 10
router-id 1.1.1.1
network 10.0.0.0 0.0.0.3 area 0
redistribute ospf 100 metric-type 1 subnets route-map ospf100_to_ospf10 distribute-list deny_ospf100 in
end
config ter
router ospf 100
router-id 1.1.1.1
network 10.0.0.4 0.0.0.3 area 0
redistribute ospf 10 metric-type 1 subnets route-map ospf10_to_ospf100 distribute-list deny_ospf10 in
end
write
ip access-list standard deny_ospf10
deny 2.2.2.2 0.0.0.0
deny 20.20.20.20 0.0.0.0
permit any
ip access-list standard deny_ospf100
deny 3.3.3.3 0.0.0.0
deny 30.30.30.30 0.0.0.0
permit any
access-list 10 permit 2.2.2.2 0.0.0.0
access-list 11 permit 3.3.3.3 0.0.0.0
access-list 20 permit 20.20.20.20 0.0.0.0
access-list 21 permit 30.30.30.30 0.0.0.0
route-map ospf100_to_ospf10 permit 10
match ip address 11
set metric 100
route-map ospf100_to_ospf10 permit 20
match ip address 21
set metric 200
route-map ospf10_to_ospf100 permit 10
match ip address 10
set metric 100
route-map ospf10_to_ospf100 permit 20
match ip address 20
set metric 200
R4配置:
config ter
int f0/0
ip add 172.16.0.1 255.255.255.252
no shut
int f1/0
ip add 172.16.0.5 255.255.255.252
no shut
int lo 0
ip add 4.4.4.4 255.255.255.255
end
write
config ter
router ospf 10
router-id 4.4.4.4
network 172.16.0.4 0.0.0.3 area 0
redistribute ospf 100 metric-type 1 subnets route-map ospf100_to_ospf10 distribute-list deny_ospf100 in
end
config ter
router ospf 100
router-id 4.4.4.4
network 172.16.0.0 0.0.0.3 area 0
redistribute ospf 10 metric-type 1 subnets route-map ospf10_to_ospf100 distribute-list deny_ospf10 in
end
write
ip access-list standard deny_ospf10
deny 2.2.2.2 0.0.0.0
deny 20.20.20.20 0.0.0.0
permit any
ip access-list standard deny_ospf100
deny 3.3.3.3 0.0.0.0
deny 30.30.30.30 0.0.0.0
permit any
access-list 10 permit 2.2.2.2 0.0.0.0
access-list 11 permit 3.3.3.3 0.0.0.0
access-list 20 permit 20.20.20.20 0.0.0.0
access-list 21 permit 30.30.30.30 0.0.0.0
route-map ospf100_to_ospf10 permit 10 match ip address 11
set metric 200
route-map ospf100_to_ospf10 permit 20 match ip address 21
set metric 100
route-map ospf10_to_ospf100 permit 10 match ip address 10
set metric 200
route-map ospf10_to_ospf100 permit 20 match ip address 20
set metric 100
R2的配置:
config ter
int f0/0
ip add 10.0.0.2 255.255.255.252
no shut
int f1/0
ip add 172.16.0.6 255.255.255.252
no shut
int lo 0
ip add 2.2.2.2 255.255.255.255
int lo 1
ip add 20.20.20.20 255.255.255.255 end
write
config ter
router ospf 10
router-id 2.2.2.2
network 172.16.0.4 0.0.0.3 area 0 network 10.0.0.0 0.0.0.3 area 0 network 2.2.2.2 0.0.0.0 area 0
network 20.20.20.20 0.0.0.0 area 0
end
write
R3的配置:
config ter
int f0/0
ip add 10.0.0.6 255.255.255.252
no shut
int f1/0
ip add 172.16.0.2 255.255.255.252
no shut
int lo 0
ip add 3.3.3.3 255.255.255.255
int lo 1
ip add 30.30.30.30 255.255.255.255
end
write
config term
router ospf 100
router-id 3.3.3.3
network 172.16.0.0 0.0.0.3 area 0
network 10.0.0.4 0.0.0.3 area 0
network 3.3.3.3 0.0.0.0 area 0
network 30.30.30.30 0.0.0.0 area 0
end
write
4、实验测试
1、在R2上show ip route查看结果,可以看出实现了数据分流。
2、在R1上将R1的f/0接口shutdown,然后再在R2上show ip route查看结果,可以看出去往3.3.3.3/32的路径变为R4的F1/0接口,同时cost变为201。
5、实验结果
实验目的中的需求全部实现。
6、实验总结
双向双点路由重发布步骤总结
1、接口IP,vlan、网关的基本配置。
对于ppp、帧中继线路需要特别注意
2、用ACL进行源地址的过滤,主要是四个ACL:业务、办公、业务服务器、办公服务器。
注意每一个网段单独一个ACL,便于metric的设置。permit,其它默认deny。
3、用ACL过滤来回路由重发布时需要拒绝的网段,一般为两个,业务、办公去往服务器
的定义为一个命名的ACL,方便记忆。业务服务器、办公服务器去往业务、办公网段定义为一个。一条ACL里至少含有两条deny。最后允许所有。
4、创建route-map规则,一般为四条,业务去往业务服务器、办公去往办公服务器、业
务服务器去往业务、办公服务器去往办公。在双向双点重发布时可以设置不同的metric 实现分流。
5、在不同的ospf进程中重发布其它的进程,redistribute route-map subnets。并且隔绝环
路:distribute 步骤3 in。