From c24720a6ab54479cff475b7ab4e715ad05dc0115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=80=9D?= <1662679300@qq.com> Date: Wed, 23 Apr 2025 19:38:12 +0800 Subject: [PATCH] 4.23 --- ...06\345\217\221\351\205\215\347\275\256.md" | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 "21 \344\270\201\346\235\250\346\202\246/20250422 \350\267\257\347\224\261\351\207\215\345\210\206\345\217\221\351\205\215\347\275\256.md" diff --git "a/21 \344\270\201\346\235\250\346\202\246/20250422 \350\267\257\347\224\261\351\207\215\345\210\206\345\217\221\351\205\215\347\275\256.md" "b/21 \344\270\201\346\235\250\346\202\246/20250422 \350\267\257\347\224\261\351\207\215\345\210\206\345\217\221\351\205\215\347\275\256.md" new file mode 100644 index 0000000..2b41d27 --- /dev/null +++ "b/21 \344\270\201\346\235\250\346\202\246/20250422 \350\267\257\347\224\261\351\207\215\345\210\206\345\217\221\351\205\215\347\275\256.md" @@ -0,0 +1,133 @@ +### 20250422 路由重分发配置 + +#### OSPF和RIP + +``` +OSPF路由配置 + Router(config)#router ospf 1 // 进入OSPF进程配置模式 + Router(config-router)#network 2.2.2.0 0.0.0.255 area 0 + Router(config-router)#redistribute rip subnets + rip + Router(config)#router rip // 进入RIP进程配置模式 + Router(config-router)#version 2 + Router(config-router)#network 2.2.2.0 + Router(config-router)#redistribute ospf 1 metric 10 +``` + + + +#### OSPF和静态路由 + +``` +OSPF路由配置 + Router(config)# ip route 30.30.30.0 255.255.255.0 20.20.20.2 + Router(config)#router ospf 1 // 进入OSPF进程配置模式 + Router(config-router)#network 20.20.20.0 0.0.0.255 area 0 + Router(config-router)#redistribute static subnets // 重分发静态路由(包含子网信息) + + 静态路由配置 + Router(config)#ip route 0.0.0.0 0.0.0.0 20.20.20.1 + +为实现互联可以添加一个ospf协议 +R2# router ospf 1 +R2# network 20.20.20.0 0.0.0.255 area 0 +R2# network 30.30.30.0 0.0.0.255 area 0 + +``` + +![OSPF 静态](https://gitee.com/raising-only-fish/picture-warehouse/raw/master/img/upgit_20250423_1745408224.png) + +### RIP和静态路由 + +``` + # RIP路由配置 + Router(config)# ip route 70.70.70.0 255.255.255.0 60.60.60.2 + Router(config)#router rip // 进入OSPF进程配置模式 + Router(config-router)#network 60.60.60.0 + Router(config-router)#redistribute static // 重分发静态路由(包含子网信息) + + # 静态路由配置 + Router(config)#ip route 0.0.0.0 0.0.0.0 60.60.60.1 + +为实现互联可以添加一个rip协议 +R2(config)# router rip +R2(config-router)# version 2 +R2(config-router)# network 60.60.60.0 +R2(config-router)# network 70.70.70.0 +R2(config-router)# no auto-summary +``` + +![rip 静态](https://gitee.com/raising-only-fish/picture-warehouse/raw/master/img/upgit_20250423_1745408211.png) + +### 扩展作业 + +``` +# 核心路由器配置 + Router(config)# hostname Core + Core(config)# interface g0/0 + Core(config-if)# ip address 9.9.9.2 255.255.255.0 + Core(config-if)# no shutdown + Core(config-if)# exit + + Core(config)# interface g0/1 + Core(config-if)# ip address 11.11.11.1 255.255.255.0 + Core(config-if)# no shutdown + Core(config-if)# exit + + Core(config)# interface g0/2 + Core(config-if)# ip address 12.12.12.2 255.255.255.0 + Core(config-if)# no shutdown + Core(config-if)# exit + + Core(config)# router ospf 1 //配置OSPF网络 + Core(config-router)# network 9.9.9.0 0.0.0.255 area 0 + + Core(config)# router rip //配置RIP网络 + Core(config-router)# version 2 + Core(config-router)# network 11.11.11.0 + Core(config-router)# no auto-summary + + Core(config)# ip route 192.168.200.0 255.255.255.0 12.12.12.1 // 配置静态路由网络 + Core(config)# ip route 192.168.220.0 255.255.255.0 12.12.12.1 + + Core(config)# router ospf 1 //路由重分发(关键步骤) + Core(config-router)# redistribute rip subnets + Core(config-router)# redistribute static subnets + Core(config)# router rip + Core(config-router)# redistribute ospf 1 metric 5 + Core(config-router)# redistribute static + + # OSPF网络路由器配置 + RouterA(config)# interface g0/2 + RouterA(config-if)# ip address 9.9.9.1 255.255.255.0 + RouterA(config-if)# no shutdown + RouterA(config-if)# exit + + RouterA(config)# router ospf 1 + RouterA(config-router)# network 9.9.9.0 0.0.0.255 area 0 + RouterA(config-router)# network 192.168.10.0 0.0.0.255 area 0 + RouterA(config-router)# network 192.168.20.0 0.0.0.255 area 0 + + # RIP网络路由器配置 + RouterB(config)# interface g0/2 + RouterB(config-if)# ip address 11.11.11.2 255.255.255.0 + RouterB(config-if)# no shutdown + RouterB(config-if)# exit + + RouterB(config)# router rip + RouterB(config-router)# version 2 + RouterB(config-router)# network 11.11.11.0 + RouterB(config-router)# network 192.168.100.0 + RouterB(config-router)# network 192.168.120.0 + RouterB(config-router)# no auto-summary + + # 静态网络路由器配置 + RouterC(config)# interface g0/2 + RouterC(config-if)# ip address 12.12.12.1 255.255.255.0 + RouterC(config-if)# no shutdown + RouterC(config-if)# exit + + RouterC(config)# ip route 0.0.0.0 0.0.0.0 12.12.12.2 +``` + +![62cf9e44999b23922847f3210910fe3](https://gitee.com/raising-only-fish/picture-warehouse/raw/master/img/upgit_20250423_1745408170.png) \ No newline at end of file -- Gitee