#lab Redis1# OSPF和RIP互相重分布
实验拓扑:
配置:
R1-
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets //RIP重分布进OSPF,默认metric是20
network 13.1.1.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 110 metric 1 //OSPF重分布进RIP,默认metric无穷大,所以需要修改
network 12.0.0.0
no auto-summary
!
R2-
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
router rip
version 2
network 2.0.0.0
network 12.0.0.0
no auto-summary
!
R3-
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial1/0
ip address 13.1.1.3 255.255.255.0
serial restart-delay 0
!
router ospf 110
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
!
实验结果:
#lab Redis2# 静态路由重分布进RIP
实验拓扑:
配置:
R1-
interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets
network 13.1.1.0 0.0.0.255 area 0
!
router rip
version 2
redistribute static //重分布静态路由到RIP,默认metric是1
redistribute ospf 110 metric 1
network 12.0.0.0
no auto-summary
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 //静态路由
!
R2,R3配置同上
R4-
interface FastEthernet0/0
ip address 200.1.1.2 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
实验结果:
#lab Redis3# 将直连路由重分布进RIP
实验拓扑:
配置:
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets
network 13.1.1.0 0.0.0.255 area 0
!
router rip
version 2
redistribute connected //重分布直连路由进RIP,默认metric是1
redistribute static
redistribute ospf 110 metric 1
network 12.0.0.0
no auto-summary
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
R2,R3,R4配置同上
实验结果:
#lab Redis4# ISIS和EIGRP互相重分布,以及重分布直连和静态
实验拓扑:
配置:
R1-
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
ip router isis
serial restart-delay 0
clock rate 1008000
!
router eigrp 90
redistribute connected //重分布直连进EIGRP,默认metric是1
redistribute static //重分布静态进EIGRP,默认metric是1
redistribute isis level-1-2 metric 1500 100 255 1 1500 //重分布ISIS进EIGRP,默认metric是无穷大,所以需要修改
network 1.1.1.0 0.0.0.255
network 12.1.1.0 0.0.0.255
no auto-summary
!
router isis
net 49.0001.1111.1111.1111.00
log-adjacency-changes all
redistribute connected //重分布直连进ISIS,metric是0?
redistribute static ip //重分布静态不能进ISIS,原因同OSPF,因为是链路状态协议
redistribute eigrp 90 //重分布EIGRP到ISIS
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
ip route 9.9.9.0 255.255.255.0 FastEthernet0/0
R2-
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
router eigrp 90
network 2.2.2.0 0.0.0.255
network 12.1.1.0 0.0.0.255
no auto-summary
R3-
interface Loopback0
ip address 3.3.3.3 255.255.255.0
ip router isis
!
interface Serial1/0
ip address 13.1.1.3 255.255.255.0
ip router isis
serial restart-delay 0
!
router isis
net 49.0001.3333.3333.3333.00
log-adjacency-changes all
!
R4-
interface FastEthernet0/0
ip address 200.1.1.2 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
实验结果:
#lab Redis5# 循环重分布
配置:
R1-
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 14.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router eigrp 90
redistribute ospf 110 metric 1500 100 255 1 1500 //OSPF重分布进EIGRP
network 12.1.1.0 0.0.0.255
no auto-summary
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets //RIP重分布进OSPF
network 14.1.1.0 0.0.0.255 area 0
!
router rip
version 2
network 13.0.0.0
no auto-summary
!
R2-
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
router eigrp 90
network 2.2.2.0 0.0.0.255
network 12.1.1.0 0.0.0.255
no auto-summary
!
R3-
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Serial1/0
ip address 13.1.1.3 255.255.255.0
serial restart-delay 0
!
router rip
version 2
network 3.0.0.0
network 13.0.0.0
no auto-summary
!
R4-
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
ip address 14.1.1.4 255.255.255.0
duplex auto
speed auto
!
router ospf 110
router-id 4.4.4.4
log-adjacency-changes
network 4.4.4.0 0.0.0.255 area 0
network 14.1.1.0 0.0.0.255 area 0
!
实验结果:
#lab Redis6# distribute list
实验拓扑:
配置:
R1-
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 14.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router eigrp 90
redistribute ospf 110 metric 1500 100 255 1 1500 //OSPF重分布进EIGRP
network 12.1.1.0 0.0.0.255
distribute-list 4 out ospf 110 //使用分发列表过滤路由,在重分布的时候做,出方向
no auto-summary
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets
network 14.1.1.0 0.0.0.255 area 0
!
router rip
version 2
network 13.0.0.0
no auto-summary
!
access-list 4 permit 4.4.4.4 //ACL抓路由
R2,R3,R4配置同上
实验结果:
#lab Redis7# prefix list
实验拓扑:
配置:
R1-
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 14.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router eigrp 90
redistribute ospf 110 metric 1500 100 255 1 1500
network 12.1.1.0 0.0.0.255
distribute-list prefix 1 out Serial1/0 //出接口方向过滤路由
no auto-summary
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets
network 14.1.1.0 0.0.0.255 area 0
!
router rip
version 2
network 13.0.0.0
no auto-summary
!
ip prefix-list 1 seq 5 permit 14.1.1.0/24 //prefix list,后面默认deny any
R2,R3,R4配置同上
实验结果:
#lab Redis8# Route map
实验拓扑:
配置:
R1-
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 14.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router eigrp 90
redistribute ospf 110 metric 1500 100 255 1 1500
network 12.1.1.0 0.0.0.255
no auto-summary
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets route-map R //RIP重分布进OSPF,附带route map对路由进行操作
network 14.1.1.0 0.0.0.255 area 0
!
router rip
version 2
network 13.0.0.0
no auto-summary
!
ip prefix-list 1 seq 5 permit 14.1.1.0/24 //抓14网段路由
!
ip prefix-list 8 seq 5 permit 8.8.8.0/24 //抓8网段路由
access-list 3 permit 3.3.3.0 //抓3网段路由
access-list 4 permit 4.4.4.4 //抓4路由
!
route-map R permit 10 //route map做策略
match ip address 3
set metric-type type-1 //对3网段路由设置metric类型E1
!
route-map R permit 20
match ip address prefix-list 8
set metric 10 //对8网段路由设置seed metric是10
!
route-map R permit 30 //最后空语句允许所有,因为默认是deny all
R2,R4配置同上
R3-
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface Loopback8
ip address 8.8.8.8 255.255.255.0
!
interface Serial1/0
ip address 13.1.1.3 255.255.255.0
serial restart-delay 0
!
router rip
version 2
network 3.0.0.0
network 8.0.0.0
network 13.0.0.0
no auto-summary
实验结果:
#lab Redis9# RIP和OSPF双点双向重分布
实验拓扑:
配置:
R1-
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router ospf 110
router-id 1.1.1.1
log-adjacency-changes
redistribute rip subnets RIP重分布进OSPF
network 13.1.1.0 0.0.0.255 area 0
distance 121 4.4.4.4 0.0.0.0 //修改router ID 4.4.4.4传播过来的路由管理距离为121,大于RIP
!
router rip
version 2
redistribute ospf 110 metric 1 //OSPF重分布进RIP
network 1.0.0.0 //环回口在RIP网络中
network 12.0.0.0
no auto-summary
!
R2-
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface Serial1/0
ip address 12.1.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial1/1
ip address 24.1.1.2 255.255.255.0
serial restart-delay 0
!
router rip
version 2
network 2.0.0.0
network 12.0.0.0
network 24.0.0.0
no auto-summary
R3-
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 34.1.1.3 255.255.255.0
duplex auto
speed auto
!
interface Serial1/1
ip address 13.1.1.3 255.255.255.0
serial restart-delay 0
!
router ospf 110
router-id 3.3.3.3
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
network 34.1.1.0 0.0.0.255 area 0
!
R4-
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
ip address 34.1.1.4 255.255.255.0
duplex auto
speed auto
!
interface Serial1/1
ip address 24.1.1.4 255.255.255.0
serial restart-delay 0
clock rate 1008000
!
router ospf 110
router-id 4.4.4.4
log-adjacency-changes
redistribute rip subnets
network 4.4.4.0 0.0.0.255 area 0 //R4环回口路由在OSPF中
network 34.1.1.0 0.0.0.255 area 0
distance 121 1.1.1.1 0.0.0.0 //修改1.1.1.1传播过来的OSPF路由管理距离为121
!
router rip
version 2
redistribute ospf 110 metric 1
network 24.0.0.0
no auto-summary
!
实验结果: